Skip to content

Instantly share code, notes, and snippets.

var numRows = 4
var numCols = 6
var dims = [numRows, numCols]
var conjunctions = ['0_2', '1_2', '1_0', '1_3']
var logit = function(p) {
return ad.scalar.sub(ad.scalar.log(p), ad.scalar.log(ad.scalar.sub(1, p)));
}
import numpy as np
import pandas as pd
import boto3
import xmltodict
import csv
import os
import argparse
# looks for a credentials.py defining the ACCESS_ID and SECRET_KEY
import credentials
@hawkrobe
hawkrobe / handRuleModel.wppl
Created November 16, 2017 07:05
Working example of juror reasoning about reasonableness
// example of extreme value
var extremeValues = {burden: 50,
prob: .00001,
quanta: 1500000}
var options = {method: 'forward', samples: 25000}
// The naive standard for reasonableness
var handPolicy = function(burden, prob, quanta) {
return (burden < (prob * quanta) ?
// Written for webppl dev branch -- there may be breaking changes
var init = function(n,y){
return repeat(n, function(){ return y; });
};
var step = function(states, p, n){
return map(
function(x) { return x + binomial(p,n) },
states
@hawkrobe
hawkrobe / client.js
Created February 8, 2016 20:25
keep track of whether user has switched tabs...
var visible = "visible";
// Automatically registers whether user has switched tabs...
(function() {
document.hidden = hidden = "hidden";
// Standards:
if (hidden in document) {
document.addEventListener("visibilitychange", onchange);
} else if ((hidden = "mozHidden") in document) {
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<label t="translate(0,346)">