# Joint Inference Experiment (oTree + Heroku) ## Local testing ```bash pip install -r requirements.txt otree devserver # open http://localhost:8000 ``` ## Heroku deployment ```bash # from this directory git init git add . git commit -m "Initial commit" # create heroku app heroku create your-app-name heroku addons:create heroku-postgresql:essential-0 heroku addons:create heroku-redis:mini # config vars heroku config:set OTREE_PRODUCTION=1 heroku config:set OTREE_ADMIN_PASSWORD=YOUR_PASSWORD_HERE heroku config:set OTREE_SECRET_KEY=$(python -c "import secrets; print(secrets.token_urlsafe(50))") heroku config:set OTREE_AUTH_LEVEL=DEMO # deploy git push heroku main # initialize the database heroku run otree resetdb --noinput ``` The app will be at https://your-app-name.herokuapp.com. ## Structure - `joint_inference/__init__.py` — models, pages, Bayesian helpers, trial generation - `joint_inference/templates/joint_inference/` — HTML for each page - `settings.py` — oTree session config ## Trial structure 10 rounds total: 2 practice + 8 paid (4 with n_i=10, 4 with n_i=50). Per-trial elicitations: Q1 (prior estimate), Q2 (paired-lottery price list, 11 rows from 0% to 100% in 10% steps), Q3 (posterior estimate). One of {Q1, Q2, Q3} randomly selected for payment within each trial. Max bonus per trial: $1. ## Data export From the oTree admin, go to "Data" → CSV. Each row is a (player, round) pair with all elicitation responses, trial latents (true p, p_imp, k_i, k_a, k_b, a_is_partner), and resolved payoffs. The Bayesian benchmarks (q_A^*, posterior mean) can be computed offline from the latents using the helpers in `__init__.py`.