problems 75 / 75 columns reference · stan
methodology ↑↓jk nav · / search
Select a problem from the list →
posteriordb-GLM_Binomial_data / GLM_Binomial_model
answer record(alpha, beta1, beta2, logit_p[1], logit_p[2], logit_p[3], logit_p[4], logit_p[5], logit_p[6], logit_p[7], logit_p[8], logit_p[9], logit_p[10], logit_p[11], logit_p[12], logit_p[13], logit_p[14], logit_p[15], logit_p[16], logit_p[17], logit_p[18], logit_p[19], logit_p[20], logit_p[21], logit_p[22], logit_p[23], logit_p[24], logit_p[25], logit_p[26], logit_p[27], logit_p[28], logit_p[29], logit_p[30], logit_p[31], logit_p[32], logit_p[33], logit_p[34], logit_p[35], logit_p[36], logit_p[37], logit_p[38], logit_p[39], logit_p[40], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15], p[16], p[17], p[18], p[19], p[20], p[21], p[22], p[23], p[24], p[25], p[26], p[27], p[28], p[29], p[30], p[31], p[32], p[33], p[34], p[35], p[36], p[37], p[38], p[39], p[40]) stan pass 0.0056
00 statement source: posteriordb/GLM_Binomial_data-GLM_Binomial_model
given

Peregrine falcon broods in the French Jura were surveyed over 40 years (years 1..40). For each year t, the observed number of successful broods C_t and the total number of broods monitored N_t are recorded, together with a standardized year covariate year_t (a real-valued covariate centered and scaled so that year 1 corresponds to approximately -0.95 and each subsequent year increments by 0.05). The intercept alpha has a Normal(mean 0, sd 100) prior. The linear coefficient beta1 on year has a Normal(mean 0, sd 100) prior. The quadratic coefficient beta2 on year-squared has a Normal(mean 0, sd 100) prior.

model

The log-odds of brood success in year t is a quadratic function of the year covariate: logit_p_t = alpha + beta1 * year_t + beta2 * year_t^2. The observed count of successful broods C_t in year t follows a Binomial distribution with total N_t and success probability inv_logit(logit_p_t).

query

The marginal posterior distribution of each parameter given the data: the intercept alpha, the linear year coefficient beta1, the quadratic year coefficient beta2, the 40 log-odds values logit_p_1, ..., logit_p_40, and the 40 success probabilities p_1, ..., p_40 (where p_t = inv_logit(logit_p_t)).

answer spec record(alpha, beta1, beta2, logit_p[1], logit_p[2], logit_p[3], logit_p[4], logit_p[5], logit_p[6], logit_p[7], logit_p[8], logit_p[9], logit_p[10], logit_p[11], logit_p[12], logit_p[13], logit_p[14], logit_p[15], logit_p[16], logit_p[17], logit_p[18], logit_p[19], logit_p[20], logit_p[21], logit_p[22], logit_p[23], logit_p[24], logit_p[25], logit_p[26], logit_p[27], logit_p[28], logit_p[29], logit_p[30], logit_p[31], logit_p[32], logit_p[33], logit_p[34], logit_p[35], logit_p[36], logit_p[37], logit_p[38], logit_p[39], logit_p[40], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15], p[16], p[17], p[18], p[19], p[20], p[21], p[22], p[23], p[24], p[25], p[26], p[27], p[28], p[29], p[30], p[31], p[32], p[33], p[34], p[35], p[36], p[37], p[38], p[39], p[40])
{
  "kind": "record",
  "fields": {
    "alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "beta1": {
      "kind": "dist",
      "domain": "real"
    },
    "beta2": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "logit_p[40]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[40]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.006
stan
1data {
2 int<lower=0> nyears; // Number of Years
3 array[nyears] int<lower=0> C; // Counts
4 array[nyears] int<lower=0> N; // Binomial Totals
5 vector[nyears] year; // Year covariates
6}
7transformed data {
8 vector[nyears] year_squared;
9
10 year_squared = year .* year;
11}
12parameters {
13 real alpha;
14 real beta1;
15 real beta2;
16}
17transformed parameters {
18 vector[nyears] logit_p;
19
20 // Linear predictor
21 logit_p = alpha + beta1 * year + beta2 * year_squared;
22}
23model {
24 // Priors
25 alpha ~ normal(0, 100);
26 beta1 ~ normal(0, 100);
27 beta2 ~ normal(0, 100);
28
29 // Likelihood
30 // Distribution for random part
31 C ~ binomial_logit(N, logit_p);
32}
33generated quantities {
34 array[nyears] real<lower=0, upper=1> p;
35
36 for (i in 1 : nyears) {
37 p[i] = inv_logit(logit_p[i]);
38 }
39}
40
41//@ DATA { nyears: 40, year: [40 values], C: [40 values], N: [40 values] } // values supplied at runtime
42//@ PARAMS ["alpha","beta1","beta2","logit_p[1]","logit_p[2]","logit_p[3]","logit_p[4]","logit_p[5]","logit_p[6]","logit_p[7]","logit_p[8]","logit_p[9]","logit_p[10]","logit_p[11]","logit_p[12]","logit_p[13]","logit_p[14]","logit_p[15]","logit_p[16]","logit_p[17]","logit_p[18]","logit_p[19]","logit_p[20]","logit_p[21]","logit_p[22]","logit_p[23]","logit_p[24]","logit_p[25]","logit_p[26]","logit_p[27]","logit_p[28]","logit_p[29]","logit_p[30]","logit_p[31]","logit_p[32]","logit_p[33]","logit_p[34]","logit_p[35]","logit_p[36]","logit_p[37]","logit_p[38]","logit_p[39]","logit_p[40]","p[1]","p[2]","p[3]","p[4]","p[5]","p[6]","p[7]","p[8]","p[9]","p[10]","p[11]","p[12]","p[13]","p[14]","p[15]","p[16]","p[17]","p[18]","p[19]","p[20]","p[21]","p[22]","p[23]","p[24]","p[25]","p[26]","p[27]","p[28]","p[29]","p[30]","p[31]","p[32]","p[33]","p[34]","p[35]","p[36]","p[37]","p[38]","p[39]","p[40]"]
43//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
44
02answer overlay — reference vs stanrecord(alpha, beta1, beta2, logit_p[1], logit_p[2], logit_p[3], logit_p[4], logit_p[5], logit_p[6], logit_p[7], logit_p[8], logit_p[9], logit_p[10], logit_p[11], logit_p[12], logit_p[13], logit_p[14], logit_p[15], logit_p[16], logit_p[17], logit_p[18], logit_p[19], logit_p[20], logit_p[21], logit_p[22], logit_p[23], logit_p[24], logit_p[25], logit_p[26], logit_p[27], logit_p[28], logit_p[29], logit_p[30], logit_p[31], logit_p[32], logit_p[33], logit_p[34], logit_p[35], logit_p[36], logit_p[37], logit_p[38], logit_p[39], logit_p[40], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15], p[16], p[17], p[18], p[19], p[20], p[21], p[22], p[23], p[24], p[25], p[26], p[27], p[28], p[29], p[30], p[31], p[32], p[33], p[34], p[35], p[36], p[37], p[38], p[39], p[40])
parameterreference mean±sdstan mean±sd
alpha1.01 ± 0.062
beta1-0.176 ± 0.072
beta2-0.916 ± 0.148
logit_p[1]0.355 ± 0.120
logit_p[2]0.431 ± 0.108
logit_p[3]0.502 ± 0.097
logit_p[4]0.569 ± 0.088
logit_p[5]0.631 ± 0.079
logit_p[6]0.689 ± 0.072
logit_p[7]0.742 ± 0.066
logit_p[8]0.790 ± 0.062
logit_p[9]0.834 ± 0.059
logit_p[10]0.873 ± 0.057
logit_p[11]0.908 ± 0.056
logit_p[12]0.938 ± 0.056
logit_p[13]0.964 ± 0.057
logit_p[14]0.985 ± 0.058
logit_p[15]1.00 ± 0.059
logit_p[16]1.01 ± 0.060
logit_p[17]1.02 ± 0.061
logit_p[18]1.02 ± 0.062
logit_p[19]1.02 ± 0.062
logit_p[20]1.01 ± 0.062
logit_p[21]1.00 ± 0.062
logit_p[22]0.988 ± 0.061
logit_p[23]0.967 ± 0.060
logit_p[24]0.942 ± 0.059
logit_p[25]0.913 ± 0.058
logit_p[26]0.879 ± 0.057
logit_p[27]0.840 ± 0.055
logit_p[28]0.797 ± 0.054
logit_p[29]0.750 ± 0.054
logit_p[30]0.697 ± 0.055
logit_p[31]0.640 ± 0.056
logit_p[32]0.579 ± 0.059
logit_p[33]0.513 ± 0.063
logit_p[34]0.442 ± 0.069
logit_p[35]0.367 ± 0.076
logit_p[36]0.287 ± 0.085
logit_p[37]0.203 ± 0.094
logit_p[38]0.114 ± 0.105
logit_p[39]0.020 ± 0.117
logit_p[40]-0.078 ± 0.130
p[1]0.587 ± 0.029
p[2]0.606 ± 0.026
p[3]0.623 ± 0.023
p[4]0.638 ± 0.020
p[5]0.653 ± 0.018
p[6]0.665 ± 0.016
p[7]0.677 ± 0.014
p[8]0.688 ± 0.013
p[9]0.697 ± 0.012
p[10]0.705 ± 0.012
p[11]0.712 ± 0.012
p[12]0.719 ± 0.011
p[13]0.724 ± 0.011
p[14]0.728 ± 0.011
p[15]0.731 ± 0.012
p[16]0.733 ± 0.012
p[17]0.735 ± 0.012
p[18]0.735 ± 0.012
p[19]0.735 ± 0.012
p[20]0.734 ± 0.012
p[21]0.732 ± 0.012
p[22]0.728 ± 0.012
p[23]0.724 ± 0.012
p[24]0.719 ± 0.012
p[25]0.713 ± 0.012
p[26]0.707 ± 0.012
p[27]0.698 ± 0.012
p[28]0.689 ± 0.012
p[29]0.679 ± 0.012
p[30]0.667 ± 0.012
p[31]0.655 ± 0.013
p[32]0.641 ± 0.014
p[33]0.625 ± 0.015
p[34]0.609 ± 0.016
p[35]0.591 ± 0.018
p[36]0.571 ± 0.021
p[37]0.550 ± 0.023
p[38]0.528 ± 0.026
p[39]0.505 ± 0.029
p[40]0.481 ± 0.032
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0056 ≤ tol 0.0189 · floors 0.0095/0.0089
posteriordb-GLM_Poisson_Data / GLM_Poisson_model
answer record(alpha, beta1, beta2, beta3, log_lambda[1], log_lambda[2], log_lambda[3], log_lambda[4], log_lambda[5], log_lambda[6], log_lambda[7], log_lambda[8], log_lambda[9], log_lambda[10], log_lambda[11], log_lambda[12], log_lambda[13], log_lambda[14], log_lambda[15], log_lambda[16], log_lambda[17], log_lambda[18], log_lambda[19], log_lambda[20], log_lambda[21], log_lambda[22], log_lambda[23], log_lambda[24], log_lambda[25], log_lambda[26], log_lambda[27], log_lambda[28], log_lambda[29], log_lambda[30], log_lambda[31], log_lambda[32], log_lambda[33], log_lambda[34], log_lambda[35], log_lambda[36], log_lambda[37], log_lambda[38], log_lambda[39], log_lambda[40], lambda[1], lambda[2], lambda[3], lambda[4], lambda[5], lambda[6], lambda[7], lambda[8], lambda[9], lambda[10], lambda[11], lambda[12], lambda[13], lambda[14], lambda[15], lambda[16], lambda[17], lambda[18], lambda[19], lambda[20], lambda[21], lambda[22], lambda[23], lambda[24], lambda[25], lambda[26], lambda[27], lambda[28], lambda[29], lambda[30], lambda[31], lambda[32], lambda[33], lambda[34], lambda[35], lambda[36], lambda[37], lambda[38], lambda[39], lambda[40]) stan pass 0.3618
00 statement source: posteriordb/GLM_Poisson_Data-GLM_Poisson_model
given

Peregrine falcon breeding-pair counts C_t and standardized year values year_t are observed for n = 40 consecutive years (t = 1..40); the counts C_t and the year values year_t are provided as data arrays. The intercept alpha has a Uniform(-20, 20) prior. The linear-year coefficient beta1 has a Uniform(-10, 10) prior. The quadratic-year coefficient beta2 has a Uniform(-10, 10) prior. The cubic-year coefficient beta3 has a Uniform(-10, 10) prior.

model

The log expected count in year t is a cubic polynomial in year_t: log_lambda_t = alpha + beta1 * year_t + beta2 * year_t^2 + beta3 * year_t^3. The observed count C_t is drawn from a Poisson distribution with mean lambda_t = exp(log_lambda_t), independently across years.

query

The marginal posterior distribution of each parameter and derived quantity given the data: the intercept alpha, the three polynomial coefficients beta1, beta2, beta3, the 40 log-scale expected counts log_lambda_1, ..., log_lambda_40, and the 40 expected counts on the original scale lambda_1, ..., lambda_40.

answer spec record(alpha, beta1, beta2, beta3, log_lambda[1], log_lambda[2], log_lambda[3], log_lambda[4], log_lambda[5], log_lambda[6], log_lambda[7], log_lambda[8], log_lambda[9], log_lambda[10], log_lambda[11], log_lambda[12], log_lambda[13], log_lambda[14], log_lambda[15], log_lambda[16], log_lambda[17], log_lambda[18], log_lambda[19], log_lambda[20], log_lambda[21], log_lambda[22], log_lambda[23], log_lambda[24], log_lambda[25], log_lambda[26], log_lambda[27], log_lambda[28], log_lambda[29], log_lambda[30], log_lambda[31], log_lambda[32], log_lambda[33], log_lambda[34], log_lambda[35], log_lambda[36], log_lambda[37], log_lambda[38], log_lambda[39], log_lambda[40], lambda[1], lambda[2], lambda[3], lambda[4], lambda[5], lambda[6], lambda[7], lambda[8], lambda[9], lambda[10], lambda[11], lambda[12], lambda[13], lambda[14], lambda[15], lambda[16], lambda[17], lambda[18], lambda[19], lambda[20], lambda[21], lambda[22], lambda[23], lambda[24], lambda[25], lambda[26], lambda[27], lambda[28], lambda[29], lambda[30], lambda[31], lambda[32], lambda[33], lambda[34], lambda[35], lambda[36], lambda[37], lambda[38], lambda[39], lambda[40])
{
  "kind": "record",
  "fields": {
    "alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "beta1": {
      "kind": "dist",
      "domain": "real"
    },
    "beta2": {
      "kind": "dist",
      "domain": "real"
    },
    "beta3": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "log_lambda[40]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[40]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.362
stan
1data {
2 int<lower=0> n; // Number of years
3 array[n] int<lower=0> C; // Count
4 vector[n] year; // Year
5}
6transformed data {
7 vector[n] year_squared;
8 vector[n] year_cubed;
9
10 year_squared = square(year);
11 year_cubed = year_squared .* year;
12}
13parameters {
14 real<lower=-20, upper=20> alpha;
15 real<lower=-10, upper=10> beta1;
16 real<lower=-10, upper=10> beta2;
17 real<lower=-10, upper=10> beta3;
18}
19transformed parameters {
20 vector[n] log_lambda;
21
22 log_lambda = alpha + beta1 * year + +beta2 * year_squared
23 + +beta3 * year_cubed;
24}
25model {
26 // Implicit uniform priors are used.
27
28 // Likelihood
29 C ~ poisson_log(log_lambda);
30}
31generated quantities {
32 vector[n] lambda;
33
34 lambda = exp(log_lambda);
35}
36
37//@ DATA { year: [40 values], C: [40 values], n: 40 } // values supplied at runtime
38//@ PARAMS ["alpha","beta1","beta2","beta3","log_lambda[1]","log_lambda[2]","log_lambda[3]","log_lambda[4]","log_lambda[5]","log_lambda[6]","log_lambda[7]","log_lambda[8]","log_lambda[9]","log_lambda[10]","log_lambda[11]","log_lambda[12]","log_lambda[13]","log_lambda[14]","log_lambda[15]","log_lambda[16]","log_lambda[17]","log_lambda[18]","log_lambda[19]","log_lambda[20]","log_lambda[21]","log_lambda[22]","log_lambda[23]","log_lambda[24]","log_lambda[25]","log_lambda[26]","log_lambda[27]","log_lambda[28]","log_lambda[29]","log_lambda[30]","log_lambda[31]","log_lambda[32]","log_lambda[33]","log_lambda[34]","log_lambda[35]","log_lambda[36]","log_lambda[37]","log_lambda[38]","log_lambda[39]","log_lambda[40]","lambda[1]","lambda[2]","lambda[3]","lambda[4]","lambda[5]","lambda[6]","lambda[7]","lambda[8]","lambda[9]","lambda[10]","lambda[11]","lambda[12]","lambda[13]","lambda[14]","lambda[15]","lambda[16]","lambda[17]","lambda[18]","lambda[19]","lambda[20]","lambda[21]","lambda[22]","lambda[23]","lambda[24]","lambda[25]","lambda[26]","lambda[27]","lambda[28]","lambda[29]","lambda[30]","lambda[31]","lambda[32]","lambda[33]","lambda[34]","lambda[35]","lambda[36]","lambda[37]","lambda[38]","lambda[39]","lambda[40]"]
39//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
40
02answer overlay — reference vs stanrecord(alpha, beta1, beta2, beta3, log_lambda[1], log_lambda[2], log_lambda[3], log_lambda[4], log_lambda[5], log_lambda[6], log_lambda[7], log_lambda[8], log_lambda[9], log_lambda[10], log_lambda[11], log_lambda[12], log_lambda[13], log_lambda[14], log_lambda[15], log_lambda[16], log_lambda[17], log_lambda[18], log_lambda[19], log_lambda[20], log_lambda[21], log_lambda[22], log_lambda[23], log_lambda[24], log_lambda[25], log_lambda[26], log_lambda[27], log_lambda[28], log_lambda[29], log_lambda[30], log_lambda[31], log_lambda[32], log_lambda[33], log_lambda[34], log_lambda[35], log_lambda[36], log_lambda[37], log_lambda[38], log_lambda[39], log_lambda[40], lambda[1], lambda[2], lambda[3], lambda[4], lambda[5], lambda[6], lambda[7], lambda[8], lambda[9], lambda[10], lambda[11], lambda[12], lambda[13], lambda[14], lambda[15], lambda[16], lambda[17], lambda[18], lambda[19], lambda[20], lambda[21], lambda[22], lambda[23], lambda[24], lambda[25], lambda[26], lambda[27], lambda[28], lambda[29], lambda[30], lambda[31], lambda[32], lambda[33], lambda[34], lambda[35], lambda[36], lambda[37], lambda[38], lambda[39], lambda[40])
parameterreference mean±sdstan mean±sd
alpha4.28 ± 0.029
beta11.25 ± 0.045
beta20.069 ± 0.024
beta3-0.229 ± 0.024
log_lambda[1]3.46 ± 0.102
log_lambda[2]3.39 ± 0.087
log_lambda[3]3.34 ± 0.074
log_lambda[4]3.31 ± 0.064
log_lambda[5]3.29 ± 0.055
log_lambda[6]3.28 ± 0.049
log_lambda[7]3.29 ± 0.045
log_lambda[8]3.31 ± 0.043
log_lambda[9]3.34 ± 0.042
log_lambda[10]3.39 ± 0.041
log_lambda[11]3.44 ± 0.041
log_lambda[12]3.50 ± 0.041
log_lambda[13]3.57 ± 0.040
log_lambda[14]3.65 ± 0.040
log_lambda[15]3.74 ± 0.039
log_lambda[16]3.83 ± 0.037
log_lambda[17]3.92 ± 0.036
log_lambda[18]4.02 ± 0.034
log_lambda[19]4.13 ± 0.032
log_lambda[20]4.23 ± 0.030
log_lambda[21]4.34 ± 0.028
log_lambda[22]4.44 ± 0.026
log_lambda[23]4.55 ± 0.024
log_lambda[24]4.66 ± 0.023
log_lambda[25]4.76 ± 0.023
log_lambda[26]4.86 ± 0.022
log_lambda[27]4.96 ± 0.022
log_lambda[28]5.05 ± 0.022
log_lambda[29]5.14 ± 0.023
log_lambda[30]5.22 ± 0.023
log_lambda[31]5.29 ± 0.023
log_lambda[32]5.36 ± 0.022
log_lambda[33]5.41 ± 0.022
log_lambda[34]5.46 ± 0.021
log_lambda[35]5.50 ± 0.020
log_lambda[36]5.52 ± 0.020
log_lambda[37]5.54 ± 0.022
log_lambda[38]5.53 ± 0.026
log_lambda[39]5.52 ± 0.032
log_lambda[40]5.49 ± 0.040
lambda[1]32.03 ± 3.27
lambda[2]29.88 ± 2.60
lambda[3]28.36 ± 2.10
lambda[4]27.36 ± 1.74
lambda[5]26.82 ± 1.49
lambda[6]26.66 ± 1.32
lambda[7]26.87 ± 1.22
lambda[8]27.43 ± 1.18
lambda[9]28.33 ± 1.19
lambda[10]29.59 ± 1.22
lambda[11]31.21 ± 1.28
lambda[12]33.23 ± 1.36
lambda[13]35.67 ± 1.44
lambda[14]38.58 ± 1.53
lambda[15]42.00 ± 1.63
lambda[16]45.98 ± 1.72
lambda[17]50.60 ± 1.81
lambda[18]55.89 ± 1.89
lambda[19]61.94 ± 1.97
lambda[20]68.80 ± 2.05
lambda[21]76.53 ± 2.13
lambda[22]85.18 ± 2.22
lambda[23]94.79 ± 2.32
lambda[24]105.4 ± 2.46
lambda[25]116.9 ± 2.64
lambda[26]129.3 ± 2.88
lambda[27]142.4 ± 3.16
lambda[28]156.2 ± 3.49
lambda[29]170.5 ± 3.84
lambda[30]184.8 ± 4.18
lambda[31]198.9 ± 4.47
lambda[32]212.4 ± 4.70
lambda[33]224.8 ± 4.84
lambda[34]235.6 ± 4.90
lambda[35]244.3 ± 4.95
lambda[36]250.4 ± 5.12
lambda[37]253.6 ± 5.59
lambda[38]253.4 ± 6.50
lambda[39]249.7 ± 7.85
lambda[40]242.5 ± 9.56
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.3618 ≤ tol 1.4472 · floors 0.3962/0.3972
posteriordb-M0_data / M0_model
answer record(omega, p, omega_nd, N) stan pass 0.1598
00 statement source: posteriordb/M0_data-M0_model
given

A capture-recapture study was conducted over T = 3 sampling occasions. Data augmentation was applied: the observed capture histories are embedded in an augmented dataset of M = 237 individuals, where each individual i has a binary capture history y[i,1..T] (1 = captured, 0 = not captured on that occasion). Individuals with all zeros (never captured) are included in the augmented portion. The inclusion probability omega and the detection probability p both have implicit Uniform(0, 1) priors.

model

Each of the M candidate individuals in the augmented dataset is either a real member of the population (with probability omega) or a phantom (with probability 1 - omega). If an individual is real, it is detected independently on each of the T occasions with probability p. If it is a phantom, it is never detected. The discrete membership indicator for each individual is marginalized out: an individual with at least one capture is certainly real; an individual never captured is real (but missed on all T occasions) with probability omega * (1-p)^T, or is a phantom with probability 1 - omega.

query

The marginal posterior distribution of each parameter given the data: the inclusion probability omega, the detection probability p, the probability of being present given never detected omega_nd (= omega * (1-p)^T / (omega * (1-p)^T + (1-omega))), and the estimated total population size N (= number observed + Binomial(M - number observed, omega_nd) draw).

answer spec record(omega, p, omega_nd, N)
{
  "kind": "record",
  "fields": {
    "omega": {
      "kind": "dist",
      "domain": "real"
    },
    "p": {
      "kind": "dist",
      "domain": "real"
    },
    "omega_nd": {
      "kind": "dist",
      "domain": "real"
    },
    "N": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.160
stan
1data {
2 int<lower=0> M; // Size of augumented data set
3 int<lower=0> T; // Number of sampling occasions
4 array[M, T] int<lower=0, upper=1> y; // Capture-history matrix
5}
6transformed data {
7 array[M] int<lower=0> s; // Totals in each row
8 int<lower=0> C; // Size of observed data set
9
10 C = 0;
11 for (i in 1 : M) {
12 s[i] = sum(y[i]);
13 if (s[i] > 0) {
14 C = C + 1;
15 }
16 }
17}
18parameters {
19 real<lower=0, upper=1> omega; // Inclusion probability
20 real<lower=0, upper=1> p; // Detection probability
21}
22model {
23 // Priors are imlicitly defined;
24 // omega ~ uniform(0, 1);
25 // p ~ uniform(0, 1);
26
27 // Likelihood
28 for (i in 1 : M) {
29 if (s[i] > 0) {
30 // z[i] == 1
31 target += bernoulli_lpmf(1 | omega) + binomial_lpmf(s[i] | T, p);
32 } else // s[i] == 0
33 {
34 target += log_sum_exp(bernoulli_lpmf(1 | omega)
35 // z[i] == 1
36 + binomial_lpmf(0 | T, p),
37 bernoulli_lpmf(0 | omega));
38 }
39 } // z[i] == 0
40}
41generated quantities {
42 // prob present given never detected
43 real omega_nd = (omega * (1 - p) ^ T) / (omega * (1 - p) ^ T + (1 - omega));
44 int<lower=C, upper=M> N = C + binomial_rng(M - C, omega_nd);
45}
46
47//@ DATA { y: [237×3 matrix], M: 237, T: 3 } // values supplied at runtime
48//@ PARAMS ["omega","p","omega_nd","N"]
49//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
50
02answer overlay — reference vs stanrecord(omega, p, omega_nd, N)
omega
reference stan24 bins · 0.30 … 0.54
00.070.070.130.130.400.500.41 · 0.134x = 0.30 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.31 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.32 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.33 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.34 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.35 A = 0.0280 B = 0.0000 Δ = 0.0280x = 0.36 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.37 A = 0.0380 B = 0.0000 Δ = 0.0380x = 0.38 A = 0.0500 B = 0.0000 Δ = 0.0500x = 0.39 A = 0.1060 B = 0.0000 Δ = 0.1060x = 0.40 A = 0.0860 B = 0.0000 Δ = 0.0860x = 0.41 A = 0.1340 B = 0.0000 Δ = 0.1340x = 0.42 A = 0.1220 B = 0.0000 Δ = 0.1220x = 0.43 A = 0.0880 B = 0.0000 Δ = 0.0880x = 0.44 A = 0.0800 B = 0.0000 Δ = 0.0800x = 0.46 A = 0.0580 B = 0.0000 Δ = 0.0580x = 0.47 A = 0.0380 B = 0.0000 Δ = 0.0380x = 0.47 A = 0.0420 B = 0.0000 Δ = 0.0420x = 0.48 A = 0.0200 B = 0.0000 Δ = 0.0200x = 0.49 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.51 A = 0.0160 B = 0.0000 Δ = 0.0160x = 0.52 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.53 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.54 A = 0.0020 B = 0.0000 Δ = 0.0020
p
reference stan24 bins · 0.39 … 0.60
00.050.050.110.110.400.500.600.51 · 0.106x = 0.39 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.40 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.41 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.41 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.42 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.43 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.44 A = 0.0340 B = 0.0000 Δ = 0.0340x = 0.45 A = 0.0580 B = 0.0000 Δ = 0.0580x = 0.46 A = 0.0620 B = 0.0000 Δ = 0.0620x = 0.47 A = 0.0680 B = 0.0000 Δ = 0.0680x = 0.48 A = 0.0800 B = 0.0000 Δ = 0.0800x = 0.49 A = 0.0760 B = 0.0000 Δ = 0.0760x = 0.50 A = 0.1020 B = 0.0000 Δ = 0.1020x = 0.51 A = 0.1060 B = 0.0000 Δ = 0.1060x = 0.52 A = 0.1040 B = 0.0000 Δ = 0.1040x = 0.53 A = 0.0840 B = 0.0000 Δ = 0.0840x = 0.54 A = 0.0560 B = 0.0000 Δ = 0.0560x = 0.55 A = 0.0480 B = 0.0000 Δ = 0.0480x = 0.55 A = 0.0280 B = 0.0000 Δ = 0.0280x = 0.56 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.57 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.58 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.59 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.60 A = 0.0020 B = 0.0000 Δ = 0.0020
omega_nd
reference stan24 bins · 0.03 … 0.19
00.070.070.140.140.100.07 · 0.142x = 0.03 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.04 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.05 A = 0.0360 B = 0.0000 Δ = 0.0360x = 0.05 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.06 A = 0.0780 B = 0.0000 Δ = 0.0780x = 0.07 A = 0.1100 B = 0.0000 Δ = 0.1100x = 0.07 A = 0.1420 B = 0.0000 Δ = 0.1420x = 0.08 A = 0.1060 B = 0.0000 Δ = 0.1060x = 0.09 A = 0.1080 B = 0.0000 Δ = 0.1080x = 0.09 A = 0.0720 B = 0.0000 Δ = 0.0720x = 0.10 A = 0.0860 B = 0.0000 Δ = 0.0860x = 0.11 A = 0.0680 B = 0.0000 Δ = 0.0680x = 0.11 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.12 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.13 A = 0.0200 B = 0.0000 Δ = 0.0200x = 0.14 A = 0.0220 B = 0.0000 Δ = 0.0220x = 0.14 A = 0.0140 B = 0.0000 Δ = 0.0140x = 0.15 A = 0.0160 B = 0.0000 Δ = 0.0160x = 0.16 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.16 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.17 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.18 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.18 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.19 A = 0.0020 B = 0.0000 Δ = 0.0020
N
reference stan30 bins · 89 … 127
00.050.050.100.1010012098 · 0.100x = 89 A = 0.0040 B = 0.0000 Δ = 0.0040x = 90 A = 0.0060 B = 0.0000 Δ = 0.0060x = 91 A = 0.0220 B = 0.0000 Δ = 0.0220x = 92 A = 0.0220 B = 0.0000 Δ = 0.0220x = 93 A = 0.0380 B = 0.0000 Δ = 0.0380x = 94 A = 0.0480 B = 0.0000 Δ = 0.0480x = 95 A = 0.0540 B = 0.0000 Δ = 0.0540x = 96 A = 0.0780 B = 0.0000 Δ = 0.0780x = 97 A = 0.0660 B = 0.0000 Δ = 0.0660x = 98 A = 0.1000 B = 0.0000 Δ = 0.1000x = 99 A = 0.0860 B = 0.0000 Δ = 0.0860x = 100 A = 0.0840 B = 0.0000 Δ = 0.0840x = 101 A = 0.0620 B = 0.0000 Δ = 0.0620x = 102 A = 0.0580 B = 0.0000 Δ = 0.0580x = 103 A = 0.0560 B = 0.0000 Δ = 0.0560x = 104 A = 0.0360 B = 0.0000 Δ = 0.0360x = 105 A = 0.0360 B = 0.0000 Δ = 0.0360x = 106 A = 0.0240 B = 0.0000 Δ = 0.0240x = 107 A = 0.0280 B = 0.0000 Δ = 0.0280x = 108 A = 0.0220 B = 0.0000 Δ = 0.0220x = 109 A = 0.0120 B = 0.0000 Δ = 0.0120x = 110 A = 0.0180 B = 0.0000 Δ = 0.0180x = 111 A = 0.0120 B = 0.0000 Δ = 0.0120x = 112 A = 0.0100 B = 0.0000 Δ = 0.0100x = 113 A = 0.0060 B = 0.0000 Δ = 0.0060x = 114 A = 0.0020 B = 0.0000 Δ = 0.0020x = 115 A = 0.0020 B = 0.0000 Δ = 0.0020x = 117 A = 0.0040 B = 0.0000 Δ = 0.0040x = 126 A = 0.0020 B = 0.0000 Δ = 0.0020x = 127 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.1598 ≤ tol 0.8445 · floors 0.4223/0.2935
posteriordb-Mt_data / Mt_model
answer record(omega, p[1], p[2], p[3], pr, omega_nd, N) stan pass 0.1708
00 statement source: posteriordb/Mt_data-Mt_model
given

A capture-recapture study was conducted over T = 3 sampling occasions, with detection probabilities that may differ by occasion. Data augmentation was applied: the observed capture histories are embedded in an augmented dataset of M = 237 individuals, where each individual i has a binary capture history y[i,1..T]. The inclusion probability omega has an implicit Uniform(0, 1) prior. Each occasion-specific detection probability p_t (t = 1, 2, 3) has an implicit Uniform(0, 1) prior, independently.

model

Each of the M candidate individuals is either a real member of the population (with probability omega) or a phantom (with probability 1 - omega). If an individual is real, it is detected on occasion t independently with probability p_t, which may vary by occasion. If it is a phantom, it is never detected. The membership indicator is marginalized out as in the constant-p model, but now using the occasion-specific p_t values.

query

The marginal posterior distribution of each parameter given the data: the inclusion probability omega, the three occasion-specific detection probabilities p_1, p_2, p_3, the probability of never being captured given presence pr (= product of (1 - p_t) over all T occasions), the probability of being present given never detected omega_nd (= omega * pr / (omega * pr + (1 - omega))), and the estimated total population size N.

answer spec record(omega, p[1], p[2], p[3], pr, omega_nd, N)
{
  "kind": "record",
  "fields": {
    "omega": {
      "kind": "dist",
      "domain": "real"
    },
    "p[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "pr": {
      "kind": "dist",
      "domain": "real"
    },
    "omega_nd": {
      "kind": "dist",
      "domain": "real"
    },
    "N": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.171
stan
1data {
2 int<lower=0> M; // Size of augumented data set
3 int<lower=0> T; // Number of sampling occasions
4 array[M, T] int<lower=0, upper=1> y; // Capture-history matrix
5}
6transformed data {
7 array[M] int<lower=0> s; // Totals in each row
8 int<lower=0> C; // Size of observed data set
9
10 C = 0;
11 for (i in 1 : M) {
12 s[i] = sum(y[i]);
13 if (s[i] > 0) {
14 C = C + 1;
15 }
16 }
17}
18parameters {
19 real<lower=0, upper=1> omega; // Inclusion probability
20 vector<lower=0, upper=1>[T] p; // Detection probability
21}
22model {
23 // Priors are implicitly defined.
24 // omega ~ uniform(0, 1);
25 // p ~ uniform(0, 1);
26
27 // Likelihood
28 for (i in 1 : M) {
29 if (s[i] > 0) {
30 // z[i] == 1
31 target += bernoulli_lpmf(1 | omega) + bernoulli_lpmf(y[i] | p);
32 } else // s[i] == 0
33 {
34 target += log_sum_exp(bernoulli_lpmf(1 | omega)
35 // z[i] == 1
36 + bernoulli_lpmf(y[i] | p),
37 bernoulli_lpmf(0 | omega));
38 }
39 } // z[i] == 0
40}
41generated quantities {
42 // prob never captured given present
43 real pr = prod(1 - p);
44 // prob present given never captured; same for all animals
45 real omega_nd = (omega * pr) / (omega * pr + (1 - omega));
46 int<lower=C> N = C + binomial_rng(M - C, omega_nd);
47}
48
49//@ DATA { y: [237×3 matrix], M: 237, T: 3 } // values supplied at runtime
50//@ PARAMS ["omega","p[1]","p[2]","p[3]","pr","omega_nd","N"]
51//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
52
02answer overlay — reference vs stanrecord(omega, p[1], p[2], p[3], pr, omega_nd, N)
omega
reference stan24 bins · 0.31 … 0.53
00.050.050.100.100.400.500.43 · 0.100x = 0.31 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.32 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.33 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.34 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.35 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.36 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.37 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.38 A = 0.0440 B = 0.0000 Δ = 0.0440x = 0.39 A = 0.0620 B = 0.0000 Δ = 0.0620x = 0.40 A = 0.0880 B = 0.0000 Δ = 0.0880x = 0.41 A = 0.0880 B = 0.0000 Δ = 0.0880x = 0.42 A = 0.0980 B = 0.0000 Δ = 0.0980x = 0.43 A = 0.1000 B = 0.0000 Δ = 0.1000x = 0.44 A = 0.0900 B = 0.0000 Δ = 0.0900x = 0.45 A = 0.0700 B = 0.0000 Δ = 0.0700x = 0.46 A = 0.0760 B = 0.0000 Δ = 0.0760x = 0.47 A = 0.0560 B = 0.0000 Δ = 0.0560x = 0.47 A = 0.0480 B = 0.0000 Δ = 0.0480x = 0.48 A = 0.0380 B = 0.0000 Δ = 0.0380x = 0.49 A = 0.0220 B = 0.0000 Δ = 0.0220x = 0.50 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.51 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.52 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.53 A = 0.0020 B = 0.0000 Δ = 0.0020
p[1]
reference stan24 bins · 0.06 … 0.24
00.0490.0490.0980.0980.100.200.15 · 0.098x = 0.06 A = 0.0140 B = 0.0000 Δ = 0.0140x = 0.07 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.08 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.08 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.09 A = 0.0360 B = 0.0000 Δ = 0.0360x = 0.10 A = 0.0900 B = 0.0000 Δ = 0.0900x = 0.11 A = 0.0740 B = 0.0000 Δ = 0.0740x = 0.12 A = 0.0640 B = 0.0000 Δ = 0.0640x = 0.12 A = 0.0700 B = 0.0000 Δ = 0.0700x = 0.13 A = 0.0700 B = 0.0000 Δ = 0.0700x = 0.14 A = 0.0920 B = 0.0000 Δ = 0.0920x = 0.15 A = 0.0980 B = 0.0000 Δ = 0.0980x = 0.16 A = 0.0640 B = 0.0000 Δ = 0.0640x = 0.16 A = 0.0820 B = 0.0000 Δ = 0.0820x = 0.17 A = 0.0520 B = 0.0000 Δ = 0.0520x = 0.18 A = 0.0200 B = 0.0000 Δ = 0.0200x = 0.19 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.19 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.20 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.21 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.22 A = 0.0160 B = 0.0000 Δ = 0.0160x = 0.23 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.23 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.24 A = 0.0020 B = 0.0000 Δ = 0.0020
p[2]
reference stan24 bins · 0.42 … 0.74
00.060.060.110.110.600.59 · 0.110x = 0.42 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.44 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.45 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.47 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.48 A = 0.0180 B = 0.0000 Δ = 0.0180x = 0.49 A = 0.0280 B = 0.0000 Δ = 0.0280x = 0.51 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.52 A = 0.0640 B = 0.0000 Δ = 0.0640x = 0.53 A = 0.0460 B = 0.0000 Δ = 0.0460x = 0.55 A = 0.0680 B = 0.0000 Δ = 0.0680x = 0.56 A = 0.0840 B = 0.0000 Δ = 0.0840x = 0.57 A = 0.0700 B = 0.0000 Δ = 0.0700x = 0.59 A = 0.1100 B = 0.0000 Δ = 0.1100x = 0.60 A = 0.0880 B = 0.0000 Δ = 0.0880x = 0.61 A = 0.0900 B = 0.0000 Δ = 0.0900x = 0.63 A = 0.0800 B = 0.0000 Δ = 0.0800x = 0.64 A = 0.0760 B = 0.0000 Δ = 0.0760x = 0.66 A = 0.0440 B = 0.0000 Δ = 0.0440x = 0.67 A = 0.0380 B = 0.0000 Δ = 0.0380x = 0.68 A = 0.0200 B = 0.0000 Δ = 0.0200x = 0.70 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.71 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.72 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.74 A = 0.0080 B = 0.0000 Δ = 0.0080
p[3]
reference stan24 bins · 0.45 … 0.78
00.060.060.120.120.600.64 · 0.120x = 0.45 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.47 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.48 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.49 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.51 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.52 A = 0.0180 B = 0.0000 Δ = 0.0180x = 0.54 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.55 A = 0.0340 B = 0.0000 Δ = 0.0340x = 0.57 A = 0.0440 B = 0.0000 Δ = 0.0440x = 0.58 A = 0.0740 B = 0.0000 Δ = 0.0740x = 0.59 A = 0.0540 B = 0.0000 Δ = 0.0540x = 0.61 A = 0.0980 B = 0.0000 Δ = 0.0980x = 0.62 A = 0.0980 B = 0.0000 Δ = 0.0980x = 0.64 A = 0.1200 B = 0.0000 Δ = 0.1200x = 0.65 A = 0.0940 B = 0.0000 Δ = 0.0940x = 0.67 A = 0.0980 B = 0.0000 Δ = 0.0980x = 0.68 A = 0.0440 B = 0.0000 Δ = 0.0440x = 0.69 A = 0.0620 B = 0.0000 Δ = 0.0620x = 0.71 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.72 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.74 A = 0.0280 B = 0.0000 Δ = 0.0280x = 0.75 A = 0.0140 B = 0.0000 Δ = 0.0140x = 0.77 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.78 A = 0.0100 B = 0.0000 Δ = 0.0100
pr
reference stan24 bins · 0.07 … 0.25
00.050.050.110.110.100.200.11 · 0.108x = 0.07 A = 0.0220 B = 0.0000 Δ = 0.0220x = 0.07 A = 0.0200 B = 0.0000 Δ = 0.0200x = 0.08 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.09 A = 0.0540 B = 0.0000 Δ = 0.0540x = 0.10 A = 0.0740 B = 0.0000 Δ = 0.0740x = 0.11 A = 0.0860 B = 0.0000 Δ = 0.0860x = 0.11 A = 0.1080 B = 0.0000 Δ = 0.1080x = 0.12 A = 0.0840 B = 0.0000 Δ = 0.0840x = 0.13 A = 0.1040 B = 0.0000 Δ = 0.1040x = 0.14 A = 0.0780 B = 0.0000 Δ = 0.0780x = 0.15 A = 0.0900 B = 0.0000 Δ = 0.0900x = 0.15 A = 0.0540 B = 0.0000 Δ = 0.0540x = 0.16 A = 0.0500 B = 0.0000 Δ = 0.0500x = 0.17 A = 0.0480 B = 0.0000 Δ = 0.0480x = 0.18 A = 0.0340 B = 0.0000 Δ = 0.0340x = 0.19 A = 0.0180 B = 0.0000 Δ = 0.0180x = 0.19 A = 0.0180 B = 0.0000 Δ = 0.0180x = 0.20 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.21 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.22 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.23 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.23 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.24 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.25 A = 0.0040 B = 0.0000 Δ = 0.0040
omega_nd
reference stan24 bins · 0.04 … 0.21
00.060.060.120.120.100.200.08 · 0.116x = 0.04 A = 0.0280 B = 0.0000 Δ = 0.0280x = 0.05 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.06 A = 0.0780 B = 0.0000 Δ = 0.0780x = 0.06 A = 0.0560 B = 0.0000 Δ = 0.0560x = 0.07 A = 0.1060 B = 0.0000 Δ = 0.1060x = 0.08 A = 0.1160 B = 0.0000 Δ = 0.1160x = 0.08 A = 0.0960 B = 0.0000 Δ = 0.0960x = 0.09 A = 0.1100 B = 0.0000 Δ = 0.1100x = 0.10 A = 0.0880 B = 0.0000 Δ = 0.0880x = 0.11 A = 0.0840 B = 0.0000 Δ = 0.0840x = 0.11 A = 0.0580 B = 0.0000 Δ = 0.0580x = 0.12 A = 0.0280 B = 0.0000 Δ = 0.0280x = 0.13 A = 0.0300 B = 0.0000 Δ = 0.0300x = 0.14 A = 0.0280 B = 0.0000 Δ = 0.0280x = 0.14 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.15 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.16 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.17 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.17 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.18 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.19 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.20 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.20 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.21 A = 0.0020 B = 0.0000 Δ = 0.0020
N
reference stan30 bins · 89 … 121
00.0450.0450.0900.09010012096 · 0.090x = 89 A = 0.0080 B = 0.0000 Δ = 0.0080x = 90 A = 0.0060 B = 0.0000 Δ = 0.0060x = 91 A = 0.0140 B = 0.0000 Δ = 0.0140x = 92 A = 0.0280 B = 0.0000 Δ = 0.0280x = 93 A = 0.0380 B = 0.0000 Δ = 0.0380x = 94 A = 0.0360 B = 0.0000 Δ = 0.0360x = 95 A = 0.0580 B = 0.0000 Δ = 0.0580x = 96 A = 0.0900 B = 0.0000 Δ = 0.0900x = 97 A = 0.0740 B = 0.0000 Δ = 0.0740x = 98 A = 0.0720 B = 0.0000 Δ = 0.0720x = 99 A = 0.0760 B = 0.0000 Δ = 0.0760x = 100 A = 0.0720 B = 0.0000 Δ = 0.0720x = 101 A = 0.0480 B = 0.0000 Δ = 0.0480x = 102 A = 0.0560 B = 0.0000 Δ = 0.0560x = 103 A = 0.0480 B = 0.0000 Δ = 0.0480x = 104 A = 0.0740 B = 0.0000 Δ = 0.0740x = 105 A = 0.0500 B = 0.0000 Δ = 0.0500x = 106 A = 0.0440 B = 0.0000 Δ = 0.0440x = 107 A = 0.0200 B = 0.0000 Δ = 0.0200x = 108 A = 0.0160 B = 0.0000 Δ = 0.0160x = 109 A = 0.0180 B = 0.0000 Δ = 0.0180x = 110 A = 0.0140 B = 0.0000 Δ = 0.0140x = 111 A = 0.0080 B = 0.0000 Δ = 0.0080x = 112 A = 0.0080 B = 0.0000 Δ = 0.0080x = 114 A = 0.0060 B = 0.0000 Δ = 0.0060x = 115 A = 0.0060 B = 0.0000 Δ = 0.0060x = 116 A = 0.0040 B = 0.0000 Δ = 0.0040x = 117 A = 0.0040 B = 0.0000 Δ = 0.0040x = 119 A = 0.0020 B = 0.0000 Δ = 0.0020x = 121 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.1708 ≤ tol 0.6700 · floors 0.2843/0.3230
posteriordb-Rate_1_data / Rate_1_model
answer record(theta) stan pass 0.0041
00 statement source: posteriordb/Rate_1_data-Rate_1_model
given

A subject answered k = 5 questions correctly out of n = 10 questions of equal difficulty. The unknown success rate theta is constrained to lie in [0, 1] and has a Beta(1, 1) prior.

model

Each question is answered correctly or incorrectly with the same probability theta, independently of all other questions. The total number of correct answers follows a Binomial distribution with count n and success probability theta.

query

The marginal posterior distribution of the success rate theta given the data.

answer spec record(theta)
{
  "kind": "record",
  "fields": {
    "theta": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.004
stan
1// Inferring a Rate
2data {
3 int<lower=1> n;
4 int<lower=0> k;
5}
6parameters {
7 real<lower=0, upper=1> theta;
8}
9model {
10 // Prior Distribution for Rate Theta
11 theta ~ beta(1, 1);
12
13 // Observed Counts
14 k ~ binomial(n, theta);
15}
16
17//@ DATA { k: 5, n: 10 } // values supplied at runtime
18//@ PARAMS ["theta"]
19//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
20
02answer overlay — reference vs stanrecord(theta)
theta
reference stan24 bins · 0.13 … 0.87
00.060.060.110.110.500.48 · 0.110x = 0.13 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.16 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.20 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.23 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.26 A = 0.0220 B = 0.0000 Δ = 0.0220x = 0.29 A = 0.0480 B = 0.0000 Δ = 0.0480x = 0.32 A = 0.0580 B = 0.0000 Δ = 0.0580x = 0.36 A = 0.0480 B = 0.0000 Δ = 0.0480x = 0.39 A = 0.0560 B = 0.0000 Δ = 0.0560x = 0.42 A = 0.0600 B = 0.0000 Δ = 0.0600x = 0.45 A = 0.0940 B = 0.0000 Δ = 0.0940x = 0.48 A = 0.1100 B = 0.0000 Δ = 0.1100x = 0.52 A = 0.0940 B = 0.0000 Δ = 0.0940x = 0.55 A = 0.0780 B = 0.0000 Δ = 0.0780x = 0.58 A = 0.0660 B = 0.0000 Δ = 0.0660x = 0.61 A = 0.0560 B = 0.0000 Δ = 0.0560x = 0.65 A = 0.0600 B = 0.0000 Δ = 0.0600x = 0.68 A = 0.0460 B = 0.0000 Δ = 0.0460x = 0.71 A = 0.0360 B = 0.0000 Δ = 0.0360x = 0.74 A = 0.0220 B = 0.0000 Δ = 0.0220x = 0.77 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.81 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.84 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.87 A = 0.0060 B = 0.0000 Δ = 0.0060
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0041 ≤ tol 0.0164 · floors 0.0082/0.0049
posteriordb-Rate_2_data / Rate_2_model
answer record(theta1, theta2, delta) stan pass 0.0051
00 statement source: posteriordb/Rate_2_data-Rate_2_model
given

Two independent binomial trials were conducted. Trial 1 had n1 = 10 attempts with k1 = 5 successes. Trial 2 had n2 = 10 attempts with k2 = 7 successes. The success rate theta1 for trial 1 has a Beta(1, 1) prior (i.e., Uniform(0, 1)). The success rate theta2 for trial 2 has a Beta(1, 1) prior (i.e., Uniform(0, 1)), independently.

model

The number of successes in trial 1 is Binomial with n1 attempts and success probability theta1. The number of successes in trial 2 is Binomial with n2 attempts and success probability theta2. The difference delta = theta1 - theta2 is a derived quantity constrained to lie in (-1, 1).

query

The marginal posterior distribution of each parameter given the data: the success rate theta1, the success rate theta2, and the difference delta = theta1 - theta2.

answer spec record(theta1, theta2, delta)
{
  "kind": "record",
  "fields": {
    "theta1": {
      "kind": "dist",
      "domain": "real"
    },
    "theta2": {
      "kind": "dist",
      "domain": "real"
    },
    "delta": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.005
stan
1// Difference Between Two Rates
2data {
3 int<lower=1> n1;
4 int<lower=1> n2;
5 int<lower=0> k1;
6 int<lower=0> k2;
7}
8parameters {
9 real<lower=0, upper=1> theta1;
10 real<lower=0, upper=1> theta2;
11}
12transformed parameters {
13 real<lower=-1, upper=1> delta;
14 delta = theta1 - theta2;
15}
16model {
17 // Prior Distribution for Rate Theta
18 theta1 ~ beta(1, 1);
19 theta2 ~ beta(1, 1);
20 // Observed Counts
21 k1 ~ binomial(n1, theta1);
22 k2 ~ binomial(n2, theta2);
23}
24
25//@ DATA { n1: 10, n2: 10, k1: 5, k2: 7 } // values supplied at runtime
26//@ PARAMS ["theta1","theta2","delta"]
27//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
28
02answer overlay — reference vs stanrecord(theta1, theta2, delta)
theta1
reference stan24 bins · 0.17 … 0.83
00.050.050.100.100.500.46 · 0.102x = 0.17 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.19 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.22 A = 0.0200 B = 0.0000 Δ = 0.0200x = 0.25 A = 0.0140 B = 0.0000 Δ = 0.0140x = 0.28 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.31 A = 0.0360 B = 0.0000 Δ = 0.0360x = 0.34 A = 0.0300 B = 0.0000 Δ = 0.0300x = 0.37 A = 0.0660 B = 0.0000 Δ = 0.0660x = 0.40 A = 0.0620 B = 0.0000 Δ = 0.0620x = 0.43 A = 0.0780 B = 0.0000 Δ = 0.0780x = 0.46 A = 0.1020 B = 0.0000 Δ = 0.1020x = 0.48 A = 0.0460 B = 0.0000 Δ = 0.0460x = 0.51 A = 0.0780 B = 0.0000 Δ = 0.0780x = 0.54 A = 0.0860 B = 0.0000 Δ = 0.0860x = 0.57 A = 0.0820 B = 0.0000 Δ = 0.0820x = 0.60 A = 0.0620 B = 0.0000 Δ = 0.0620x = 0.63 A = 0.0500 B = 0.0000 Δ = 0.0500x = 0.66 A = 0.0500 B = 0.0000 Δ = 0.0500x = 0.69 A = 0.0300 B = 0.0000 Δ = 0.0300x = 0.72 A = 0.0280 B = 0.0000 Δ = 0.0280x = 0.75 A = 0.0180 B = 0.0000 Δ = 0.0180x = 0.78 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.80 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.83 A = 0.0080 B = 0.0000 Δ = 0.0080
theta2
reference stan24 bins · 0.25 … 0.92
00.0460.0460.0920.0920.500.69 · 0.092x = 0.25 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.28 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.31 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.34 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.37 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.40 A = 0.0180 B = 0.0000 Δ = 0.0180x = 0.43 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.46 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.49 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.52 A = 0.0340 B = 0.0000 Δ = 0.0340x = 0.54 A = 0.0560 B = 0.0000 Δ = 0.0560x = 0.57 A = 0.0620 B = 0.0000 Δ = 0.0620x = 0.60 A = 0.0760 B = 0.0000 Δ = 0.0760x = 0.63 A = 0.0860 B = 0.0000 Δ = 0.0860x = 0.66 A = 0.0700 B = 0.0000 Δ = 0.0700x = 0.69 A = 0.0920 B = 0.0000 Δ = 0.0920x = 0.72 A = 0.0860 B = 0.0000 Δ = 0.0860x = 0.75 A = 0.0700 B = 0.0000 Δ = 0.0700x = 0.78 A = 0.0700 B = 0.0000 Δ = 0.0700x = 0.81 A = 0.0600 B = 0.0000 Δ = 0.0600x = 0.83 A = 0.0800 B = 0.0000 Δ = 0.0800x = 0.86 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.89 A = 0.0180 B = 0.0000 Δ = 0.0180x = 0.92 A = 0.0100 B = 0.0000 Δ = 0.0100
delta
reference stan24 bins · -0.68 … 0.41
00.050.050.110.11-0.500-0.15 · 0.108x = -0.68 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.63 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.58 A = 0.0080 B = 0.0000 Δ = 0.0080x = -0.54 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.49 A = 0.0220 B = 0.0000 Δ = 0.0220x = -0.44 A = 0.0540 B = 0.0000 Δ = 0.0540x = -0.39 A = 0.0460 B = 0.0000 Δ = 0.0460x = -0.34 A = 0.0880 B = 0.0000 Δ = 0.0880x = -0.30 A = 0.0860 B = 0.0000 Δ = 0.0860x = -0.25 A = 0.0820 B = 0.0000 Δ = 0.0820x = -0.20 A = 0.1000 B = 0.0000 Δ = 0.1000x = -0.15 A = 0.1080 B = 0.0000 Δ = 0.1080x = -0.11 A = 0.0960 B = 0.0000 Δ = 0.0960x = -0.06 A = 0.0680 B = 0.0000 Δ = 0.0680x = -0.01 A = 0.0560 B = 0.0000 Δ = 0.0560x = 0.04 A = 0.0560 B = 0.0000 Δ = 0.0560x = 0.08 A = 0.0340 B = 0.0000 Δ = 0.0340x = 0.13 A = 0.0500 B = 0.0000 Δ = 0.0500x = 0.18 A = 0.0200 B = 0.0000 Δ = 0.0200x = 0.23 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.27 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.32 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.37 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.41 A = 0.0040 B = 0.0000 Δ = 0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0051 ≤ tol 0.0361 · floors 0.0077/0.0082
posteriordb-Rate_3_data / Rate_3_model
answer record(theta) stan pass 0.0056
00 statement source: posteriordb/Rate_3_data-Rate_3_model
given

Two independent binomial trials are assumed to share a common success rate. Trial 1 had n1 = 10 attempts with k1 = 5 successes. Trial 2 had n2 = 10 attempts with k2 = 7 successes. The common success rate theta has a Beta(1, 1) prior (i.e., Uniform(0, 1)).

model

Both trials share the same underlying success probability theta. The number of successes in trial 1 is Binomial with n1 attempts and probability theta. The number of successes in trial 2 is Binomial with n2 attempts and probability theta, independently of trial 1.

query

The marginal posterior distribution of theta given the data.

answer spec record(theta)
{
  "kind": "record",
  "fields": {
    "theta": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.006
stan
1// // Inferring a Common Rate
2data {
3 int<lower=1> n1;
4 int<lower=1> n2;
5 int<lower=0> k1;
6 int<lower=0> k2;
7}
8parameters {
9 real<lower=0, upper=1> theta;
10}
11model {
12 // Prior on Single Rate Theta
13 theta ~ beta(1, 1);
14 // Observed Counts
15 k1 ~ binomial(n1, theta);
16 k2 ~ binomial(n2, theta);
17}
18
19//@ DATA { n1: 10, n2: 10, k1: 5, k2: 7 } // values supplied at runtime
20//@ PARAMS ["theta"]
21//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
22
02answer overlay — reference vs stanrecord(theta)
theta
reference stan24 bins · 0.30 … 0.82
00.050.050.110.110.400.600.800.57 · 0.106x = 0.30 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.33 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.35 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.37 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.39 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.41 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.44 A = 0.0220 B = 0.0000 Δ = 0.0220x = 0.46 A = 0.0460 B = 0.0000 Δ = 0.0460x = 0.48 A = 0.0340 B = 0.0000 Δ = 0.0340x = 0.51 A = 0.0680 B = 0.0000 Δ = 0.0680x = 0.53 A = 0.0620 B = 0.0000 Δ = 0.0620x = 0.55 A = 0.0900 B = 0.0000 Δ = 0.0900x = 0.57 A = 0.1060 B = 0.0000 Δ = 0.1060x = 0.60 A = 0.0820 B = 0.0000 Δ = 0.0820x = 0.62 A = 0.0640 B = 0.0000 Δ = 0.0640x = 0.64 A = 0.0800 B = 0.0000 Δ = 0.0800x = 0.66 A = 0.0500 B = 0.0000 Δ = 0.0500x = 0.69 A = 0.0620 B = 0.0000 Δ = 0.0620x = 0.71 A = 0.0500 B = 0.0000 Δ = 0.0500x = 0.73 A = 0.0460 B = 0.0000 Δ = 0.0460x = 0.76 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.78 A = 0.0160 B = 0.0000 Δ = 0.0160x = 0.80 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.82 A = 0.0040 B = 0.0000 Δ = 0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0056 ≤ tol 0.0137 · floors 0.0068/0.0066
posteriordb-Rate_4_data / Rate_4_model
answer record(theta, thetaprior, postpredk, priorpredk) stan pass 0.1365
00 statement source: posteriordb/Rate_4_data-Rate_4_model
given

A binomial trial had n = 15 attempts with k = 1 success. Two parameters are modeled: the posterior rate theta (conditioned on the data) and an independent prior rate thetaprior (not conditioned on the data, serving as a prior predictive auxiliary). Both theta and thetaprior have Beta(1, 1) priors, independently.

model

The observed count k is Binomial with n attempts and success probability theta. The parameter thetaprior is drawn from the same Beta(1, 1) prior but is not updated by any data — it remains a prior draw.

query

The marginal posterior distribution of each parameter given the data: the posterior rate theta, the independent prior rate thetaprior, the posterior predictive count postpredk (a Binomial(n, theta) draw), and the prior predictive count priorpredk (a Binomial(n, thetaprior) draw).

answer spec record(theta, thetaprior, postpredk, priorpredk)
{
  "kind": "record",
  "fields": {
    "theta": {
      "kind": "dist",
      "domain": "real"
    },
    "thetaprior": {
      "kind": "dist",
      "domain": "real"
    },
    "postpredk": {
      "kind": "dist",
      "domain": "real"
    },
    "priorpredk": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.137
stan
1// Prior and Posterior Prediction
2data {
3 int<lower=1> n;
4 int<lower=0> k;
5}
6parameters {
7 real<lower=0, upper=1> theta;
8 real<lower=0, upper=1> thetaprior;
9}
10model {
11 // Prior on Rate Theta
12 theta ~ beta(1, 1);
13 thetaprior ~ beta(1, 1);
14 // Observed Data
15 k ~ binomial(n, theta);
16}
17generated quantities {
18 int<lower=0> postpredk;
19 int<lower=0> priorpredk;
20
21 // Posterior Predictive
22 postpredk = binomial_rng(n, theta);
23 // Prior Predictive
24 priorpredk = binomial_rng(n, thetaprior);
25}
26
27//@ DATA { k: 1, n: 15 } // values supplied at runtime
28//@ PARAMS ["theta","thetaprior","postpredk","priorpredk"]
29//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
30
02answer overlay — reference vs stanrecord(theta, thetaprior, postpredk, priorpredk)
theta
reference stan24 bins · 0.01 … 0.52
00.080.080.160.160.200.400.06 · 0.156x = 0.01 A = 0.0500 B = 0.0000 Δ = 0.0500x = 0.04 A = 0.1140 B = 0.0000 Δ = 0.1140x = 0.06 A = 0.1560 B = 0.0000 Δ = 0.1560x = 0.08 A = 0.1360 B = 0.0000 Δ = 0.1360x = 0.10 A = 0.1160 B = 0.0000 Δ = 0.1160x = 0.12 A = 0.1200 B = 0.0000 Δ = 0.1200x = 0.15 A = 0.0440 B = 0.0000 Δ = 0.0440x = 0.17 A = 0.0760 B = 0.0000 Δ = 0.0760x = 0.19 A = 0.0420 B = 0.0000 Δ = 0.0420x = 0.21 A = 0.0420 B = 0.0000 Δ = 0.0420x = 0.23 A = 0.0280 B = 0.0000 Δ = 0.0280x = 0.26 A = 0.0360 B = 0.0000 Δ = 0.0360x = 0.28 A = 0.0140 B = 0.0000 Δ = 0.0140x = 0.30 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.32 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.34 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.37 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.39 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.41 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.43 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.46 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.48 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.50 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.52 A = 0.0020 B = 0.0000 Δ = 0.0020
thetaprior
reference stan24 bins · 0.02 … 0.98
00.0300.0300.0600.0600.500.02 · 0.060x = 0.02 A = 0.0600 B = 0.0000 Δ = 0.0600x = 0.07 A = 0.0300 B = 0.0000 Δ = 0.0300x = 0.11 A = 0.0360 B = 0.0000 Δ = 0.0360x = 0.15 A = 0.0520 B = 0.0000 Δ = 0.0520x = 0.19 A = 0.0380 B = 0.0000 Δ = 0.0380x = 0.23 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.27 A = 0.0420 B = 0.0000 Δ = 0.0420x = 0.31 A = 0.0360 B = 0.0000 Δ = 0.0360x = 0.35 A = 0.0540 B = 0.0000 Δ = 0.0540x = 0.40 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.44 A = 0.0380 B = 0.0000 Δ = 0.0380x = 0.48 A = 0.0440 B = 0.0000 Δ = 0.0440x = 0.52 A = 0.0420 B = 0.0000 Δ = 0.0420x = 0.56 A = 0.0420 B = 0.0000 Δ = 0.0420x = 0.60 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.65 A = 0.0340 B = 0.0000 Δ = 0.0340x = 0.69 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.73 A = 0.0280 B = 0.0000 Δ = 0.0280x = 0.77 A = 0.0420 B = 0.0000 Δ = 0.0420x = 0.81 A = 0.0500 B = 0.0000 Δ = 0.0500x = 0.85 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.89 A = 0.0480 B = 0.0000 Δ = 0.0480x = 0.94 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.98 A = 0.0600 B = 0.0000 Δ = 0.0600
postpredk
reference stan9 bins · 0 … 8
00.150.150.290.290 A = 0.270 B = 0.0000 A = 0.270 B = 0.00001 A = 0.292 B = 0.0001 A = 0.292 B = 0.0002 A = 0.178 B = 0.0002 A = 0.178 B = 0.00023 A = 0.106 B = 0.0003 A = 0.106 B = 0.0004 A = 0.082 B = 0.0004 A = 0.082 B = 0.00045 A = 0.040 B = 0.0005 A = 0.040 B = 0.0006 A = 0.022 B = 0.0006 A = 0.022 B = 0.00067 A = 0.006 B = 0.0007 A = 0.006 B = 0.0008 A = 0.004 B = 0.0008 A = 0.004 B = 0.0008
priorpredk
reference stan16 bins · 0 … 15
00.0390.0390.0780.0780100 · 0.078x = 0 A = 0.0780 B = 0.0000 Δ = 0.0780x = 1 A = 0.0720 B = 0.0000 Δ = 0.0720x = 2 A = 0.0600 B = 0.0000 Δ = 0.0600x = 3 A = 0.0440 B = 0.0000 Δ = 0.0440x = 4 A = 0.0480 B = 0.0000 Δ = 0.0480x = 5 A = 0.0740 B = 0.0000 Δ = 0.0740x = 6 A = 0.0640 B = 0.0000 Δ = 0.0640x = 7 A = 0.0520 B = 0.0000 Δ = 0.0520x = 8 A = 0.0560 B = 0.0000 Δ = 0.0560x = 9 A = 0.0600 B = 0.0000 Δ = 0.0600x = 10 A = 0.0780 B = 0.0000 Δ = 0.0780x = 11 A = 0.0540 B = 0.0000 Δ = 0.0540x = 12 A = 0.0600 B = 0.0000 Δ = 0.0600x = 13 A = 0.0700 B = 0.0000 Δ = 0.0700x = 14 A = 0.0560 B = 0.0000 Δ = 0.0560x = 15 A = 0.0740 B = 0.0000 Δ = 0.0740
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.1365 ≤ tol 0.8740 · floors 0.2003/0.2570
posteriordb-Rate_5_data / Rate_5_model
answer record(theta, postpredk1, postpredk2) stan pass 0.0517
00 statement source: posteriordb/Rate_5_data-Rate_5_model
given

Two independent binomial trials are assumed to share a common success rate. Trial 1 had n1 = 10 attempts with k1 = 0 successes. Trial 2 had n2 = 10 attempts with k2 = 10 successes. The common success rate theta has a Beta(1, 1) prior (i.e., Uniform(0, 1)).

model

Both trials share the same underlying success probability theta. The number of successes in trial 1 is Binomial with n1 attempts and probability theta. The number of successes in trial 2 is Binomial with n2 attempts and probability theta, independently of trial 1.

query

The marginal posterior distribution of each parameter given the data: the common success rate theta, the posterior predictive count postpredk1 for a new trial of size n1 (a Binomial(n1, theta) draw), and the posterior predictive count postpredk2 for a new trial of size n2 (a Binomial(n2, theta) draw).

answer spec record(theta, postpredk1, postpredk2)
{
  "kind": "record",
  "fields": {
    "theta": {
      "kind": "dist",
      "domain": "real"
    },
    "postpredk1": {
      "kind": "dist",
      "domain": "real"
    },
    "postpredk2": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.052
stan
1// Inferring a Common Rate, With Posterior Predictive
2data {
3 int<lower=1> n1;
4 int<lower=1> n2;
5 int<lower=0> k1;
6 int<lower=0> k2;
7}
8parameters {
9 real<lower=0, upper=1> theta;
10}
11model {
12 // Prior on Single Rate Theta
13 theta ~ beta(1, 1);
14
15 // Observed Counts
16 k1 ~ binomial(n1, theta);
17 k2 ~ binomial(n2, theta);
18}
19generated quantities {
20 int<lower=0, upper=n1> postpredk1;
21 int<lower=0, upper=n2> postpredk2;
22
23 // Posterior Predictive
24 postpredk1 = binomial_rng(n1, theta);
25 postpredk2 = binomial_rng(n2, theta);
26}
27
28//@ DATA { n1: 10, n2: 10, k1: 0, k2: 10 } // values supplied at runtime
29//@ PARAMS ["theta","postpredk1","postpredk2"]
30//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
31
02answer overlay — reference vs stanrecord(theta, postpredk1, postpredk2)
theta
reference stan24 bins · 0.25 … 0.79
00.0470.0470.0940.0940.400.600.53 · 0.094x = 0.25 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.28 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.30 A = 0.0160 B = 0.0000 Δ = 0.0160x = 0.32 A = 0.0200 B = 0.0000 Δ = 0.0200x = 0.34 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.37 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.39 A = 0.0600 B = 0.0000 Δ = 0.0600x = 0.41 A = 0.0780 B = 0.0000 Δ = 0.0780x = 0.44 A = 0.0760 B = 0.0000 Δ = 0.0760x = 0.46 A = 0.0840 B = 0.0000 Δ = 0.0840x = 0.48 A = 0.0820 B = 0.0000 Δ = 0.0820x = 0.51 A = 0.0820 B = 0.0000 Δ = 0.0820x = 0.53 A = 0.0940 B = 0.0000 Δ = 0.0940x = 0.56 A = 0.0680 B = 0.0000 Δ = 0.0680x = 0.58 A = 0.0740 B = 0.0000 Δ = 0.0740x = 0.60 A = 0.0500 B = 0.0000 Δ = 0.0500x = 0.63 A = 0.0580 B = 0.0000 Δ = 0.0580x = 0.65 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.67 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.70 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.72 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.74 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.77 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.79 A = 0.0020 B = 0.0000 Δ = 0.0020
postpredk1
reference stan11 bins · 0 … 10
00.100.100.200.200 A = 0.004 B = 0.0000 A = 0.004 B = 0.00001 A = 0.018 B = 0.0001 A = 0.018 B = 0.0002 A = 0.058 B = 0.0002 A = 0.058 B = 0.00023 A = 0.132 B = 0.0003 A = 0.132 B = 0.0004 A = 0.190 B = 0.0004 A = 0.190 B = 0.00045 A = 0.204 B = 0.0005 A = 0.204 B = 0.0006 A = 0.166 B = 0.0006 A = 0.166 B = 0.00067 A = 0.126 B = 0.0007 A = 0.126 B = 0.0008 A = 0.078 B = 0.0008 A = 0.078 B = 0.00089 A = 0.020 B = 0.0009 A = 0.020 B = 0.00010 A = 0.004 B = 0.00010 A = 0.004 B = 0.00010
postpredk2
reference stan11 bins · 0 … 10
00.100.100.210.210 A = 0.006 B = 0.0000 A = 0.006 B = 0.00001 A = 0.020 B = 0.0001 A = 0.020 B = 0.0002 A = 0.046 B = 0.0002 A = 0.046 B = 0.00023 A = 0.122 B = 0.0003 A = 0.122 B = 0.0004 A = 0.204 B = 0.0004 A = 0.204 B = 0.00045 A = 0.210 B = 0.0005 A = 0.210 B = 0.0006 A = 0.188 B = 0.0006 A = 0.188 B = 0.00067 A = 0.122 B = 0.0007 A = 0.122 B = 0.0008 A = 0.068 B = 0.0008 A = 0.068 B = 0.00089 A = 0.010 B = 0.0009 A = 0.010 B = 0.00010 A = 0.004 B = 0.00010 A = 0.004 B = 0.00010
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0517 ≤ tol 0.3290 · floors 0.0890/0.1645
posteriordb-Survey_data / Survey_model
answer record(theta) stan pass 0.0050
00 statement source: posteriordb/Survey_data-Survey_model
given

A number of surveys were sent out and some were returned; the returns are observed on m = 5 separate occasions, giving five observed return counts (each a non-negative integer). The maximum plausible number of surveys sent is 500. The unknown number of surveys sent is at most 500 and at least the largest observed return count, with a discrete uniform prior over that range. The return rate theta has a Uniform(0, 1) prior.

model

A fixed but unknown number of surveys n was sent, and each survey is independently returned with probability theta. On each observation occasion the number of returns is Binomial with n trials and success probability theta. The unknown count n is marginalized over its full range (from the largest observed return count up to 500), so the return rate theta is inferred by averaging over all consistent values of n.

query

The marginal posterior distribution of the return rate theta given the data.

answer spec record(theta)
{
  "kind": "record",
  "fields": {
    "theta": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.005
stan
1/*
2 * Notes to Stan model
3 * --------------------
4 * This model code is more difficult to understand in Stan implementation since
5 * Stan is unable to sample discrete parameters. This may change in the future.
6 * For better understanding read Stan manual chapter 'Mixture Modeling' (p.68 in
7 * version 2.4.0) first.
8 */
9
10// Inferring Return Rate and Number of Surveys from Observed Returns
11data {
12 int<lower=0> nmax;
13 int<lower=0> m;
14 array[m] int<lower=0, upper=nmax> k;
15}
16transformed data {
17 int<lower=0> nmin; // Minimal possible n
18
19 nmin = max(k);
20}
21parameters {
22 real<lower=0, upper=1> theta;
23}
24transformed parameters {
25 vector[nmax] lp_parts; // Log probability for each n
26
27 // First part of the trick for mixture model
28 for (n in 1 : nmax) {
29 if (n < nmin) {
30 lp_parts[n] = log(1.0 / nmax) + negative_infinity();
31 } // Zero probability
32 else {
33 lp_parts[n] = log(1.0 / nmax) + binomial_lpmf(k | n, theta);
34 }
35 }
36 // Deprecated: lp_parts[n] = log(1.0 / nmax) + binomial_log(k, n, theta);
37}
38model {
39 // Second part of the trick for mixture model
40 // Deprecated: increment_log_prob(log_sum_exp(lp_parts));
41 target += log_sum_exp(lp_parts);
42}
43generated quantities {
44 int<lower=1, upper=nmax> n;
45 simplex[nmax] prob_n;
46
47 // Transforming lp_parts to probabilities of each n
48 prob_n = softmax(lp_parts);
49 n = categorical_rng(prob_n);
50}
51
52//@ DATA { nmax: 500, k: [5 values], m: 5 } // values supplied at runtime
53//@ PARAMS ["theta"]
54//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
55
02answer overlay — reference vs stanrecord(theta)
theta
reference stan24 bins · 0.05 … 0.72
00.090.090.180.180.500.05 · 0.178x = 0.05 A = 0.1780 B = 0.0000 Δ = 0.1780x = 0.08 A = 0.1480 B = 0.0000 Δ = 0.1480x = 0.11 A = 0.0960 B = 0.0000 Δ = 0.0960x = 0.14 A = 0.0820 B = 0.0000 Δ = 0.0820x = 0.17 A = 0.0800 B = 0.0000 Δ = 0.0800x = 0.20 A = 0.0520 B = 0.0000 Δ = 0.0520x = 0.23 A = 0.0720 B = 0.0000 Δ = 0.0720x = 0.26 A = 0.0440 B = 0.0000 Δ = 0.0440x = 0.28 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.31 A = 0.0360 B = 0.0000 Δ = 0.0360x = 0.34 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.37 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.40 A = 0.0220 B = 0.0000 Δ = 0.0220x = 0.43 A = 0.0160 B = 0.0000 Δ = 0.0160x = 0.46 A = 0.0180 B = 0.0000 Δ = 0.0180x = 0.49 A = 0.0160 B = 0.0000 Δ = 0.0160x = 0.52 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.55 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.57 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.60 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.63 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.66 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.69 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.72 A = 0.0040 B = 0.0000 Δ = 0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0050 ≤ tol 0.0298 · floors 0.0149/0.0047
posteriordb-arK / arK
answer record(alpha, beta[1], beta[2], beta[3], beta[4], beta[5], sigma) stan pass 0.0038
00 statement source: posteriordb/arK-arK
given

For a time series of T observations, the data provide an array y of T real-valued observations. The model also requires K, the number of autoregressive lags, which is fixed. The intercept parameter alpha has a Normal(location 0, scale 10) prior. Each of the K autoregressive lag coefficients beta[1] through beta[K] has a Normal(location 0, scale 10) prior. The observation noise standard deviation sigma, constrained to be positive, has a half-Cauchy(location 0, scale 2.5) prior.

model

An autoregressive time series model of order K. The first K observations serve as initial conditions. For each subsequent time point t from K+1 to T, the observation y[t] is generated from a normal distribution whose mean is the intercept alpha plus a linear autoregressive term (the sum of beta[k] times the observation from k steps in the past, y[t-k], for k from 1 to K), and whose standard deviation is sigma.

query

The marginal posterior distributions of the following parameters: alpha (the intercept), beta[1] through beta[K] (the K autoregressive lag coefficients), and sigma (the observation noise standard deviation).

answer spec record(alpha, beta[1], beta[2], beta[3], beta[4], beta[5], sigma)
{
  "kind": "record",
  "fields": {
    "alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.004
stan
1data {
2 int<lower=0> K;
3 int<lower=0> T;
4 array[T] real y;
5}
6parameters {
7 real alpha;
8 array[K] real beta;
9 real<lower=0> sigma;
10}
11model {
12 alpha ~ normal(0, 10);
13 beta ~ normal(0, 10);
14 sigma ~ cauchy(0, 2.5);
15
16 for (t in (K + 1) : T) {
17 real mu;
18 mu = alpha;
19
20 for (k in 1 : K) {
21 mu = mu + beta[k] * y[t - k];
22 }
23
24 y[t] ~ normal(mu, sigma);
25 }
26}
27
28//@ DATA { K: 5, T: 200, y: [200 values] } // values supplied at runtime
29//@ PARAMS ["alpha","beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","sigma"]
30//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
31
02answer overlay — reference vs stanrecord(alpha, beta[1], beta[2], beta[3], beta[4], beta[5], sigma)
alpha
reference stan24 bins · -0.03 … 0.03
00.070.070.130.130-0.00 · 0.116-0.00 · 0.130x = -0.03 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.03 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.03 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.02 A = 0.0080 B = 0.0040 Δ = 0.0040x = -0.02 A = 0.0200 B = 0.0140 Δ = 0.0060x = -0.02 A = 0.0380 B = 0.0180 Δ = 0.0200x = -0.01 A = 0.0580 B = 0.0500 Δ = 0.0080x = -0.01 A = 0.0740 B = 0.0720 Δ = 0.0020x = -0.01 A = 0.0900 B = 0.0880 Δ = 0.0020x = -0.01 A = 0.0980 B = 0.1000 Δ = -0.0020x = -0.00 A = 0.1160 B = 0.1300 Δ = -0.0140x = -0.00 A = 0.0700 B = 0.0460 Δ = 0.0240x = 0.00 A = 0.1120 B = 0.1040 Δ = 0.0080x = 0.01 A = 0.0960 B = 0.0880 Δ = 0.0080x = 0.01 A = 0.0680 B = 0.0900 Δ = -0.0220x = 0.01 A = 0.0700 B = 0.0540 Δ = 0.0160x = 0.01 A = 0.0380 B = 0.0680 Δ = -0.0300x = 0.02 A = 0.0160 B = 0.0300 Δ = -0.0140x = 0.02 A = 0.0140 B = 0.0180 Δ = -0.0040x = 0.02 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.03 A = 0.0000 B = 0.0120 Δ = -0.0120x = 0.03 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.03 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.03 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[1]
reference stan24 bins · 0.51 … 0.90
00.060.060.120.120.600.800.65 · 0.0980.68 · 0.122x = 0.51 A = 0.0100 B = 0.0080 Δ = 0.0020x = 0.53 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.54 A = 0.0140 B = 0.0120 Δ = 0.0020x = 0.56 A = 0.0160 B = 0.0180 Δ = -0.0020x = 0.58 A = 0.0340 B = 0.0280 Δ = 0.0060x = 0.60 A = 0.0380 B = 0.0340 Δ = 0.0040x = 0.61 A = 0.0420 B = 0.0500 Δ = -0.0080x = 0.63 A = 0.0600 B = 0.0680 Δ = -0.0080x = 0.65 A = 0.0980 B = 0.0680 Δ = 0.0300x = 0.66 A = 0.0940 B = 0.0820 Δ = 0.0120x = 0.68 A = 0.0960 B = 0.1220 Δ = -0.0260x = 0.70 A = 0.0640 B = 0.0940 Δ = -0.0300x = 0.71 A = 0.0900 B = 0.0960 Δ = -0.0060x = 0.73 A = 0.0880 B = 0.1160 Δ = -0.0280x = 0.75 A = 0.0700 B = 0.0480 Δ = 0.0220x = 0.77 A = 0.0580 B = 0.0460 Δ = 0.0120x = 0.78 A = 0.0540 B = 0.0340 Δ = 0.0200x = 0.80 A = 0.0200 B = 0.0240 Δ = -0.0040x = 0.82 A = 0.0220 B = 0.0120 Δ = 0.0100x = 0.83 A = 0.0120 B = 0.0180 Δ = -0.0060x = 0.85 A = 0.0060 B = 0.0120 Δ = -0.0060x = 0.87 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.89 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.90 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[2]
reference stan24 bins · 0.17 … 0.72
00.060.060.120.120.200.400.600.48 · 0.1140.46 · 0.118x = 0.17 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.20 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.22 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.24 A = 0.0100 B = 0.0100 Δ = 0.0000x = 0.27 A = 0.0200 B = 0.0160 Δ = 0.0040x = 0.29 A = 0.0280 B = 0.0180 Δ = 0.0100x = 0.32 A = 0.0320 B = 0.0540 Δ = -0.0220x = 0.34 A = 0.0480 B = 0.0440 Δ = 0.0040x = 0.36 A = 0.0880 B = 0.0600 Δ = 0.0280x = 0.39 A = 0.0740 B = 0.0840 Δ = -0.0100x = 0.41 A = 0.0900 B = 0.1140 Δ = -0.0240x = 0.43 A = 0.1080 B = 0.1000 Δ = 0.0080x = 0.46 A = 0.1120 B = 0.1180 Δ = -0.0060x = 0.48 A = 0.1140 B = 0.0940 Δ = 0.0200x = 0.51 A = 0.0540 B = 0.0760 Δ = -0.0220x = 0.53 A = 0.0980 B = 0.0800 Δ = 0.0180x = 0.55 A = 0.0420 B = 0.0520 Δ = -0.0100x = 0.58 A = 0.0260 B = 0.0280 Δ = -0.0020x = 0.60 A = 0.0160 B = 0.0260 Δ = -0.0100x = 0.63 A = 0.0200 B = 0.0060 Δ = 0.0140x = 0.65 A = 0.0080 B = 0.0040 Δ = 0.0040x = 0.67 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.70 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.72 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[3]
reference stan24 bins · -0.21 … 0.45
00.070.070.150.1500.16 · 0.1360.10 · 0.148x = -0.21 A = 0.0000 B = 0.0060 Δ = -0.0060x = -0.18 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.16 A = 0.0040 B = 0.0040 Δ = 0.0000x = -0.13 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.10 A = 0.0160 B = 0.0100 Δ = 0.0060x = -0.07 A = 0.0240 B = 0.0160 Δ = 0.0080x = -0.04 A = 0.0440 B = 0.0380 Δ = 0.0060x = -0.01 A = 0.0700 B = 0.0600 Δ = 0.0100x = 0.02 A = 0.0780 B = 0.0840 Δ = -0.0060x = 0.05 A = 0.1120 B = 0.1040 Δ = 0.0080x = 0.07 A = 0.1080 B = 0.1160 Δ = -0.0080x = 0.10 A = 0.1080 B = 0.1480 Δ = -0.0400x = 0.13 A = 0.1060 B = 0.1060 Δ = 0.0000x = 0.16 A = 0.1360 B = 0.0900 Δ = 0.0460x = 0.19 A = 0.0620 B = 0.0860 Δ = -0.0240x = 0.22 A = 0.0380 B = 0.0560 Δ = -0.0180x = 0.25 A = 0.0360 B = 0.0240 Δ = 0.0120x = 0.28 A = 0.0360 B = 0.0220 Δ = 0.0140x = 0.30 A = 0.0100 B = 0.0120 Δ = -0.0020x = 0.33 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.36 A = 0.0020 B = 0.0100 Δ = -0.0080x = 0.39 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.42 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.45 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[4]
reference stan24 bins · -0.27 … 0.22
00.060.060.120.12-0.2000.20-0.08 · 0.114-0.01 · 0.116x = -0.27 A = 0.0020 B = 0.0040 Δ = -0.0020x = -0.25 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.23 A = 0.0100 B = 0.0080 Δ = 0.0020x = -0.21 A = 0.0140 B = 0.0040 Δ = 0.0100x = -0.19 A = 0.0140 B = 0.0200 Δ = -0.0060x = -0.17 A = 0.0240 B = 0.0460 Δ = -0.0220x = -0.14 A = 0.0440 B = 0.0360 Δ = 0.0080x = -0.12 A = 0.0740 B = 0.0520 Δ = 0.0220x = -0.10 A = 0.0640 B = 0.0640 Δ = -0.0000x = -0.08 A = 0.1140 B = 0.0680 Δ = 0.0460x = -0.06 A = 0.0840 B = 0.0980 Δ = -0.0140x = -0.04 A = 0.1100 B = 0.1020 Δ = 0.0080x = -0.01 A = 0.0960 B = 0.1160 Δ = -0.0200x = 0.01 A = 0.0640 B = 0.0860 Δ = -0.0220x = 0.03 A = 0.0760 B = 0.0640 Δ = 0.0120x = 0.05 A = 0.0640 B = 0.1080 Δ = -0.0440x = 0.07 A = 0.0440 B = 0.0360 Δ = 0.0080x = 0.09 A = 0.0520 B = 0.0280 Δ = 0.0240x = 0.12 A = 0.0180 B = 0.0300 Δ = -0.0120x = 0.14 A = 0.0160 B = 0.0100 Δ = 0.0060x = 0.16 A = 0.0060 B = 0.0140 Δ = -0.0080x = 0.18 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.20 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.22 A = 0.0040 B = 0.0000 Δ = 0.0040
beta[5]
reference stan24 bins · -0.50 … -0.10
00.060.060.120.12-0.40-0.20-0.29 · 0.114-0.29 · 0.122x = -0.50 A = 0.0020 B = 0.0080 Δ = -0.0060x = -0.48 A = 0.0080 B = 0.0020 Δ = 0.0060x = -0.47 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.45 A = 0.0120 B = 0.0080 Δ = 0.0040x = -0.43 A = 0.0120 B = 0.0160 Δ = -0.0040x = -0.41 A = 0.0340 B = 0.0300 Δ = 0.0040x = -0.40 A = 0.0260 B = 0.0440 Δ = -0.0180x = -0.38 A = 0.0520 B = 0.0720 Δ = -0.0200x = -0.36 A = 0.0960 B = 0.0640 Δ = 0.0320x = -0.34 A = 0.0980 B = 0.0980 Δ = -0.0000x = -0.33 A = 0.0660 B = 0.0900 Δ = -0.0240x = -0.31 A = 0.0880 B = 0.0920 Δ = -0.0040x = -0.29 A = 0.1140 B = 0.1220 Δ = -0.0080x = -0.27 A = 0.0920 B = 0.0880 Δ = 0.0040x = -0.26 A = 0.0840 B = 0.0660 Δ = 0.0180x = -0.24 A = 0.0740 B = 0.0540 Δ = 0.0200x = -0.22 A = 0.0380 B = 0.0500 Δ = -0.0120x = -0.20 A = 0.0300 B = 0.0320 Δ = -0.0020x = -0.19 A = 0.0240 B = 0.0320 Δ = -0.0080x = -0.17 A = 0.0280 B = 0.0180 Δ = 0.0100x = -0.15 A = 0.0120 B = 0.0020 Δ = 0.0100x = -0.13 A = 0.0020 B = 0.0040 Δ = -0.0020x = -0.12 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.10 A = 0.0020 B = 0.0040 Δ = -0.0020
sigma
reference stan24 bins · 0.12 … 0.18
00.070.070.140.140.140.160.15 · 0.1320.15 · 0.140x = 0.12 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.12 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.13 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.13 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.13 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.13 A = 0.0160 B = 0.0180 Δ = -0.0020x = 0.14 A = 0.0180 B = 0.0240 Δ = -0.0060x = 0.14 A = 0.0660 B = 0.0560 Δ = 0.0100x = 0.14 A = 0.0540 B = 0.0580 Δ = -0.0040x = 0.14 A = 0.1060 B = 0.1140 Δ = -0.0080x = 0.15 A = 0.0880 B = 0.1120 Δ = -0.0240x = 0.15 A = 0.1320 B = 0.1020 Δ = 0.0300x = 0.15 A = 0.1240 B = 0.1400 Δ = -0.0160x = 0.15 A = 0.0760 B = 0.1060 Δ = -0.0300x = 0.16 A = 0.1200 B = 0.0960 Δ = 0.0240x = 0.16 A = 0.0740 B = 0.0420 Δ = 0.0320x = 0.16 A = 0.0440 B = 0.0540 Δ = -0.0100x = 0.16 A = 0.0260 B = 0.0140 Δ = 0.0120x = 0.17 A = 0.0280 B = 0.0200 Δ = 0.0080x = 0.17 A = 0.0120 B = 0.0180 Δ = -0.0060x = 0.17 A = 0.0080 B = 0.0060 Δ = 0.0020x = 0.17 A = 0.0000 B = 0.0080 Δ = -0.0080x = 0.18 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.18 A = 0.0000 B = 0.0020 Δ = -0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0038 ≤ tol 0.0132 · floors 0.0063/0.0066
posteriordb-bball_drive_event_0 / hmm_drive_0
answer record(theta1[1], theta1[2], theta2[1], theta2[2], phi[1], phi[2], lambda[1], lambda[2]) stan pass 0.0177
00 statement source: posteriordb/bball_drive_event_0-hmm_drive_0
given

For a sequence of N = 416 observations of basketball drive events, the data provide two measurements at each time step: u[t], the inverse player speed (1/speed), and v[t], the distance to the hoop. The model operates with K = 2 hidden states (state 1 represents no drive event, state 2 represents a drive event). A matrix alpha, of size 2 by 2 with positive entries, supplies the Dirichlet hyperparameters for the transition probability priors; each row k specifies the hyperparameters for transitions originating from state k. The parameters theta1 and theta2 are probability vectors that sum to 1 (simplices), each with a Dirichlet prior; theta1 governs transitions from state 1 and theta2 governs transitions from state 2, with hyperparameters from alpha[1, :] and alpha[2, :] respectively. The parameters phi and lambda are pairs of positive values constrained so that phi[1] <= phi[2] and lambda[1] <= lambda[2]; phi[1] has a Normal(0, 1) prior, phi[2] has a Normal(3, 1) prior, lambda[1] has a Normal(0, 1) prior, and lambda[2] has a Normal(3, 1) prior. All four of these priors are over the positive reals (half-normal distributions).

model

The observed sequence is generated by a discrete-time hidden Markov model with K = 2 hidden states. At the initial time step t = 1, the hidden state z[1] is drawn uniformly at random from the two states. At each subsequent time step t = 2, 3, ..., N, the hidden state z[t] transitions from z[t-1] according to a state-specific transition probability vector: if z[t-1] = 1, the next state is drawn from the categorical distribution determined by theta1; if z[t-1] = 2, the next state is drawn from theta2. Given the hidden state z[t] at time t, the two observations u[t] and v[t] are generated independently as exponential random variables with rates phi[z[t]] and lambda[z[t]] respectively.

query

The marginal posterior distributions of the eight parameters: theta1[1] and theta1[2] (the state-conditional transition probabilities from state 1 to states 1 and 2 respectively), theta2[1] and theta2[2] (the state-conditional transition probabilities from state 2 to states 1 and 2 respectively), phi[1] and phi[2] (the exponential rate parameters for inverse speed in states 1 and 2), and lambda[1] and lambda[2] (the exponential rate parameters for hoop distance in states 1 and 2).

answer spec record(theta1[1], theta1[2], theta2[1], theta2[2], phi[1], phi[2], lambda[1], lambda[2])
{
  "kind": "record",
  "fields": {
    "theta1[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta1[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta2[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta2[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "phi[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "phi[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[2]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.018
stan
1// drive model (exponential dist)
2data {
3 int<lower=1> K; // number of states (1 = none, 2 = drive)
4 int<lower=1> N; // length of process
5 array[N] real u; // 1/speed
6 array[N] real v; // hoop distance
7 matrix<lower=0>[K, K] alpha; // transit prior
8}
9parameters {
10 simplex[K] theta1;
11 simplex[K] theta2;
12 // enforce an ordering: phi[1] <= phi[2]
13 positive_ordered[K] phi; // emission parameter for 1/speed
14 positive_ordered[K] lambda; // emission parameter for hoop dist
15}
16transformed parameters {
17 array[K] simplex[K] theta; // transit probs
18 theta[1] = theta1;
19 theta[2] = theta2;
20}
21model {
22 // priors
23 for (k in 1 : K) {
24 target += dirichlet_lpdf(theta[k] | alpha[k, : ]');
25 }
26 target += normal_lpdf(phi[1] | 0, 1);
27 target += normal_lpdf(phi[2] | 3, 1);
28 target += normal_lpdf(lambda[1] | 0, 1);
29 target += normal_lpdf(lambda[2] | 3, 1);
30 // forward algorithm
31 {
32 array[K] real acc;
33 array[N, K] real gamma;
34 for (k in 1 : K) {
35 gamma[1, k] = exponential_lpdf(u[1] | phi[k])
36 + exponential_lpdf(v[1] | lambda[k]);
37 }
38 for (t in 2 : N) {
39 for (k in 1 : K) {
40 for (j in 1 : K) {
41 acc[j] = gamma[t - 1, j] + log(theta[j, k])
42 + exponential_lpdf(u[t] | phi[k])
43 + exponential_lpdf(v[t] | lambda[k]);
44 }
45 gamma[t, k] = log_sum_exp(acc);
46 }
47 }
48 target += log_sum_exp(gamma[N]);
49 }
50}
51generated quantities {
52 array[N] int<lower=1, upper=K> z_star;
53 real log_p_z_star;
54 // Viterbi algorithm
55 {
56 array[N, K] int back_ptr;
57 array[N, K] real best_logp;
58 for (k in 1 : K) {
59 best_logp[1, K] = exponential_lpdf(u[1] | phi[k])
60 + exponential_lpdf(v[1] | lambda[k]);
61 }
62 for (t in 2 : N) {
63 for (k in 1 : K) {
64 best_logp[t, k] = negative_infinity();
65 for (j in 1 : K) {
66 real logp;
67 logp = best_logp[t - 1, j] + log(theta[j, k])
68 + exponential_lpdf(u[t] | phi[k])
69 + exponential_lpdf(v[t] | lambda[k]);
70 if (logp > best_logp[t, k]) {
71 back_ptr[t, k] = j;
72 best_logp[t, k] = logp;
73 }
74 }
75 }
76 }
77 log_p_z_star = max(best_logp[N]);
78 for (k in 1 : K) {
79 if (best_logp[N, k] == log_p_z_star) {
80 z_star[N] = k;
81 }
82 }
83 for (t in 1 : (N - 1)) {
84 z_star[N - t] = back_ptr[N - t + 1, z_star[N - t + 1]];
85 }
86 }
87}
88
89//@ DATA { N: 416, K: 2, u: [416 values], v: [416 values], alpha: [2×2 matrix] } // values supplied at runtime
90//@ PARAMS ["theta1[1]","theta1[2]","theta2[1]","theta2[2]","phi[1]","phi[2]","lambda[1]","lambda[2]"]
91//@ SAMPLING {"chains":8,"iter_warmup":6000,"iter_sampling":3000,"adapt_delta":0.9}
92
02answer overlay — reference vs stanrecord(theta1[1], theta1[2], theta2[1], theta2[2], phi[1], phi[2], lambda[1], lambda[2])
theta1[1]
reference stan24 bins · 0.96 … 1.00
00.090.090.190.190.980.99 · 0.1660.99 · 0.188x = 0.96 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.96 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.97 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.97 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.97 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.97 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.97 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.97 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.98 A = 0.0020 B = 0.0100 Δ = -0.0080x = 0.98 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.98 A = 0.0040 B = 0.0160 Δ = -0.0120x = 0.98 A = 0.0120 B = 0.0140 Δ = -0.0020x = 0.98 A = 0.0320 B = 0.0280 Δ = 0.0040x = 0.98 A = 0.0540 B = 0.0400 Δ = 0.0140x = 0.98 A = 0.0380 B = 0.0400 Δ = -0.0020x = 0.99 A = 0.0840 B = 0.0600 Δ = 0.0240x = 0.99 A = 0.0780 B = 0.0440 Δ = 0.0340x = 0.99 A = 0.1180 B = 0.0960 Δ = 0.0220x = 0.99 A = 0.1620 B = 0.1580 Δ = 0.0040x = 0.99 A = 0.0840 B = 0.0860 Δ = -0.0020x = 0.99 A = 0.1660 B = 0.1880 Δ = -0.0220x = 1.00 A = 0.0680 B = 0.0600 Δ = 0.0080x = 1.00 A = 0.0820 B = 0.1100 Δ = -0.0280x = 1.00 A = 0.0060 B = 0.0200 Δ = -0.0140
theta1[2]
reference stan24 bins · 0.00 … 0.04
00.090.090.190.190.020.01 · 0.1660.01 · 0.188x = 0.00 A = 0.0060 B = 0.0200 Δ = -0.0140x = 0.00 A = 0.0820 B = 0.1100 Δ = -0.0280x = 0.00 A = 0.0680 B = 0.0600 Δ = 0.0080x = 0.01 A = 0.1660 B = 0.1880 Δ = -0.0220x = 0.01 A = 0.0840 B = 0.0860 Δ = -0.0020x = 0.01 A = 0.1620 B = 0.1580 Δ = 0.0040x = 0.01 A = 0.1180 B = 0.0960 Δ = 0.0220x = 0.01 A = 0.0780 B = 0.0440 Δ = 0.0340x = 0.01 A = 0.0840 B = 0.0600 Δ = 0.0240x = 0.01 A = 0.0380 B = 0.0400 Δ = -0.0020x = 0.02 A = 0.0540 B = 0.0400 Δ = 0.0140x = 0.02 A = 0.0140 B = 0.0200 Δ = -0.0060x = 0.02 A = 0.0300 B = 0.0220 Δ = 0.0080x = 0.02 A = 0.0040 B = 0.0160 Δ = -0.0120x = 0.02 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.02 A = 0.0020 B = 0.0100 Δ = -0.0080x = 0.03 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.03 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.03 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.03 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.03 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.03 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.04 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.04 A = 0.0000 B = 0.0020 Δ = -0.0020
theta2[1]
reference stan24 bins · 0.00 … 0.13
00.060.060.130.130.050.100.02 · 0.1260.03 · 0.118x = 0.00 A = 0.0220 B = 0.0260 Δ = -0.0040x = 0.01 A = 0.0980 B = 0.0780 Δ = 0.0200x = 0.02 A = 0.1260 B = 0.1120 Δ = 0.0140x = 0.02 A = 0.1220 B = 0.1160 Δ = 0.0060x = 0.03 A = 0.1140 B = 0.1180 Δ = -0.0040x = 0.03 A = 0.1220 B = 0.1060 Δ = 0.0160x = 0.04 A = 0.0740 B = 0.0900 Δ = -0.0160x = 0.04 A = 0.0720 B = 0.0920 Δ = -0.0200x = 0.05 A = 0.0680 B = 0.0540 Δ = 0.0140x = 0.05 A = 0.0520 B = 0.0640 Δ = -0.0120x = 0.06 A = 0.0320 B = 0.0280 Δ = 0.0040x = 0.07 A = 0.0260 B = 0.0280 Δ = -0.0020x = 0.07 A = 0.0280 B = 0.0340 Δ = -0.0060x = 0.08 A = 0.0120 B = 0.0180 Δ = -0.0060x = 0.08 A = 0.0040 B = 0.0080 Δ = -0.0040x = 0.09 A = 0.0120 B = 0.0100 Δ = 0.0020x = 0.09 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.10 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.10 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.11 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.12 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.12 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.13 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.13 A = 0.0020 B = 0.0000 Δ = 0.0020
theta2[2]
reference stan24 bins · 0.87 … 1.00
00.060.060.130.130.900.950.98 · 0.1260.97 · 0.118x = 0.87 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.87 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.88 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.88 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.89 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.90 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.90 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.91 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.91 A = 0.0120 B = 0.0100 Δ = 0.0020x = 0.92 A = 0.0040 B = 0.0080 Δ = -0.0040x = 0.92 A = 0.0120 B = 0.0180 Δ = -0.0060x = 0.93 A = 0.0280 B = 0.0340 Δ = -0.0060x = 0.93 A = 0.0260 B = 0.0280 Δ = -0.0020x = 0.94 A = 0.0320 B = 0.0280 Δ = 0.0040x = 0.95 A = 0.0520 B = 0.0640 Δ = -0.0120x = 0.95 A = 0.0680 B = 0.0540 Δ = 0.0140x = 0.96 A = 0.0720 B = 0.0920 Δ = -0.0200x = 0.96 A = 0.0740 B = 0.0900 Δ = -0.0160x = 0.97 A = 0.1220 B = 0.1060 Δ = 0.0160x = 0.97 A = 0.1140 B = 0.1180 Δ = -0.0040x = 0.98 A = 0.1220 B = 0.1160 Δ = 0.0060x = 0.98 A = 0.1260 B = 0.1120 Δ = 0.0140x = 0.99 A = 0.0980 B = 0.0780 Δ = 0.0200x = 1.00 A = 0.0220 B = 0.0260 Δ = -0.0040
phi[1]
reference stan24 bins · 1.45 … 2.15
00.060.060.120.121.5021.82 · 0.1141.75 · 0.120x = 1.45 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.48 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.51 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.54 A = 0.0100 B = 0.0080 Δ = 0.0020x = 1.57 A = 0.0140 B = 0.0140 Δ = 0.0000x = 1.60 A = 0.0260 B = 0.0280 Δ = -0.0020x = 1.63 A = 0.0380 B = 0.0300 Δ = 0.0080x = 1.66 A = 0.0660 B = 0.0620 Δ = 0.0040x = 1.69 A = 0.0680 B = 0.0800 Δ = -0.0120x = 1.73 A = 0.1100 B = 0.1060 Δ = 0.0040x = 1.75 A = 0.0960 B = 0.1200 Δ = -0.0240x = 1.78 A = 0.1100 B = 0.1060 Δ = 0.0040x = 1.82 A = 0.1140 B = 0.1120 Δ = 0.0020x = 1.85 A = 0.1000 B = 0.0960 Δ = 0.0040x = 1.88 A = 0.0840 B = 0.0640 Δ = 0.0200x = 1.91 A = 0.0600 B = 0.0420 Δ = 0.0180x = 1.94 A = 0.0320 B = 0.0600 Δ = -0.0280x = 1.97 A = 0.0300 B = 0.0260 Δ = 0.0040x = 2.00 A = 0.0160 B = 0.0200 Δ = -0.0040x = 2.03 A = 0.0100 B = 0.0080 Δ = 0.0020x = 2.06 A = 0.0120 B = 0.0060 Δ = 0.0060x = 2.09 A = 0.0020 B = 0.0040 Δ = -0.0020x = 2.12 A = 0.0000 B = 0.0000 Δ = 0.0000x = 2.15 A = 0.0020 B = 0.0040 Δ = -0.0020
phi[2]
reference stan24 bins · 4.82 … 8.64
00.050.050.100.10686.81 · 0.1046.48 · 0.104x = 4.82 A = 0.0020 B = 0.0020 Δ = 0.0000x = 4.98 A = 0.0000 B = 0.0000 Δ = 0.0000x = 5.15 A = 0.0020 B = 0.0040 Δ = -0.0020x = 5.31 A = 0.0020 B = 0.0100 Δ = -0.0080x = 5.48 A = 0.0020 B = 0.0060 Δ = -0.0040x = 5.65 A = 0.0300 B = 0.0280 Δ = 0.0020x = 5.81 A = 0.0380 B = 0.0420 Δ = -0.0040x = 5.98 A = 0.0660 B = 0.0420 Δ = 0.0240x = 6.15 A = 0.0620 B = 0.0480 Δ = 0.0140x = 6.31 A = 0.0780 B = 0.1000 Δ = -0.0220x = 6.48 A = 0.0960 B = 0.1040 Δ = -0.0080x = 6.64 A = 0.1000 B = 0.1020 Δ = -0.0020x = 6.81 A = 0.1040 B = 0.0980 Δ = 0.0060x = 6.98 A = 0.0940 B = 0.0900 Δ = 0.0040x = 7.14 A = 0.0920 B = 0.0820 Δ = 0.0100x = 7.31 A = 0.0600 B = 0.0600 Δ = 0.0000x = 7.48 A = 0.0440 B = 0.0580 Δ = -0.0140x = 7.64 A = 0.0500 B = 0.0540 Δ = -0.0040x = 7.81 A = 0.0500 B = 0.0280 Δ = 0.0220x = 7.97 A = 0.0120 B = 0.0200 Δ = -0.0080x = 8.14 A = 0.0040 B = 0.0120 Δ = -0.0080x = 8.31 A = 0.0040 B = 0.0020 Δ = 0.0020x = 8.47 A = 0.0040 B = 0.0060 Δ = -0.0020x = 8.64 A = 0.0040 B = 0.0020 Δ = 0.0020
lambda[1]
reference stan11 bins · 0.02 … 0.03
00.120.120.250.250.023 A = 0.002 B = 0.0020.023 A = 0.002 B = 0.0020.0230.024 A = 0.006 B = 0.0040.024 A = 0.006 B = 0.0040.025 A = 0.030 B = 0.0160.025 A = 0.030 B = 0.0160.0250.026 A = 0.092 B = 0.0860.026 A = 0.092 B = 0.0860.027 A = 0.208 B = 0.1560.027 A = 0.208 B = 0.1560.0270.028 A = 0.226 B = 0.2340.028 A = 0.226 B = 0.2340.029 A = 0.218 B = 0.2460.029 A = 0.218 B = 0.2460.0290.03 A = 0.128 B = 0.1820.03 A = 0.128 B = 0.1820.031 A = 0.056 B = 0.0520.031 A = 0.056 B = 0.0520.0310.032 A = 0.026 B = 0.0160.032 A = 0.026 B = 0.0160.033 A = 0.008 B = 0.0060.033 A = 0.008 B = 0.0060.033
lambda[2]
reference stan24 bins · 0.04 … 0.11
00.090.090.170.170.050.100.07 · 0.1720.08 · 0.132x = 0.04 A = 0.0020 B = 0.0080 Δ = -0.0060x = 0.04 A = 0.0040 B = 0.0100 Δ = -0.0060x = 0.05 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.05 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.05 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.06 A = 0.0060 B = 0.0120 Δ = -0.0060x = 0.06 A = 0.0140 B = 0.0200 Δ = -0.0060x = 0.06 A = 0.0520 B = 0.0360 Δ = 0.0160x = 0.06 A = 0.0380 B = 0.0480 Δ = -0.0100x = 0.07 A = 0.0920 B = 0.1080 Δ = -0.0160x = 0.07 A = 0.1720 B = 0.1280 Δ = 0.0440x = 0.07 A = 0.1520 B = 0.1300 Δ = 0.0220x = 0.08 A = 0.0840 B = 0.1320 Δ = -0.0480x = 0.08 A = 0.1000 B = 0.0980 Δ = 0.0020x = 0.08 A = 0.0520 B = 0.0480 Δ = 0.0040x = 0.09 A = 0.1000 B = 0.1040 Δ = -0.0040x = 0.09 A = 0.0500 B = 0.0420 Δ = 0.0080x = 0.09 A = 0.0320 B = 0.0320 Δ = 0.0000x = 0.09 A = 0.0200 B = 0.0180 Δ = 0.0020x = 0.10 A = 0.0140 B = 0.0060 Δ = 0.0080x = 0.10 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.10 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.11 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.11 A = 0.0020 B = 0.0020 Δ = 0.0000
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0177 ≤ tol 0.0727 · floors 0.0080/0.0307
posteriordb-bball_drive_event_1 / hmm_drive_1
answer record(theta1[1], theta1[2], theta2[1], theta2[2], phi[1], phi[2], lambda[1], lambda[2]) stan pass 0.0008
00 statement source: posteriordb/bball_drive_event_1-hmm_drive_1
given

For each of N time steps the data provide two real-valued observations: u[t], a movement measurement (inverse speed, which can be negative), and v[t], the distance to the hoop. The hidden Markov model has K = 2 states (state 1 = no drive, state 2 = drive). Transitions out of each state are governed by a transition probability vector — theta1 out of state 1 and theta2 out of state 2 — each a probability vector over the K states that sums to 1, with a Dirichlet prior whose concentration parameters are supplied as the rows of a K-by-K positive matrix alpha (row k for transitions out of state k). The per-state emission means are phi[1], phi[2] for u and lambda[1], lambda[2] for v; phi and lambda are each ordered so that phi[1] <= phi[2] and lambda[1] <= lambda[2]. The priors are phi[1] ~ Normal(0, 1), phi[2] ~ Normal(3, 1), lambda[1] ~ Normal(0, 1), and lambda[2] ~ Normal(3, 1). The emission standard deviations are fixed and supplied as data: tau for u and rho for v.

model

The observed sequence is generated by a two-state hidden Markov model. The hidden state at the first time step is equally likely to be either state. At each subsequent step the hidden state transitions from the previous one according to that state's transition vector (theta1 if the previous state was 1, theta2 if it was 2). Given the hidden state k at a time step, the two observations are generated independently and normally: u[t] ~ Normal(phi[k], tau) and v[t] ~ Normal(lambda[k], rho).

query

The marginal posterior distribution of each of the eight parameters: theta1[1], theta1[2] (the probabilities of transitioning from state 1 to states 1 and 2), theta2[1], theta2[2] (from state 2 to states 1 and 2), phi[1], phi[2] (the u-emission means for states 1 and 2, with phi[1] <= phi[2]), and lambda[1], lambda[2] (the v-emission means for states 1 and 2, with lambda[1] <= lambda[2]).

answer spec record(theta1[1], theta1[2], theta2[1], theta2[2], phi[1], phi[2], lambda[1], lambda[2])
{
  "kind": "record",
  "fields": {
    "theta1[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta1[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta2[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta2[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "phi[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "phi[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda[2]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization7.6e-4
stan
1// drive model (normal dist)
2data {
3 int<lower=1> K; // number of states (1 = none, 2 = drive)
4 int<lower=1> N; // length of process
5 array[N] real u; // 1/speed
6 array[N] real v; // hoop distance
7 matrix<lower=0>[K, K] alpha; // transit prior
8 real<lower=0> tau; // sd u
9 real<lower=0> rho; // sd v
10}
11parameters {
12 simplex[K] theta1;
13 simplex[K] theta2;
14 // enforce an ordering: phi[1] <= phi[2]
15 ordered[K] phi; // emission parameter for 1/speed
16 ordered[K] lambda; // emission parameter for hoop dist
17}
18transformed parameters {
19 array[K] simplex[K] theta; // transit probs
20 theta[1] = theta1;
21 theta[2] = theta2;
22}
23model {
24 // priors
25 for (k in 1 : K) {
26 target += dirichlet_lpdf(theta[k] | alpha[k, : ]');
27 }
28 target += normal_lpdf(phi[1] | 0, 1);
29 target += normal_lpdf(phi[2] | 3, 1);
30 target += normal_lpdf(lambda[1] | 0, 1);
31 target += normal_lpdf(lambda[2] | 3, 1);
32 // forward algorithm
33 {
34 array[K] real acc;
35 array[N, K] real gamma;
36 for (k in 1 : K) {
37 gamma[1, k] = normal_lpdf(u[1] | phi[k], tau)
38 + normal_lpdf(v[1] | lambda[k], rho);
39 }
40 for (t in 2 : N) {
41 for (k in 1 : K) {
42 for (j in 1 : K) {
43 acc[j] = gamma[t - 1, j] + log(theta[j, k])
44 + normal_lpdf(u[t] | phi[k], tau)
45 + normal_lpdf(v[t] | lambda[k], rho);
46 }
47 gamma[t, k] = log_sum_exp(acc);
48 }
49 }
50 target += log_sum_exp(gamma[N]);
51 }
52}
53generated quantities {
54 array[N] int<lower=1, upper=K> z_star;
55 real log_p_z_star;
56 // Viterbi algorithm
57 {
58 array[N, K] int back_ptr;
59 array[N, K] real best_logp;
60 for (k in 1 : K) {
61 best_logp[1, K] = normal_lpdf(u[1] | phi[k], tau)
62 + normal_lpdf(v[1] | lambda[k], rho);
63 }
64 for (t in 2 : N) {
65 for (k in 1 : K) {
66 best_logp[t, k] = negative_infinity();
67 for (j in 1 : K) {
68 real logp;
69 logp = best_logp[t - 1, j] + log(theta[j, k])
70 + normal_lpdf(u[t] | phi[k], tau)
71 + normal_lpdf(v[t] | lambda[k], rho);
72 if (logp > best_logp[t, k]) {
73 back_ptr[t, k] = j;
74 best_logp[t, k] = logp;
75 }
76 }
77 }
78 }
79 log_p_z_star = max(best_logp[N]);
80 for (k in 1 : K) {
81 if (best_logp[N, k] == log_p_z_star) {
82 z_star[N] = k;
83 }
84 }
85 for (t in 1 : (N - 1)) {
86 z_star[N - t] = back_ptr[N - t + 1, z_star[N - t + 1]];
87 }
88 }
89}
90
91//@ DATA { N: 416, K: 2, u: [416 values], v: [416 values], alpha: [2×2 matrix], tau: 0.1, rho: 0.1 } // values supplied at runtime
92//@ PARAMS ["theta1[1]","theta1[2]","theta2[1]","theta2[2]","phi[1]","phi[2]","lambda[1]","lambda[2]"]
93//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
94
02answer overlay — reference vs stanrecord(theta1[1], theta1[2], theta2[1], theta2[2], phi[1], phi[2], lambda[1], lambda[2])
theta1[1]
reference stan24 bins · 0.86 … 1.00
00.080.080.160.160.900.950.98 · 0.1420.97 · 0.158x = 0.86 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.87 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.88 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.88 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.89 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.89 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.90 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.90 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.91 A = 0.0100 B = 0.0120 Δ = -0.0020x = 0.92 A = 0.0080 B = 0.0060 Δ = 0.0020x = 0.92 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.93 A = 0.0120 B = 0.0160 Δ = -0.0040x = 0.93 A = 0.0260 B = 0.0120 Δ = 0.0140x = 0.94 A = 0.0300 B = 0.0280 Δ = 0.0020x = 0.94 A = 0.0320 B = 0.0480 Δ = -0.0160x = 0.95 A = 0.0640 B = 0.0420 Δ = 0.0220x = 0.96 A = 0.0880 B = 0.0920 Δ = -0.0040x = 0.96 A = 0.1020 B = 0.1140 Δ = -0.0120x = 0.97 A = 0.1260 B = 0.0940 Δ = 0.0320x = 0.97 A = 0.1400 B = 0.1580 Δ = -0.0180x = 0.98 A = 0.1420 B = 0.1360 Δ = 0.0060x = 0.98 A = 0.0940 B = 0.1140 Δ = -0.0200x = 0.99 A = 0.0920 B = 0.0840 Δ = 0.0080x = 1.00 A = 0.0240 B = 0.0260 Δ = -0.0020
theta1[2]
reference stan24 bins · 0.00 … 0.14
00.080.080.160.160.050.100.02 · 0.1420.03 · 0.158x = 0.00 A = 0.0240 B = 0.0260 Δ = -0.0020x = 0.01 A = 0.0920 B = 0.0840 Δ = 0.0080x = 0.02 A = 0.0940 B = 0.1140 Δ = -0.0200x = 0.02 A = 0.1420 B = 0.1360 Δ = 0.0060x = 0.03 A = 0.1400 B = 0.1580 Δ = -0.0180x = 0.03 A = 0.1340 B = 0.1180 Δ = 0.0160x = 0.04 A = 0.0940 B = 0.0900 Δ = 0.0040x = 0.04 A = 0.0880 B = 0.0920 Δ = -0.0040x = 0.05 A = 0.0660 B = 0.0460 Δ = 0.0200x = 0.06 A = 0.0300 B = 0.0440 Δ = -0.0140x = 0.06 A = 0.0300 B = 0.0280 Δ = 0.0020x = 0.07 A = 0.0180 B = 0.0080 Δ = 0.0100x = 0.07 A = 0.0200 B = 0.0200 Δ = -0.0000x = 0.08 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.08 A = 0.0080 B = 0.0060 Δ = 0.0020x = 0.09 A = 0.0100 B = 0.0120 Δ = -0.0020x = 0.10 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.10 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.11 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.11 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.12 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.12 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.13 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.14 A = 0.0000 B = 0.0040 Δ = -0.0040
theta2[1]
reference stan24 bins · 0.00 … 0.03
00.100.100.190.190.020.01 · 0.1620.01 · 0.190x = 0.00 A = 0.0400 B = 0.0420 Δ = -0.0020x = 0.00 A = 0.0720 B = 0.0500 Δ = 0.0220x = 0.00 A = 0.0740 B = 0.0940 Δ = -0.0200x = 0.01 A = 0.1620 B = 0.1900 Δ = -0.0280x = 0.01 A = 0.0720 B = 0.0940 Δ = -0.0220x = 0.01 A = 0.0980 B = 0.0720 Δ = 0.0260x = 0.01 A = 0.1340 B = 0.1400 Δ = -0.0060x = 0.01 A = 0.0860 B = 0.0540 Δ = 0.0320x = 0.01 A = 0.0420 B = 0.0500 Δ = -0.0080x = 0.01 A = 0.0560 B = 0.0800 Δ = -0.0240x = 0.01 A = 0.0380 B = 0.0280 Δ = 0.0100x = 0.02 A = 0.0360 B = 0.0200 Δ = 0.0160x = 0.02 A = 0.0460 B = 0.0300 Δ = 0.0160x = 0.02 A = 0.0080 B = 0.0100 Δ = -0.0020x = 0.02 A = 0.0120 B = 0.0080 Δ = 0.0040x = 0.02 A = 0.0160 B = 0.0140 Δ = 0.0020x = 0.02 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.02 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.03 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.03 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.03 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.03 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.03 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.03 A = 0.0020 B = 0.0000 Δ = 0.0020
theta2[2]
reference stan24 bins · 0.97 … 1.00
00.090.090.170.170.980.99 · 0.1701.00 · 0.172x = 0.97 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.97 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.97 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.97 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.97 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.97 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.98 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.98 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.98 A = 0.0100 B = 0.0040 Δ = 0.0060x = 0.98 A = 0.0180 B = 0.0180 Δ = 0.0000x = 0.98 A = 0.0080 B = 0.0100 Δ = -0.0020x = 0.98 A = 0.0280 B = 0.0160 Δ = 0.0120x = 0.98 A = 0.0540 B = 0.0340 Δ = 0.0200x = 0.98 A = 0.0380 B = 0.0280 Δ = 0.0100x = 0.99 A = 0.0260 B = 0.0320 Δ = -0.0060x = 0.99 A = 0.0720 B = 0.0980 Δ = -0.0260x = 0.99 A = 0.0860 B = 0.0540 Δ = 0.0320x = 0.99 A = 0.0620 B = 0.0740 Δ = -0.0120x = 0.99 A = 0.1700 B = 0.1380 Δ = 0.0320x = 0.99 A = 0.0720 B = 0.0940 Δ = -0.0220x = 0.99 A = 0.0800 B = 0.1120 Δ = -0.0320x = 1.00 A = 0.1560 B = 0.1720 Δ = -0.0160x = 1.00 A = 0.0720 B = 0.0500 Δ = 0.0220x = 1.00 A = 0.0400 B = 0.0420 Δ = -0.0020
phi[1]
reference stan24 bins · -2.38 … -2.32
00.090.090.180.18-2.35-2.34 · 0.176-2.35 · 0.124x = -2.38 A = 0.0020 B = 0.0000 Δ = 0.0020x = -2.38 A = 0.0000 B = 0.0000 Δ = 0.0000x = -2.38 A = 0.0000 B = 0.0020 Δ = -0.0020x = -2.38 A = 0.0000 B = 0.0020 Δ = -0.0020x = -2.37 A = 0.0000 B = 0.0020 Δ = -0.0020x = -2.37 A = 0.0060 B = 0.0020 Δ = 0.0040x = -2.37 A = 0.0140 B = 0.0120 Δ = 0.0020x = -2.36 A = 0.0120 B = 0.0200 Δ = -0.0080x = -2.36 A = 0.0400 B = 0.0440 Δ = -0.0040x = -2.36 A = 0.0500 B = 0.0620 Δ = -0.0120x = -2.35 A = 0.0880 B = 0.1000 Δ = -0.0120x = -2.35 A = 0.0620 B = 0.0740 Δ = -0.0120x = -2.35 A = 0.0900 B = 0.1000 Δ = -0.0100x = -2.35 A = 0.1100 B = 0.1240 Δ = -0.0140x = -2.34 A = 0.1760 B = 0.1100 Δ = 0.0660x = -2.34 A = 0.0460 B = 0.0660 Δ = -0.0200x = -2.34 A = 0.0920 B = 0.0800 Δ = 0.0120x = -2.33 A = 0.0700 B = 0.0560 Δ = 0.0140x = -2.33 A = 0.0820 B = 0.0580 Δ = 0.0240x = -2.33 A = 0.0160 B = 0.0200 Δ = -0.0040x = -2.32 A = 0.0200 B = 0.0420 Δ = -0.0220x = -2.32 A = 0.0120 B = 0.0160 Δ = -0.0040x = -2.32 A = 0.0100 B = 0.0060 Δ = 0.0040x = -2.32 A = 0.0020 B = 0.0020 Δ = 0.0000
phi[2]
reference stan24 bins · -0.76 … -0.73
00.080.080.160.16-0.76-0.74-0.75 · 0.150-0.74 · 0.160x = -0.76 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.76 A = 0.0060 B = 0.0020 Δ = 0.0040x = -0.76 A = 0.0060 B = 0.0080 Δ = -0.0020x = -0.76 A = 0.0020 B = 0.0140 Δ = -0.0120x = -0.75 A = 0.0200 B = 0.0280 Δ = -0.0080x = -0.75 A = 0.0200 B = 0.0140 Δ = 0.0060x = -0.75 A = 0.0120 B = 0.0200 Δ = -0.0080x = -0.75 A = 0.0860 B = 0.0520 Δ = 0.0340x = -0.75 A = 0.0580 B = 0.0640 Δ = -0.0060x = -0.75 A = 0.1500 B = 0.0980 Δ = 0.0520x = -0.75 A = 0.0800 B = 0.0760 Δ = 0.0040x = -0.74 A = 0.0620 B = 0.0880 Δ = -0.0260x = -0.74 A = 0.1360 B = 0.1600 Δ = -0.0240x = -0.74 A = 0.0500 B = 0.0700 Δ = -0.0200x = -0.74 A = 0.0980 B = 0.0960 Δ = 0.0020x = -0.74 A = 0.0460 B = 0.0560 Δ = -0.0100x = -0.74 A = 0.0820 B = 0.0660 Δ = 0.0160x = -0.74 A = 0.0180 B = 0.0240 Δ = -0.0060x = -0.73 A = 0.0240 B = 0.0200 Δ = 0.0040x = -0.73 A = 0.0220 B = 0.0280 Δ = -0.0060x = -0.73 A = 0.0040 B = 0.0060 Δ = -0.0020x = -0.73 A = 0.0100 B = 0.0040 Δ = 0.0060x = -0.73 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.73 A = 0.0000 B = 0.0040 Δ = -0.0040
lambda[1]
reference stan24 bins · 2.38 … 2.46
00.070.070.140.142.402.452.43 · 0.1322.43 · 0.142x = 2.38 A = 0.0020 B = 0.0000 Δ = 0.0020x = 2.39 A = 0.0000 B = 0.0020 Δ = -0.0020x = 2.39 A = 0.0000 B = 0.0000 Δ = 0.0000x = 2.39 A = 0.0040 B = 0.0000 Δ = 0.0040x = 2.40 A = 0.0040 B = 0.0060 Δ = -0.0020x = 2.40 A = 0.0080 B = 0.0020 Δ = 0.0060x = 2.40 A = 0.0140 B = 0.0160 Δ = -0.0020x = 2.41 A = 0.0300 B = 0.0200 Δ = 0.0100x = 2.41 A = 0.0480 B = 0.0420 Δ = 0.0060x = 2.41 A = 0.0680 B = 0.0460 Δ = 0.0220x = 2.42 A = 0.0940 B = 0.1040 Δ = -0.0100x = 2.42 A = 0.1000 B = 0.0960 Δ = 0.0040x = 2.43 A = 0.1000 B = 0.0960 Δ = 0.0040x = 2.43 A = 0.1320 B = 0.1420 Δ = -0.0100x = 2.43 A = 0.1060 B = 0.1060 Δ = -0.0000x = 2.44 A = 0.1120 B = 0.1360 Δ = -0.0240x = 2.44 A = 0.0460 B = 0.0600 Δ = -0.0140x = 2.44 A = 0.0600 B = 0.0580 Δ = 0.0020x = 2.45 A = 0.0220 B = 0.0340 Δ = -0.0120x = 2.45 A = 0.0140 B = 0.0140 Δ = 0.0000x = 2.45 A = 0.0180 B = 0.0100 Δ = 0.0080x = 2.46 A = 0.0140 B = 0.0060 Δ = 0.0080x = 2.46 A = 0.0020 B = 0.0000 Δ = 0.0020x = 2.46 A = 0.0020 B = 0.0040 Δ = -0.0020
lambda[2]
reference stan24 bins · 3.53 … 3.56
00.070.070.150.153.543.563.54 · 0.1503.54 · 0.138x = 3.53 A = 0.0060 B = 0.0040 Δ = 0.0020x = 3.53 A = 0.0060 B = 0.0040 Δ = 0.0020x = 3.53 A = 0.0060 B = 0.0220 Δ = -0.0160x = 3.53 A = 0.0100 B = 0.0160 Δ = -0.0060x = 3.53 A = 0.0440 B = 0.0440 Δ = 0.0000x = 3.53 A = 0.0180 B = 0.0340 Δ = -0.0160x = 3.54 A = 0.0540 B = 0.0280 Δ = 0.0260x = 3.54 A = 0.1180 B = 0.0840 Δ = 0.0340x = 3.54 A = 0.0560 B = 0.0760 Δ = -0.0200x = 3.54 A = 0.1260 B = 0.1240 Δ = 0.0020x = 3.54 A = 0.0540 B = 0.0740 Δ = -0.0200x = 3.54 A = 0.0740 B = 0.0700 Δ = 0.0040x = 3.54 A = 0.1500 B = 0.1380 Δ = 0.0120x = 3.55 A = 0.0480 B = 0.0460 Δ = 0.0020x = 3.55 A = 0.1120 B = 0.0920 Δ = 0.0200x = 3.55 A = 0.0400 B = 0.0420 Δ = -0.0020x = 3.55 A = 0.0300 B = 0.0540 Δ = -0.0240x = 3.55 A = 0.0140 B = 0.0180 Δ = -0.0040x = 3.55 A = 0.0100 B = 0.0180 Δ = -0.0080x = 3.55 A = 0.0120 B = 0.0100 Δ = 0.0020x = 3.56 A = 0.0060 B = 0.0020 Δ = 0.0040x = 3.56 A = 0.0020 B = 0.0000 Δ = 0.0020x = 3.56 A = 0.0020 B = 0.0000 Δ = 0.0020x = 3.56 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0008 ≤ tol 0.0026 · floors 0.0012/0.0013
posteriordb-bones_data / bones_model
answer record(theta[1], theta[2], theta[3], theta[4], theta[5], theta[6], theta[7], theta[8], theta[9], theta[10], theta[11], theta[12], theta[13]) stan pass 0.0405
00 statement source: posteriordb/bones_data-bones_model
given

Skeletal age is to be inferred for nChild = 13 children using nInd = 34 skeletal maturity indicators. For each indicator j (j = 1..34), the data provide: a discrimination parameter delta_j (a positive real), and up to 4 ordered threshold parameters gamma[j,1], ..., gamma[j, ncat_j - 1] (real-valued; -1 indicates missing). The number of ordered categories for indicator j is ncat_j (provided as data). Each child i's observed grade on indicator j is grade[i,j], an integer in {1, ..., ncat_j}, with -1 indicating a missing observation. The latent age theta_i for child i has a Normal(mean 0, sd 36) prior.

model

Each child i has an unknown latent skeletal age theta_i. For each non-missing observation of indicator j on child i, the cumulative probability of exceeding grade category k (for k = 1, ..., ncat_j - 1) is inv_logit(delta_j * (theta_i - gamma[j,k])). The probability of observing each grade category is derived from these cumulative probabilities: P(grade = 1) = 1 - Q_{j,1}, P(grade = k) = Q_{j,k-1} - Q_{j,k} for k = 2, ..., ncat_j - 1, and P(grade = ncat_j) = Q_{j, ncat_j - 1}, where Q_{j,k} = inv_logit(delta_j * (theta_i - gamma[j,k])). Missing grade observations contribute nothing to the likelihood.

query

The marginal posterior distribution of each parameter given the data: the latent skeletal ages theta_1, ..., theta_13 (one per child).

answer spec record(theta[1], theta[2], theta[3], theta[4], theta[5], theta[6], theta[7], theta[8], theta[9], theta[10], theta[11], theta[12], theta[13])
{
  "kind": "record",
  "fields": {
    "theta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[13]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.041
stan
1/*
2 * Note:
3 * 1. Since it is just the response that is
4 * modelled as categorical distribution,
5 * we should be able to run the model now except handling
6 * the missing. However, the data structure is a bit
7 * difficult to deal with (Allowing some redundancy
8 * in the transformed parameters (Q here), the model
9 * is fine in Stan.
10 * 2. The missing data is recoded as `-1`, which is
11 * not modeled for `gamma` as in the OpenBUGS example
12 * and not modeled for `grade`.
13 */
14
15data {
16 int<lower=0> nChild;
17 int<lower=0> nInd;
18 array[nInd, 4] real gamma; // -1 if missing
19 array[nInd] real delta;
20 array[nInd] int<lower=0> ncat;
21 array[nChild, nInd] int grade; // -1 if missing
22}
23parameters {
24 array[nChild] real theta;
25}
26model {
27 array[nChild, nInd, 5] real p;
28 array[nChild, nInd, 4] real Q;
29 theta ~ normal(0.0, 36);
30 for (i in 1 : nChild) {
31 // Probability of observing grade k given theta
32 for (j in 1 : nInd) {
33 // Cumulative probability of > grade k given theta
34 for (k in 1 : (ncat[j] - 1)) {
35 Q[i, j, k] = inv_logit(delta[j] * (theta[i] - gamma[j, k]));
36 }
37 p[i, j, 1] = 1 - Q[i, j, 1];
38 for (k in 2 : (ncat[j] - 1)) {
39 p[i, j, k] = Q[i, j, k - 1] - Q[i, j, k];
40 }
41 p[i, j, ncat[j]] = Q[i, j, ncat[j] - 1];
42
43 // incement log probability directly because grade[i, j]
44 // has categorical distribution with varying dimension.
45 // for missing grade[i, j] = -1, there is no log prob
46 // contribution
47 if (grade[i, j] != -1) {
48 target += log(p[i, j, grade[i, j]]);
49 }
50 }
51 }
52}
53
54//@ DATA { ncat: [34 values], nChild: 13, nInd: 34, grade: [13×34 matrix], delta: [34 values], gamma: [34×4 matrix] } // values supplied at runtime
55//@ PARAMS ["theta[1]","theta[2]","theta[3]","theta[4]","theta[5]","theta[6]","theta[7]","theta[8]","theta[9]","theta[10]","theta[11]","theta[12]","theta[13]"]
56//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
57
02answer overlay — reference vs stanrecord(theta[1], theta[2], theta[3], theta[4], theta[5], theta[6], theta[7], theta[8], theta[9], theta[10], theta[11], theta[12], theta[13])
parameterreference mean±sdstan mean±sd
theta[1]0.338 ± 0.204
theta[2]1.37 ± 0.255
theta[3]2.35 ± 0.267
theta[4]2.91 ± 0.291
theta[5]5.57 ± 0.513
theta[6]6.70 ± 0.584
theta[7]6.49 ± 0.585
theta[8]8.92 ± 0.708
theta[9]8.95 ± 0.627
theta[10]11.97 ± 0.661
theta[11]11.53 ± 0.889
theta[12]15.80 ± 0.557
theta[13]17.00 ± 0.741
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0405 ≤ tol 0.2048 · floors 0.0400/0.0794
posteriordb-diamonds / diamonds
answer record(b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20], b[21], b[22], b[23], b[24], Intercept, sigma) stan pass 0.0141
00 statement source: posteriordb/diamonds-diamonds
given

For N observations of diamonds, the data provide a response variable Y containing log-transformed prices and a design matrix X with N rows and K = 25 columns. The first column of X is all 1s (for the intercept). The remaining 24 columns contain numerical and categorical predictor variables. The model centers these 24 predictors by subtracting each column's mean. A binary flag prior_only indicates whether the likelihood should be ignored (prior-only inference). The 24 regression coefficients b[1] through b[24] have independent standard Normal(0, 1) priors. The intercept parameter has a Student-t prior with 3 degrees of freedom, location 8, and scale 10. The residual standard deviation sigma, constrained positive, has a half-Student-t prior with 3 degrees of freedom, location 0, and scale 10 (a Student-t(3, 0, 10) prior truncated to the positive reals).

model

Each observation's log price is normally distributed with a mean equal to the intercept plus a linear combination of the 24 centered predictors weighted by their respective coefficients, and a common standard deviation sigma across all observations. The centering of predictors is performed by subtracting each predictor's column mean from all observations before forming the linear predictor. This results in the intercept representing the expected log price when all centered predictors are at zero, which corresponds to the predictors being at their observed column means.

query

The marginal posterior distributions of the 26 parameters: the 24 centered predictor coefficients b[1], b[2], ..., b[24], the intercept (reported as Intercept), and the residual standard deviation sigma.

answer spec record(b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20], b[21], b[22], b[23], b[24], Intercept, sigma)
{
  "kind": "record",
  "fields": {
    "b[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "Intercept": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.014
stan
1// generated with brms 2.10.0
2
3functions {
4
5}
6data {
7 int<lower=1> N; // number of observations
8 vector[N] Y; // response variable
9 int<lower=1> K; // number of population-level effects
10 matrix[N, K] X; // population-level design matrix
11 int prior_only; // should the likelihood be ignored?
12}
13transformed data {
14 int Kc = K - 1;
15 matrix[N, Kc] Xc; // centered version of X without an intercept
16 vector[Kc] means_X; // column means of X before centering
17 for (i in 2 : K) {
18 means_X[i - 1] = mean(X[ : , i]);
19 Xc[ : , i - 1] = X[ : , i] - means_X[i - 1];
20 }
21}
22parameters {
23 vector[Kc] b; // population-level effects
24 // temporary intercept for centered predictors
25 real Intercept;
26 real<lower=0> sigma; // residual SD
27}
28transformed parameters {
29
30}
31model {
32 // priors including all constants
33 target += normal_lpdf(b | 0, 1);
34 target += student_t_lpdf(Intercept | 3, 8, 10);
35 target += student_t_lpdf(sigma | 3, 0, 10)
36 - 1 * student_t_lccdf(0 | 3, 0, 10);
37 // likelihood including all constants
38 if (!prior_only) {
39 target += normal_id_glm_lpdf(Y | Xc, Intercept, b, sigma);
40 }
41}
42generated quantities {
43 // actual population-level intercept
44 real b_Intercept = Intercept - dot_product(means_X, b);
45}
46
47//@ DATA { N: 5000, Y: [5000 values], K: 25, X: [5000×25 matrix], prior_only: 0 } // values supplied at runtime
48//@ PARAMS ["b[1]","b[2]","b[3]","b[4]","b[5]","b[6]","b[7]","b[8]","b[9]","b[10]","b[11]","b[12]","b[13]","b[14]","b[15]","b[16]","b[17]","b[18]","b[19]","b[20]","b[21]","b[22]","b[23]","b[24]","Intercept","sigma"]
49//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
50
02answer overlay — reference vs stanrecord(b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20], b[21], b[22], b[23], b[24], Intercept, sigma)
parameterreference mean±sdstan mean±sd
b[1]6.64 ± 0.2716.66 ± 0.235
b[2]6.35 ± 0.3226.38 ± 0.304
b[3]-4.67 ± 0.314-4.70 ± 0.302
b[4]1.46 ± 0.1491.44 ± 0.136
b[5]0.134 ± 0.0080.135 ± 0.008
b[6]-0.040 ± 0.007-0.041 ± 0.007
b[7]0.023 ± 0.0060.023 ± 0.006
b[8]0.002 ± 0.0040.002 ± 0.004
b[9]-0.444 ± 0.006-0.445 ± 0.006
b[10]-0.093 ± 0.006-0.093 ± 0.005
b[11]-0.012 ± 0.005-0.013 ± 0.005
b[12]0.011 ± 0.0050.011 ± 0.005
b[13]-0.002 ± 0.005-0.002 ± 0.004
b[14]6.02e-4 ± 0.0049.84e-4 ± 0.004
b[15]0.900 ± 0.0110.901 ± 0.011
b[16]-0.221 ± 0.010-0.221 ± 0.010
b[17]0.131 ± 0.0090.131 ± 0.009
b[18]-0.058 ± 0.007-0.057 ± 0.007
b[19]0.018 ± 0.0050.018 ± 0.006
b[20]-0.002 ± 0.005-0.002 ± 0.005
b[21]0.032 ± 0.0040.032 ± 0.004
b[22]-6.09 ± 0.293-6.12 ± 0.291
b[23]4.62 ± 0.2904.63 ± 0.289
b[24]-1.45 ± 0.149-1.43 ± 0.154
Intercept7.79 ± 0.0027.79 ± 0.002
sigma0.123 ± 0.0010.123 ± 0.001
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0141 ≤ tol 0.0478 · floors 0.0239/0.0236
posteriordb-dogs / dogs
answer record(beta[1], beta[2], beta[3]) stan pass 0.0073
00 statement source: posteriordb/dogs-dogs
given

A shuttle-avoidance experiment was run on 30 dogs over 25 trials each. The binary outcome for dog i on trial t is provided as data, equal to 1 if the dog avoided the shock on that trial and 0 otherwise. Three coefficients beta_1, beta_2, beta_3 each have a Normal(mean 0, sd 100) prior, independently.

model

For each dog and trial, let a be the number of prior trials on which that dog avoided the shock and s be the number of prior trials on which it was shocked (both counted over the earlier trials for that dog, starting at zero on the first trial). The log-odds that the dog avoids on the current trial is beta_1 + beta_2 * a + beta_3 * s. The outcome is drawn from a Bernoulli distribution with that success probability on the log-odds scale.

query

The marginal posterior distribution of each coefficient given the data: beta_1, beta_2, and beta_3.

answer spec record(beta[1], beta[2], beta[3])
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.007
stan
1data {
2 int<lower=0> n_dogs;
3 int<lower=0> n_trials;
4 array[n_dogs, n_trials] int<lower=0, upper=1> y;
5}
6parameters {
7 vector[3] beta;
8}
9transformed parameters {
10 matrix[n_dogs, n_trials] n_avoid;
11 matrix[n_dogs, n_trials] n_shock;
12 matrix[n_dogs, n_trials] p;
13
14 for (j in 1 : n_dogs) {
15 n_avoid[j, 1] = 0;
16 n_shock[j, 1] = 0;
17 for (t in 2 : n_trials) {
18 n_avoid[j, t] = n_avoid[j, t - 1] + 1 - y[j, t - 1];
19 n_shock[j, t] = n_shock[j, t - 1] + y[j, t - 1];
20 }
21 for (t in 1 : n_trials) {
22 p[j, t] = beta[1] + beta[2] * n_avoid[j, t] + beta[3] * n_shock[j, t];
23 }
24 }
25}
26model {
27 beta ~ normal(0, 100);
28 for (i in 1 : n_dogs) {
29 for (j in 1 : n_trials) {
30 y[i, j] ~ bernoulli_logit(p[i, j]);
31 }
32 }
33}
34
35//@ DATA { n_dogs: 30, n_trials: 25, y: [30×25 matrix] } // values supplied at runtime
36//@ PARAMS ["beta[1]","beta[2]","beta[3]"]
37//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
38
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3])
beta[1]
reference stan24 bins · 1.13 … 2.67
00.060.060.120.1221.67 · 0.122x = 1.13 A = 0.0040 B = 0.0000 Δ = 0.0040x = 1.20 A = 0.0060 B = 0.0000 Δ = 0.0060x = 1.26 A = 0.0040 B = 0.0000 Δ = 0.0040x = 1.33 A = 0.0120 B = 0.0000 Δ = 0.0120x = 1.40 A = 0.0100 B = 0.0000 Δ = 0.0100x = 1.46 A = 0.0480 B = 0.0000 Δ = 0.0480x = 1.53 A = 0.0420 B = 0.0000 Δ = 0.0420x = 1.60 A = 0.0920 B = 0.0000 Δ = 0.0920x = 1.67 A = 0.1220 B = 0.0000 Δ = 0.1220x = 1.73 A = 0.1060 B = 0.0000 Δ = 0.1060x = 1.80 A = 0.0940 B = 0.0000 Δ = 0.0940x = 1.87 A = 0.1200 B = 0.0000 Δ = 0.1200x = 1.93 A = 0.0960 B = 0.0000 Δ = 0.0960x = 2 A = 0.0700 B = 0.0000 Δ = 0.0700x = 2.07 A = 0.0420 B = 0.0000 Δ = 0.0420x = 2.13 A = 0.0540 B = 0.0000 Δ = 0.0540x = 2.20 A = 0.0300 B = 0.0000 Δ = 0.0300x = 2.27 A = 0.0180 B = 0.0000 Δ = 0.0180x = 2.34 A = 0.0160 B = 0.0000 Δ = 0.0160x = 2.40 A = 0.0080 B = 0.0000 Δ = 0.0080x = 2.47 A = 0.0040 B = 0.0000 Δ = 0.0040x = 2.54 A = 0.0000 B = 0.0000 Δ = 0.0000x = 2.60 A = 0.0000 B = 0.0000 Δ = 0.0000x = 2.67 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[2]
reference stan24 bins · -0.48 … -0.27
00.050.050.100.10-0.40-0.30-0.37 · 0.102x = -0.48 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.47 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.46 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.45 A = 0.0060 B = 0.0000 Δ = 0.0060x = -0.44 A = 0.0080 B = 0.0000 Δ = 0.0080x = -0.43 A = 0.0160 B = 0.0000 Δ = 0.0160x = -0.42 A = 0.0260 B = 0.0000 Δ = 0.0260x = -0.42 A = 0.0240 B = 0.0000 Δ = 0.0240x = -0.41 A = 0.0480 B = 0.0000 Δ = 0.0480x = -0.40 A = 0.0620 B = 0.0000 Δ = 0.0620x = -0.39 A = 0.0780 B = 0.0000 Δ = 0.0780x = -0.38 A = 0.0700 B = 0.0000 Δ = 0.0700x = -0.37 A = 0.1020 B = 0.0000 Δ = 0.1020x = -0.36 A = 0.0720 B = 0.0000 Δ = 0.0720x = -0.35 A = 0.0960 B = 0.0000 Δ = 0.0960x = -0.34 A = 0.0880 B = 0.0000 Δ = 0.0880x = -0.33 A = 0.0760 B = 0.0000 Δ = 0.0760x = -0.33 A = 0.0540 B = 0.0000 Δ = 0.0540x = -0.32 A = 0.0640 B = 0.0000 Δ = 0.0640x = -0.31 A = 0.0360 B = 0.0000 Δ = 0.0360x = -0.30 A = 0.0320 B = 0.0000 Δ = 0.0320x = -0.29 A = 0.0200 B = 0.0000 Δ = 0.0200x = -0.28 A = 0.0140 B = 0.0000 Δ = 0.0140x = -0.27 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[3]
reference stan24 bins · -0.35 … -0.09
00.050.050.110.11-0.30-0.20-0.10-0.20 · 0.106x = -0.35 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.34 A = 0.0060 B = 0.0000 Δ = 0.0060x = -0.33 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.32 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.30 A = 0.0140 B = 0.0000 Δ = 0.0140x = -0.29 A = 0.0180 B = 0.0000 Δ = 0.0180x = -0.28 A = 0.0240 B = 0.0000 Δ = 0.0240x = -0.27 A = 0.0160 B = 0.0000 Δ = 0.0160x = -0.26 A = 0.0540 B = 0.0000 Δ = 0.0540x = -0.25 A = 0.0860 B = 0.0000 Δ = 0.0860x = -0.24 A = 0.0880 B = 0.0000 Δ = 0.0880x = -0.23 A = 0.1040 B = 0.0000 Δ = 0.1040x = -0.21 A = 0.0840 B = 0.0000 Δ = 0.0840x = -0.20 A = 0.1060 B = 0.0000 Δ = 0.1060x = -0.19 A = 0.0980 B = 0.0000 Δ = 0.0980x = -0.18 A = 0.0700 B = 0.0000 Δ = 0.0700x = -0.17 A = 0.0860 B = 0.0000 Δ = 0.0860x = -0.16 A = 0.0520 B = 0.0000 Δ = 0.0520x = -0.15 A = 0.0400 B = 0.0000 Δ = 0.0400x = -0.14 A = 0.0200 B = 0.0000 Δ = 0.0200x = -0.13 A = 0.0060 B = 0.0000 Δ = 0.0060x = -0.11 A = 0.0120 B = 0.0000 Δ = 0.0120x = -0.10 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.09 A = 0.0040 B = 0.0000 Δ = 0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0073 ≤ tol 0.0429 · floors 0.0139/0.0135
posteriordb-dogs / dogs_hierarchical
answer record(a, b) stan pass 0.0007
00 statement source: posteriordb/dogs-dogs_hierarchical
given

A shuttle-avoidance experiment was run on 30 dogs over 25 trials each. The binary outcome for dog j on trial t is provided as data, equal to 1 if the dog avoided the shock on that trial and 0 otherwise. The avoidance-decay parameter a lies in (0, 1) with a Uniform(0, 1) prior. The shock-sensitivity parameter b lies in (0, 1) with a Uniform(0, 1) prior.

model

For each dog j and trial t, let s be the number of prior trials on which that dog was shocked and v the number on which it avoided (both counted over the earlier trials for that dog, starting at zero on the first trial). The probability that the dog avoids on the current trial is a raised to the power s, times b raised to the power v. The outcome is drawn from a Bernoulli distribution with that probability.

query

The marginal posterior distribution of each parameter given the data: the avoidance-decay parameter a and the shock-sensitivity parameter b.

answer spec record(a, b)
{
  "kind": "record",
  "fields": {
    "a": {
      "kind": "dist",
      "domain": "real"
    },
    "b": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization6.9e-4
stan
1data {
2 int<lower=0> n_dogs;
3 int<lower=0> n_trials;
4 array[n_dogs, n_trials] int<lower=0, upper=1> y;
5}
6transformed data {
7 int<lower=0> J = n_dogs;
8 int<lower=0> T = n_trials;
9 matrix<lower=0>[J, T] prev_shock;
10 matrix<lower=0>[J, T] prev_avoid;
11
12 for (j in 1 : J) {
13 prev_shock[j, 1] = 0;
14 prev_avoid[j, 1] = 0;
15 for (t in 2 : T) {
16 prev_shock[j, t] = prev_shock[j, t - 1] + y[j, t - 1];
17 prev_avoid[j, t] = prev_avoid[j, t - 1] + 1 - y[j, t - 1];
18 }
19 }
20}
21parameters {
22 real<lower=0, upper=1> a;
23 real<lower=0, upper=1> b;
24}
25model {
26 for (j in 1 : J) {
27 for (t in 1 : T) {
28 real p = a ^ prev_shock[j, t] * b ^ prev_avoid[j, t];
29 y[j, t] ~ bernoulli(p);
30 }
31 }
32}
33generated quantities {
34 array[n_dogs, n_trials] int<lower=0, upper=1> y_rep;
35 {
36 real prev_shock_rep;
37 real prev_avoid_rep;
38 real p_rep;
39 for (j in 1 : J) {
40 prev_shock_rep = 0;
41 prev_avoid_rep = 0;
42 y_rep[j, 1] = 1;
43 for (t in 2 : T) {
44 prev_shock_rep = prev_shock_rep + y_rep[j, t - 1];
45 prev_avoid_rep = prev_avoid_rep + 1 - y_rep[j, t - 1];
46 p_rep = a ^ prev_shock_rep * b ^ prev_avoid_rep;
47 y_rep[j, t] = bernoulli_rng(p_rep);
48 }
49 }
50 }
51}
52
53//@ DATA { n_dogs: 30, n_trials: 25, y: [30×25 matrix] } // values supplied at runtime
54//@ PARAMS ["a","b"]
55//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
56
02answer overlay — reference vs stanrecord(a, b)
a
reference stan24 bins · 0.89 … 0.95
00.060.060.110.110.900.950.93 · 0.114x = 0.89 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.89 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.89 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.90 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.90 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.90 A = 0.0160 B = 0.0000 Δ = 0.0160x = 0.91 A = 0.0360 B = 0.0000 Δ = 0.0360x = 0.91 A = 0.0380 B = 0.0000 Δ = 0.0380x = 0.91 A = 0.0460 B = 0.0000 Δ = 0.0460x = 0.91 A = 0.0860 B = 0.0000 Δ = 0.0860x = 0.92 A = 0.0760 B = 0.0000 Δ = 0.0760x = 0.92 A = 0.0800 B = 0.0000 Δ = 0.0800x = 0.92 A = 0.1000 B = 0.0000 Δ = 0.1000x = 0.93 A = 0.1140 B = 0.0000 Δ = 0.1140x = 0.93 A = 0.0980 B = 0.0000 Δ = 0.0980x = 0.93 A = 0.1000 B = 0.0000 Δ = 0.1000x = 0.93 A = 0.0660 B = 0.0000 Δ = 0.0660x = 0.94 A = 0.0480 B = 0.0000 Δ = 0.0480x = 0.94 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.94 A = 0.0180 B = 0.0000 Δ = 0.0180x = 0.95 A = 0.0140 B = 0.0000 Δ = 0.0140x = 0.95 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.95 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.95 A = 0.0040 B = 0.0000 Δ = 0.0040
b
reference stan24 bins · 0.73 … 0.85
00.060.060.120.120.750.800.79 · 0.118x = 0.73 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.73 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.74 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.74 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.75 A = 0.0180 B = 0.0000 Δ = 0.0180x = 0.75 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.76 A = 0.0300 B = 0.0000 Δ = 0.0300x = 0.76 A = 0.0420 B = 0.0000 Δ = 0.0420x = 0.77 A = 0.0760 B = 0.0000 Δ = 0.0760x = 0.77 A = 0.0760 B = 0.0000 Δ = 0.0760x = 0.78 A = 0.1040 B = 0.0000 Δ = 0.1040x = 0.78 A = 0.0800 B = 0.0000 Δ = 0.0800x = 0.79 A = 0.1180 B = 0.0000 Δ = 0.1180x = 0.79 A = 0.0880 B = 0.0000 Δ = 0.0880x = 0.80 A = 0.0920 B = 0.0000 Δ = 0.0920x = 0.80 A = 0.0760 B = 0.0000 Δ = 0.0760x = 0.81 A = 0.0680 B = 0.0000 Δ = 0.0680x = 0.81 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.82 A = 0.0200 B = 0.0000 Δ = 0.0200x = 0.83 A = 0.0220 B = 0.0000 Δ = 0.0220x = 0.83 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.84 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.84 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.85 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0007 ≤ tol 0.0039 · floors 0.0013/0.0010
posteriordb-dogs / dogs_log
answer record(beta[1], beta[2]) stan pass 0.0017
00 statement source: posteriordb/dogs-dogs_log
given

A shuttle-avoidance experiment was run on 30 dogs over 25 trials each. The binary outcome for dog i on trial t is provided as data, equal to 1 if the dog avoided the shock on that trial and 0 otherwise. The coefficient beta_1 has a Uniform(-100, 0) prior and the coefficient beta_2 has a Uniform(0, 100) prior.

model

For each dog and trial, let a be the number of prior trials on which that dog avoided the shock and s be the number of prior trials on which it was shocked (both counted over the earlier trials for that dog, starting at zero on the first trial). The probability that the dog avoids on the current trial is the inverse-logit of beta_1 * a + beta_2 * s. The outcome is drawn from a Bernoulli distribution with that probability.

query

The marginal posterior distribution of each coefficient given the data: beta_1 and beta_2.

answer spec record(beta[1], beta[2])
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.002
stan
1data {
2 int<lower=0> n_trials;
3 int<lower=0> n_dogs;
4 array[n_dogs, n_trials] int<lower=0, upper=1> y;
5}
6parameters {
7 vector[2] beta;
8}
9transformed parameters {
10 matrix[n_dogs, n_trials] n_avoid;
11 matrix[n_dogs, n_trials] n_shock;
12 matrix[n_dogs, n_trials] p;
13
14 for (j in 1 : n_dogs) {
15 n_avoid[j, 1] = 0;
16 n_shock[j, 1] = 0;
17 for (t in 2 : n_trials) {
18 n_avoid[j, t] = n_avoid[j, t - 1] + 1 - y[j, t - 1];
19 n_shock[j, t] = n_shock[j, t - 1] + y[j, t - 1];
20 }
21 for (t in 1 : n_trials) {
22 p[j, t] = inv_logit(beta[1] * n_avoid[j, t] + beta[2] * n_shock[j, t]);
23 }
24 }
25}
26model {
27 beta[1] ~ uniform(-100, 0);
28 beta[2] ~ uniform(0, 100);
29 for (i in 1 : n_dogs) {
30 for (j in 1 : n_trials) {
31 y[i, j] ~ bernoulli(p[i, j]);
32 }
33 }
34}
35
36//@ DATA { n_dogs: 30, n_trials: 25, y: [30×25 matrix] } // values supplied at runtime
37//@ PARAMS ["beta[1]","beta[2]"]
38//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
39
02answer overlay — reference vs stanrecord(beta[1], beta[2])
beta[1]
reference stan24 bins · -0.48 … -0.25
00.060.060.120.12-0.40-0.30-0.34 · 0.120x = -0.48 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.47 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.46 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.45 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.44 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.43 A = 0.0200 B = 0.0000 Δ = 0.0200x = -0.42 A = 0.0180 B = 0.0000 Δ = 0.0180x = -0.41 A = 0.0420 B = 0.0000 Δ = 0.0420x = -0.40 A = 0.0440 B = 0.0000 Δ = 0.0440x = -0.39 A = 0.0660 B = 0.0000 Δ = 0.0660x = -0.38 A = 0.0840 B = 0.0000 Δ = 0.0840x = -0.37 A = 0.0760 B = 0.0000 Δ = 0.0760x = -0.36 A = 0.0920 B = 0.0000 Δ = 0.0920x = -0.35 A = 0.1060 B = 0.0000 Δ = 0.1060x = -0.34 A = 0.1200 B = 0.0000 Δ = 0.1200x = -0.33 A = 0.0620 B = 0.0000 Δ = 0.0620x = -0.32 A = 0.0740 B = 0.0000 Δ = 0.0740x = -0.31 A = 0.0660 B = 0.0000 Δ = 0.0660x = -0.30 A = 0.0580 B = 0.0000 Δ = 0.0580x = -0.29 A = 0.0340 B = 0.0000 Δ = 0.0340x = -0.28 A = 0.0160 B = 0.0000 Δ = 0.0160x = -0.27 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.26 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.25 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[2]
reference stan24 bins · 0.00 … 0.12
00.050.050.100.100.050.100.06 · 0.100x = 0.00 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.01 A = 0.0180 B = 0.0000 Δ = 0.0180x = 0.01 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.02 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.02 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.03 A = 0.0480 B = 0.0000 Δ = 0.0480x = 0.03 A = 0.0520 B = 0.0000 Δ = 0.0520x = 0.04 A = 0.0680 B = 0.0000 Δ = 0.0680x = 0.04 A = 0.0660 B = 0.0000 Δ = 0.0660x = 0.05 A = 0.0700 B = 0.0000 Δ = 0.0700x = 0.05 A = 0.0840 B = 0.0000 Δ = 0.0840x = 0.06 A = 0.0780 B = 0.0000 Δ = 0.0780x = 0.06 A = 0.1000 B = 0.0000 Δ = 0.1000x = 0.07 A = 0.0740 B = 0.0000 Δ = 0.0740x = 0.07 A = 0.0540 B = 0.0000 Δ = 0.0540x = 0.08 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.08 A = 0.0360 B = 0.0000 Δ = 0.0360x = 0.09 A = 0.0340 B = 0.0000 Δ = 0.0340x = 0.09 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.10 A = 0.0220 B = 0.0000 Δ = 0.0220x = 0.10 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.11 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.11 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.12 A = 0.0060 B = 0.0000 Δ = 0.0060
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0017 ≤ tol 0.0070 · floors 0.0026/0.0029
posteriordb-dugongs_data / dugongs_model
answer record(alpha, beta, lambda, tau, sigma, U3) stan pass 0.9714
00 statement source: posteriordb/dugongs_data-dugongs_model
given

Length and age measurements are available for N = 27 dugongs: an array of ages x_i and an array of body lengths Y_i (i = 1..27). The intercept parameter alpha has a Normal(mean 0, sd 1000) prior. The growth-amplitude parameter beta has a Normal(mean 0, sd 1000) prior. The decay-rate parameter lambda is constrained to lie in [0.5, 1] and has a Uniform(0.5, 1) prior. The precision parameter tau is constrained to be positive and has a Gamma(shape 0.0001, rate 0.0001) prior.

model

The expected length of dugong i is alpha minus beta times lambda raised to the power x_i, giving a nonlinear growth curve that approaches a limiting length asymptotically as age increases. The observed length Y_i is drawn from a Normal distribution centered on that expected value with standard deviation sigma = 1 / sqrt(tau). Two derived quantities are also of interest: sigma = 1 / sqrt(tau) and U3 = logit(lambda).

query

The marginal posterior distribution of each parameter and derived quantity given the data: the intercept alpha, the growth amplitude beta, the decay rate lambda, the precision tau, the standard deviation sigma, and the logit-transformed decay rate U3.

answer spec record(alpha, beta, lambda, tau, sigma, U3)
{
  "kind": "record",
  "fields": {
    "alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "beta": {
      "kind": "dist",
      "domain": "real"
    },
    "lambda": {
      "kind": "dist",
      "domain": "real"
    },
    "tau": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    },
    "U3": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.971
stan
1data {
2 int<lower=0> N;
3 array[N] real x;
4 array[N] real Y;
5}
6parameters {
7 real alpha;
8 real beta;
9 real<lower=.5, upper=1> lambda; // orginal gamma in the JAGS example
10 real<lower=0> tau;
11}
12transformed parameters {
13 real sigma;
14 real U3;
15 sigma = 1 / sqrt(tau);
16 U3 = logit(lambda);
17}
18model {
19 array[N] real m;
20 for (i in 1 : N) {
21 m[i] = alpha - beta * pow(lambda, x[i]);
22 }
23 Y ~ normal(m, sigma);
24
25 alpha ~ normal(0.0, 1000);
26 beta ~ normal(0.0, 1000);
27 lambda ~ uniform(.5, 1);
28 tau ~ gamma(.0001, .0001);
29}
30
31//@ DATA { Y: [27 values], x: [27 values], N: 27 } // values supplied at runtime
32//@ PARAMS ["alpha","beta","lambda","tau","sigma","U3"]
33//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
34
02answer overlay — reference vs stanrecord(alpha, beta, lambda, tau, sigma, U3)
alpha
reference stan24 bins · 2.48 … 2.98
00.090.090.170.172.602.802.63 · 0.174x = 2.48 A = 0.0040 B = 0.0000 Δ = 0.0040x = 2.50 A = 0.0120 B = 0.0000 Δ = 0.0120x = 2.52 A = 0.0160 B = 0.0000 Δ = 0.0160x = 2.54 A = 0.0200 B = 0.0000 Δ = 0.0200x = 2.57 A = 0.0640 B = 0.0000 Δ = 0.0640x = 2.59 A = 0.0940 B = 0.0000 Δ = 0.0940x = 2.61 A = 0.1340 B = 0.0000 Δ = 0.1340x = 2.63 A = 0.1740 B = 0.0000 Δ = 0.1740x = 2.65 A = 0.1080 B = 0.0000 Δ = 0.1080x = 2.67 A = 0.1140 B = 0.0000 Δ = 0.1140x = 2.70 A = 0.0780 B = 0.0000 Δ = 0.0780x = 2.72 A = 0.0660 B = 0.0000 Δ = 0.0660x = 2.74 A = 0.0340 B = 0.0000 Δ = 0.0340x = 2.76 A = 0.0340 B = 0.0000 Δ = 0.0340x = 2.78 A = 0.0240 B = 0.0000 Δ = 0.0240x = 2.80 A = 0.0100 B = 0.0000 Δ = 0.0100x = 2.83 A = 0.0040 B = 0.0000 Δ = 0.0040x = 2.85 A = 0.0020 B = 0.0000 Δ = 0.0020x = 2.87 A = 0.0000 B = 0.0000 Δ = 0.0000x = 2.89 A = 0.0060 B = 0.0000 Δ = 0.0060x = 2.91 A = 0.0000 B = 0.0000 Δ = 0.0000x = 2.93 A = 0.0000 B = 0.0000 Δ = 0.0000x = 2.96 A = 0.0000 B = 0.0000 Δ = 0.0000x = 2.98 A = 0.0020 B = 0.0000 Δ = 0.0020
beta
reference stan24 bins · 0.68 … 1.18
00.070.070.130.130.8010.94 · 0.130x = 0.68 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.70 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.73 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.75 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.77 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.79 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.81 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.83 A = 0.0300 B = 0.0000 Δ = 0.0300x = 0.86 A = 0.0440 B = 0.0000 Δ = 0.0440x = 0.88 A = 0.0420 B = 0.0000 Δ = 0.0420x = 0.90 A = 0.0460 B = 0.0000 Δ = 0.0460x = 0.92 A = 0.0800 B = 0.0000 Δ = 0.0800x = 0.94 A = 0.1300 B = 0.0000 Δ = 0.1300x = 0.96 A = 0.1300 B = 0.0000 Δ = 0.1300x = 0.98 A = 0.1080 B = 0.0000 Δ = 0.1080x = 1.01 A = 0.1000 B = 0.0000 Δ = 0.1000x = 1.03 A = 0.0780 B = 0.0000 Δ = 0.0780x = 1.05 A = 0.0800 B = 0.0000 Δ = 0.0800x = 1.07 A = 0.0500 B = 0.0000 Δ = 0.0500x = 1.09 A = 0.0280 B = 0.0000 Δ = 0.0280x = 1.11 A = 0.0180 B = 0.0000 Δ = 0.0180x = 1.14 A = 0.0120 B = 0.0000 Δ = 0.0120x = 1.16 A = 0.0040 B = 0.0000 Δ = 0.0040x = 1.18 A = 0.0040 B = 0.0000 Δ = 0.0040
lambda
reference stan24 bins · 0.72 … 0.93
00.060.060.120.120.800.900.88 · 0.124x = 0.72 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.73 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.74 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.75 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.76 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.76 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.77 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.78 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.79 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.80 A = 0.0160 B = 0.0000 Δ = 0.0160x = 0.81 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.82 A = 0.0280 B = 0.0000 Δ = 0.0280x = 0.83 A = 0.0500 B = 0.0000 Δ = 0.0500x = 0.84 A = 0.0800 B = 0.0000 Δ = 0.0800x = 0.85 A = 0.0980 B = 0.0000 Δ = 0.0980x = 0.86 A = 0.1140 B = 0.0000 Δ = 0.1140x = 0.87 A = 0.1200 B = 0.0000 Δ = 0.1200x = 0.88 A = 0.1220 B = 0.0000 Δ = 0.1220x = 0.88 A = 0.1240 B = 0.0000 Δ = 0.1240x = 0.89 A = 0.1100 B = 0.0000 Δ = 0.1100x = 0.90 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.91 A = 0.0280 B = 0.0000 Δ = 0.0280x = 0.92 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.93 A = 0.0080 B = 0.0000 Δ = 0.0080
tau
reference stan24 bins · 34.7 … 208
00.050.050.100.10100200110 · 0.104x = 34.7 A = 0.0020 B = 0.0000 Δ = 0.0020x = 42.2 A = 0.0080 B = 0.0000 Δ = 0.0080x = 49.8 A = 0.0160 B = 0.0000 Δ = 0.0160x = 57.3 A = 0.0220 B = 0.0000 Δ = 0.0220x = 64.8 A = 0.0320 B = 0.0000 Δ = 0.0320x = 72.3 A = 0.0800 B = 0.0000 Δ = 0.0800x = 79.8 A = 0.0780 B = 0.0000 Δ = 0.0780x = 87.4 A = 0.1000 B = 0.0000 Δ = 0.1000x = 94.9 A = 0.0900 B = 0.0000 Δ = 0.0900x = 102 A = 0.0880 B = 0.0000 Δ = 0.0880x = 110 A = 0.1040 B = 0.0000 Δ = 0.1040x = 118 A = 0.0860 B = 0.0000 Δ = 0.0860x = 125 A = 0.0620 B = 0.0000 Δ = 0.0620x = 133 A = 0.0600 B = 0.0000 Δ = 0.0600x = 140 A = 0.0520 B = 0.0000 Δ = 0.0520x = 148 A = 0.0400 B = 0.0000 Δ = 0.0400x = 155 A = 0.0300 B = 0.0000 Δ = 0.0300x = 163 A = 0.0200 B = 0.0000 Δ = 0.0200x = 170 A = 0.0140 B = 0.0000 Δ = 0.0140x = 178 A = 0.0040 B = 0.0000 Δ = 0.0040x = 185 A = 0.0080 B = 0.0000 Δ = 0.0080x = 193 A = 0.0020 B = 0.0000 Δ = 0.0020x = 200 A = 0.0000 B = 0.0000 Δ = 0.0000x = 208 A = 0.0020 B = 0.0000 Δ = 0.0020
sigma
reference stan24 bins · 0.07 … 0.18
00.070.070.140.140.100.150.10 · 0.136x = 0.07 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.08 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.08 A = 0.0640 B = 0.0000 Δ = 0.0640x = 0.09 A = 0.1040 B = 0.0000 Δ = 0.1040x = 0.09 A = 0.1340 B = 0.0000 Δ = 0.1340x = 0.09 A = 0.1280 B = 0.0000 Δ = 0.1280x = 0.10 A = 0.1360 B = 0.0000 Δ = 0.1360x = 0.10 A = 0.1020 B = 0.0000 Δ = 0.1020x = 0.11 A = 0.0760 B = 0.0000 Δ = 0.0760x = 0.11 A = 0.0700 B = 0.0000 Δ = 0.0700x = 0.12 A = 0.0540 B = 0.0000 Δ = 0.0540x = 0.12 A = 0.0380 B = 0.0000 Δ = 0.0380x = 0.13 A = 0.0160 B = 0.0000 Δ = 0.0160x = 0.13 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.14 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.14 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.15 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.15 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.15 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.16 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.16 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.17 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.17 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.18 A = 0.0020 B = 0.0000 Δ = 0.0020
U3
reference stan24 bins · 0.95 … 2.64
00.060.060.120.12121.83 · 0.124x = 0.95 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.03 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.10 A = 0.0040 B = 0.0000 Δ = 0.0040x = 1.17 A = 0.0060 B = 0.0000 Δ = 0.0060x = 1.25 A = 0.0040 B = 0.0000 Δ = 0.0040x = 1.32 A = 0.0120 B = 0.0000 Δ = 0.0120x = 1.39 A = 0.0180 B = 0.0000 Δ = 0.0180x = 1.47 A = 0.0320 B = 0.0000 Δ = 0.0320x = 1.54 A = 0.0540 B = 0.0000 Δ = 0.0540x = 1.61 A = 0.0780 B = 0.0000 Δ = 0.0780x = 1.69 A = 0.0740 B = 0.0000 Δ = 0.0740x = 1.76 A = 0.1120 B = 0.0000 Δ = 0.1120x = 1.83 A = 0.1240 B = 0.0000 Δ = 0.1240x = 1.90 A = 0.1060 B = 0.0000 Δ = 0.1060x = 1.98 A = 0.1040 B = 0.0000 Δ = 0.1040x = 2.05 A = 0.1040 B = 0.0000 Δ = 0.1040x = 2.12 A = 0.0660 B = 0.0000 Δ = 0.0660x = 2.20 A = 0.0480 B = 0.0000 Δ = 0.0480x = 2.27 A = 0.0160 B = 0.0000 Δ = 0.0160x = 2.34 A = 0.0180 B = 0.0000 Δ = 0.0180x = 2.42 A = 0.0080 B = 0.0000 Δ = 0.0080x = 2.49 A = 0.0000 B = 0.0000 Δ = 0.0000x = 2.56 A = 0.0060 B = 0.0000 Δ = 0.0060x = 2.64 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.9714 ≤ tol 3.3682 · floors 1.6768/1.2891
posteriordb-earnings / earn_height
answer record(beta[1], beta[2], sigma) stan pass 364.2235
00 statement source: posteriordb/earnings-earn_height
given

For each of N individuals, the data provide the person's earnings and height in inches. The regression has two coefficients, an intercept and a slope on height, each with a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each individual's earnings are normally distributed with a mean equal to the intercept plus the slope times that individual's height, and a common standard deviation sigma across all individuals.

query

The marginal posterior distribution of each of the three parameters: the intercept (reported as beta[1]), the slope on height (reported as beta[2]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization364.224
stan
1data {
2 int<lower=0> N;
3 vector[N] earn;
4 vector[N] height;
5}
6parameters {
7 vector[2] beta;
8 real<lower=0> sigma;
9}
10model {
11 earn ~ normal(beta[1] + beta[2] * height, sigma);
12}
13
14//@ DATA { N: 1192, earn: [1192 values], height: [1192 values] } // values supplied at runtime
15//@ PARAMS ["beta[1]","beta[2]","sigma"]
16//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
17
02answer overlay — reference vs stanrecord(beta[1], beta[2], sigma)
beta[1]
reference stan24 bins · -88976 … -31502
00.070.070.130.13-80000-60000-40000-56491 · 0.134-58990 · 0.116x = -88976 A = 0.0060 B = 0.0000 Δ = 0.0060x = -86477 A = 0.0100 B = 0.0020 Δ = 0.0080x = -83978 A = 0.0060 B = 0.0020 Δ = 0.0040x = -81479 A = 0.0120 B = 0.0060 Δ = 0.0060x = -78980 A = 0.0100 B = 0.0240 Δ = -0.0140x = -76481 A = 0.0300 B = 0.0140 Δ = 0.0160x = -73983 A = 0.0380 B = 0.0500 Δ = -0.0120x = -71484 A = 0.0480 B = 0.0620 Δ = -0.0140x = -68985 A = 0.0520 B = 0.0700 Δ = -0.0180x = -66486 A = 0.0680 B = 0.0820 Δ = -0.0140x = -63987 A = 0.1280 B = 0.0820 Δ = 0.0460x = -61488 A = 0.1200 B = 0.1100 Δ = 0.0100x = -58990 A = 0.1000 B = 0.1160 Δ = -0.0160x = -56491 A = 0.1340 B = 0.1060 Δ = 0.0280x = -53992 A = 0.0600 B = 0.0820 Δ = -0.0220x = -51493 A = 0.0700 B = 0.0760 Δ = -0.0060x = -48994 A = 0.0500 B = 0.0460 Δ = 0.0040x = -46495 A = 0.0280 B = 0.0200 Δ = 0.0080x = -43997 A = 0.0180 B = 0.0200 Δ = -0.0020x = -41498 A = 0.0040 B = 0.0160 Δ = -0.0120x = -38999 A = 0.0020 B = 0.0100 Δ = -0.0080x = -36500 A = 0.0020 B = 0.0020 Δ = 0.0000x = -34001 A = 0.0040 B = 0.0000 Δ = 0.0040x = -31502 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[2]
reference stan24 bins · 800 … 1666
00.070.070.130.13100015001289 · 0.1341214 · 0.116x = 800 A = 0.0000 B = 0.0020 Δ = -0.0020x = 838 A = 0.0020 B = 0.0000 Δ = 0.0020x = 875 A = 0.0020 B = 0.0000 Δ = 0.0020x = 913 A = 0.0040 B = 0.0060 Δ = -0.0020x = 951 A = 0.0020 B = 0.0180 Δ = -0.0160x = 988 A = 0.0140 B = 0.0120 Δ = 0.0020x = 1026 A = 0.0220 B = 0.0240 Δ = -0.0020x = 1064 A = 0.0400 B = 0.0260 Δ = 0.0140x = 1101 A = 0.0600 B = 0.0860 Δ = -0.0260x = 1139 A = 0.0760 B = 0.0700 Δ = 0.0060x = 1176 A = 0.0980 B = 0.0920 Δ = 0.0060x = 1214 A = 0.1140 B = 0.1160 Δ = -0.0020x = 1252 A = 0.1260 B = 0.1060 Δ = 0.0200x = 1289 A = 0.1340 B = 0.1060 Δ = 0.0280x = 1327 A = 0.0760 B = 0.0760 Δ = 0.0000x = 1365 A = 0.0560 B = 0.0780 Δ = -0.0220x = 1402 A = 0.0500 B = 0.0620 Δ = -0.0120x = 1440 A = 0.0420 B = 0.0560 Δ = -0.0140x = 1478 A = 0.0300 B = 0.0240 Δ = 0.0060x = 1515 A = 0.0160 B = 0.0240 Δ = -0.0080x = 1553 A = 0.0100 B = 0.0120 Δ = -0.0020x = 1590 A = 0.0080 B = 0.0020 Δ = 0.0060x = 1628 A = 0.0060 B = 0.0020 Δ = 0.0040x = 1666 A = 0.0120 B = 0.0000 Δ = 0.0120
sigma
reference stan24 bins · 17605 … 19923
00.060.060.110.11180001900018915 · 0.11219116 · 0.104x = 17605 A = 0.0000 B = 0.0020 Δ = -0.0020x = 17706 A = 0.0020 B = 0.0020 Δ = 0.0000x = 17807 A = 0.0000 B = 0.0000 Δ = 0.0000x = 17907 A = 0.0040 B = 0.0020 Δ = 0.0020x = 18008 A = 0.0020 B = 0.0020 Δ = 0.0000x = 18109 A = 0.0160 B = 0.0160 Δ = 0.0000x = 18210 A = 0.0200 B = 0.0180 Δ = 0.0020x = 18310 A = 0.0180 B = 0.0260 Δ = -0.0080x = 18411 A = 0.0400 B = 0.0600 Δ = -0.0200x = 18512 A = 0.0860 B = 0.0440 Δ = 0.0420x = 18613 A = 0.0880 B = 0.0740 Δ = 0.0140x = 18713 A = 0.0960 B = 0.0920 Δ = 0.0040x = 18814 A = 0.1020 B = 0.0880 Δ = 0.0140x = 18915 A = 0.1120 B = 0.1020 Δ = 0.0100x = 19016 A = 0.1040 B = 0.0980 Δ = 0.0060x = 19116 A = 0.0880 B = 0.1040 Δ = -0.0160x = 19217 A = 0.0560 B = 0.0660 Δ = -0.0100x = 19318 A = 0.0520 B = 0.0460 Δ = 0.0060x = 19419 A = 0.0440 B = 0.0380 Δ = 0.0060x = 19520 A = 0.0320 B = 0.0320 Δ = 0.0000x = 19620 A = 0.0180 B = 0.0460 Δ = -0.0280x = 19721 A = 0.0120 B = 0.0120 Δ = 0.0000x = 19822 A = 0.0060 B = 0.0120 Δ = -0.0060x = 19923 A = 0.0020 B = 0.0180 Δ = -0.0160
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=364.2235 ≤ tol 1066.3760 · floors 533.1880/439.1448
posteriordb-earnings / log10earn_height
answer record(beta[1], beta[2], sigma) stan pass 0.0072
00 statement source: posteriordb/earnings-log10earn_height
given

For each of N individuals, the data provide that individual's earnings (a positive real value in dollars) and height (a real-valued measurement in inches). The model operates on a log base 10 transformation of earnings. The regression has two coefficients, an intercept and a slope on height, each with a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

For each individual, we compute the log base 10 of that individual's earnings. The log base 10 transformed earnings are normally distributed with mean equal to the intercept beta[1] plus the slope beta[2] times that individual's height, and with a common standard deviation sigma across all individuals.

query

The marginal posterior distribution of each of the three parameters: beta[1] (the intercept), beta[2] (the height coefficient), and sigma (the error standard deviation).

answer spec record(beta[1], beta[2], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.007
stan
1data {
2 int<lower=0> N;
3 vector[N] earn;
4 vector[N] height;
5}
6transformed data {
7 // log 10 transformation
8 vector[N] log10_earn;
9 for (i in 1 : N) {
10 log10_earn[i] = log10(earn[i]);
11 }
12}
13parameters {
14 vector[2] beta;
15 real<lower=0> sigma;
16}
17model {
18 log10_earn ~ normal(beta[1] + beta[2] * height, sigma);
19}
20
21//@ DATA { N: 1192, earn: [1192 values], height: [1192 values] } // values supplied at runtime
22//@ PARAMS ["beta[1]","beta[2]","sigma"]
23//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
24
02answer overlay — reference vs stanrecord(beta[1], beta[2], sigma)
beta[1]
reference stan24 bins · 1.96 … 3.03
00.060.060.110.1122.5032.52 · 0.0922.47 · 0.114x = 1.96 A = 0.0020 B = 0.0020 Δ = 0.0000x = 2.01 A = 0.0040 B = 0.0060 Δ = -0.0020x = 2.05 A = 0.0060 B = 0.0100 Δ = -0.0040x = 2.10 A = 0.0100 B = 0.0100 Δ = 0.0000x = 2.15 A = 0.0220 B = 0.0240 Δ = -0.0020x = 2.19 A = 0.0140 B = 0.0160 Δ = -0.0020x = 2.24 A = 0.0360 B = 0.0220 Δ = 0.0140x = 2.29 A = 0.0460 B = 0.0340 Δ = 0.0120x = 2.33 A = 0.0640 B = 0.0620 Δ = 0.0020x = 2.38 A = 0.0860 B = 0.0820 Δ = 0.0040x = 2.42 A = 0.0700 B = 0.1060 Δ = -0.0360x = 2.47 A = 0.0920 B = 0.1140 Δ = -0.0220x = 2.52 A = 0.0920 B = 0.0980 Δ = -0.0060x = 2.56 A = 0.0860 B = 0.0800 Δ = 0.0060x = 2.61 A = 0.0760 B = 0.0880 Δ = -0.0120x = 2.66 A = 0.0760 B = 0.0820 Δ = -0.0060x = 2.70 A = 0.0520 B = 0.0440 Δ = 0.0080x = 2.75 A = 0.0540 B = 0.0460 Δ = 0.0080x = 2.79 A = 0.0520 B = 0.0300 Δ = 0.0220x = 2.84 A = 0.0180 B = 0.0200 Δ = -0.0020x = 2.89 A = 0.0260 B = 0.0080 Δ = 0.0180x = 2.93 A = 0.0080 B = 0.0040 Δ = 0.0040x = 2.98 A = 0.0040 B = 0.0120 Δ = -0.0080x = 3.03 A = 0.0040 B = 0.0000 Δ = 0.0040
beta[2]
reference stan24 bins · 0.02 … 0.03
00.080.080.160.160.020.030.03 · 0.1400.03 · 0.156x = 0.02 A = 0.0040 B = 0.0080 Δ = -0.0040x = 0.02 A = 0.0120 B = 0.0080 Δ = 0.0040x = 0.02 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.02 A = 0.0320 B = 0.0080 Δ = 0.0240x = 0.02 A = 0.0540 B = 0.0460 Δ = 0.0080x = 0.02 A = 0.0800 B = 0.0620 Δ = 0.0180x = 0.02 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.02 A = 0.0840 B = 0.0940 Δ = -0.0100x = 0.02 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.02 A = 0.1160 B = 0.1220 Δ = -0.0060x = 0.03 A = 0.1280 B = 0.1360 Δ = -0.0080x = 0.03 A = 0.1400 B = 0.1420 Δ = -0.0020x = 0.03 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.03 A = 0.1120 B = 0.1560 Δ = -0.0440x = 0.03 A = 0.0940 B = 0.0940 Δ = 0.0000x = 0.03 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.03 A = 0.0620 B = 0.0460 Δ = 0.0160x = 0.03 A = 0.0360 B = 0.0240 Δ = 0.0120x = 0.03 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.03 A = 0.0260 B = 0.0260 Δ = 0.0000x = 0.03 A = 0.0140 B = 0.0180 Δ = -0.0040x = 0.03 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.03 A = 0.0040 B = 0.0080 Δ = -0.0040x = 0.03 A = 0.0020 B = 0.0020 Δ = 0.0000
sigma
reference stan24 bins · 0.37 … 0.41
00.060.060.130.130.380.400.39 · 0.1120.39 · 0.126x = 0.37 A = 0.0160 B = 0.0020 Δ = 0.0140x = 0.37 A = 0.0000 B = 0.0200 Δ = -0.0200x = 0.37 A = 0.0200 B = 0.0140 Δ = 0.0060x = 0.38 A = 0.0240 B = 0.0200 Δ = 0.0040x = 0.38 A = 0.0200 B = 0.0160 Δ = 0.0040x = 0.38 A = 0.0500 B = 0.0440 Δ = 0.0060x = 0.38 A = 0.0780 B = 0.0460 Δ = 0.0320x = 0.38 A = 0.0900 B = 0.0720 Δ = 0.0180x = 0.38 A = 0.0700 B = 0.1000 Δ = -0.0300x = 0.39 A = 0.0620 B = 0.0440 Δ = 0.0180x = 0.39 A = 0.1120 B = 0.1260 Δ = -0.0140x = 0.39 A = 0.0680 B = 0.1000 Δ = -0.0320x = 0.39 A = 0.0800 B = 0.0680 Δ = 0.0120x = 0.39 A = 0.0880 B = 0.0700 Δ = 0.0180x = 0.40 A = 0.0400 B = 0.0380 Δ = 0.0020x = 0.40 A = 0.0560 B = 0.0700 Δ = -0.0140x = 0.40 A = 0.0540 B = 0.0260 Δ = 0.0280x = 0.40 A = 0.0260 B = 0.0420 Δ = -0.0160x = 0.40 A = 0.0080 B = 0.0220 Δ = -0.0140x = 0.40 A = 0.0120 B = 0.0180 Δ = -0.0060x = 0.41 A = 0.0100 B = 0.0280 Δ = -0.0180x = 0.41 A = 0.0060 B = 0.0080 Δ = -0.0020x = 0.41 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.41 A = 0.0040 B = 0.0000 Δ = 0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0072 ≤ tol 0.0320 · floors 0.0087/0.0092
posteriordb-earnings / logearn_height
answer record(beta[1], beta[2], sigma) stan pass 0.0168
00 statement source: posteriordb/earnings-logearn_height
given

For each of N = 1192 adults the data provide annual earnings (in dollars, positive) and height (in inches). The model is fit to the natural logarithm of earnings. The regression has two coefficients, an intercept and a slope on height, each with a flat (improper uniform) prior over the real line; the error standard deviation sigma, constrained positive, also has a flat (improper uniform) prior.

model

The natural logarithm of each person's earnings is Normal-distributed with a mean equal to the intercept plus the slope times that person's height, and a common standard deviation sigma across all people.

query

The marginal posterior distribution of each of the three parameters, all on the log-earnings scale: the intercept (reported as beta[1]), the slope on height (reported as beta[2]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.017
stan
1data {
2 int<lower=0> N;
3 vector[N] earn;
4 vector[N] height;
5}
6transformed data {
7 // log transformation
8 vector[N] log_earn;
9 log_earn = log(earn);
10}
11parameters {
12 vector[2] beta;
13 real<lower=0> sigma;
14}
15model {
16 log_earn ~ normal(beta[1] + beta[2] * height, sigma);
17}
18
19//@ DATA { N: 1192, earn: [1192 values], height: [1192 values] } // values supplied at runtime
20//@ PARAMS ["beta[1]","beta[2]","sigma"]
21//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
22
02answer overlay — reference vs stanrecord(beta[1], beta[2], sigma)
beta[1]
reference stan24 bins · 4.49 … 7.09
00.060.060.120.125675.96 · 0.1225.73 · 0.116x = 4.49 A = 0.0060 B = 0.0000 Δ = 0.0060x = 4.60 A = 0.0000 B = 0.0000 Δ = 0.0000x = 4.71 A = 0.0040 B = 0.0060 Δ = -0.0020x = 4.83 A = 0.0140 B = 0.0080 Δ = 0.0060x = 4.94 A = 0.0200 B = 0.0160 Δ = 0.0040x = 5.05 A = 0.0340 B = 0.0180 Δ = 0.0160x = 5.17 A = 0.0420 B = 0.0320 Δ = 0.0100x = 5.28 A = 0.0440 B = 0.0560 Δ = -0.0120x = 5.39 A = 0.0540 B = 0.0360 Δ = 0.0180x = 5.51 A = 0.0820 B = 0.0500 Δ = 0.0320x = 5.62 A = 0.0820 B = 0.1120 Δ = -0.0300x = 5.73 A = 0.1060 B = 0.1160 Δ = -0.0100x = 5.85 A = 0.0720 B = 0.1140 Δ = -0.0420x = 5.96 A = 0.1220 B = 0.0820 Δ = 0.0400x = 6.07 A = 0.0820 B = 0.0720 Δ = 0.0100x = 6.18 A = 0.0780 B = 0.0840 Δ = -0.0060x = 6.30 A = 0.0500 B = 0.0560 Δ = -0.0060x = 6.41 A = 0.0300 B = 0.0480 Δ = -0.0180x = 6.52 A = 0.0340 B = 0.0400 Δ = -0.0060x = 6.64 A = 0.0180 B = 0.0380 Δ = -0.0200x = 6.75 A = 0.0100 B = 0.0100 Δ = 0.0000x = 6.86 A = 0.0020 B = 0.0060 Δ = -0.0040x = 6.98 A = 0.0080 B = 0.0000 Δ = 0.0080x = 7.09 A = 0.0060 B = 0.0000 Δ = 0.0060
beta[2]
reference stan24 bins · 0.04 … 0.08
00.070.070.140.140.040.060.06 · 0.1120.06 · 0.142x = 0.04 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.04 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.04 A = 0.0060 B = 0.0080 Δ = -0.0020x = 0.04 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.05 A = 0.0240 B = 0.0320 Δ = -0.0080x = 0.05 A = 0.0340 B = 0.0440 Δ = -0.0100x = 0.05 A = 0.0160 B = 0.0280 Δ = -0.0120x = 0.05 A = 0.0520 B = 0.0740 Δ = -0.0220x = 0.05 A = 0.0920 B = 0.0800 Δ = 0.0120x = 0.05 A = 0.1040 B = 0.0900 Δ = 0.0140x = 0.06 A = 0.0620 B = 0.0560 Δ = 0.0060x = 0.06 A = 0.1120 B = 0.1220 Δ = -0.0100x = 0.06 A = 0.1060 B = 0.1420 Δ = -0.0360x = 0.06 A = 0.0580 B = 0.0720 Δ = -0.0140x = 0.06 A = 0.0920 B = 0.0680 Δ = 0.0240x = 0.06 A = 0.0640 B = 0.0460 Δ = 0.0180x = 0.07 A = 0.0620 B = 0.0600 Δ = 0.0020x = 0.07 A = 0.0240 B = 0.0240 Δ = 0.0000x = 0.07 A = 0.0340 B = 0.0200 Δ = 0.0140x = 0.07 A = 0.0260 B = 0.0160 Δ = 0.0100x = 0.07 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.07 A = 0.0060 B = 0.0140 Δ = -0.0080x = 0.08 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.08 A = 0.0040 B = 0.0000 Δ = 0.0040
sigma
reference stan24 bins · 0.83 … 0.95
00.060.060.130.130.850.900.89 · 0.1260.89 · 0.116x = 0.83 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.84 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.84 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.85 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.85 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.86 A = 0.0160 B = 0.0240 Δ = -0.0080x = 0.86 A = 0.0260 B = 0.0200 Δ = 0.0060x = 0.87 A = 0.0360 B = 0.0520 Δ = -0.0160x = 0.87 A = 0.0600 B = 0.0580 Δ = 0.0020x = 0.88 A = 0.1040 B = 0.0800 Δ = 0.0240x = 0.88 A = 0.0900 B = 0.1060 Δ = -0.0160x = 0.89 A = 0.0920 B = 0.0780 Δ = 0.0140x = 0.89 A = 0.1260 B = 0.1160 Δ = 0.0100x = 0.90 A = 0.0940 B = 0.0880 Δ = 0.0060x = 0.90 A = 0.0820 B = 0.1120 Δ = -0.0300x = 0.91 A = 0.0600 B = 0.0840 Δ = -0.0240x = 0.91 A = 0.0660 B = 0.0620 Δ = 0.0040x = 0.92 A = 0.0520 B = 0.0440 Δ = 0.0080x = 0.92 A = 0.0380 B = 0.0400 Δ = -0.0020x = 0.93 A = 0.0160 B = 0.0160 Δ = 0.0000x = 0.93 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.94 A = 0.0020 B = 0.0100 Δ = -0.0080x = 0.94 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.95 A = 0.0040 B = 0.0000 Δ = 0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0168 ≤ tol 0.0765 · floors 0.0382/0.0189
posteriordb-earnings / logearn_height_male
answer record(beta[1], beta[2], beta[3], sigma) stan pass 0.0340
00 statement source: posteriordb/earnings-logearn_height_male
given

For each of N = 1192 individuals the data provide earnings in dollars and two predictors: height measured in inches and a binary indicator of male gender. The regression has three coefficients—an intercept, a slope on height, and a slope on the male indicator—each with a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

The natural logarithm of each individual's earnings is normally distributed with a mean equal to the intercept plus the height coefficient times that individual's height plus the male coefficient times that individual's gender indicator, and a common standard deviation sigma across all individuals.

query

The marginal posterior distribution of each of the four parameters: the intercept (reported as beta[1]), the slope on height (reported as beta[2]), the slope on the male indicator (reported as beta[3]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.034
stan
1data {
2 int<lower=0> N;
3 vector[N] earn;
4 vector[N] height;
5 vector[N] male;
6}
7transformed data {
8 // log transformation
9 vector[N] log_earn;
10 log_earn = log(earn);
11}
12parameters {
13 vector[3] beta;
14 real<lower=0> sigma;
15}
16model {
17 log_earn ~ normal(beta[1] + beta[2] * height + beta[3] * male, sigma);
18}
19
20//@ DATA { N: 1192, earn: [1192 values], height: [1192 values], male: [1192 values] } // values supplied at runtime
21//@ PARAMS ["beta[1]","beta[2]","beta[3]","sigma"]
22//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
23
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], sigma)
beta[1]
reference stan24 bins · 6.45 … 9.63
00.050.050.110.1187.83 · 0.0968.25 · 0.108x = 6.45 A = 0.0020 B = 0.0040 Δ = -0.0020x = 6.59 A = 0.0020 B = 0.0060 Δ = -0.0040x = 6.73 A = 0.0040 B = 0.0060 Δ = -0.0020x = 6.87 A = 0.0140 B = 0.0140 Δ = 0.0000x = 7 A = 0.0140 B = 0.0140 Δ = 0.0000x = 7.14 A = 0.0240 B = 0.0260 Δ = -0.0020x = 7.28 A = 0.0340 B = 0.0260 Δ = 0.0080x = 7.42 A = 0.0480 B = 0.0400 Δ = 0.0080x = 7.56 A = 0.0540 B = 0.0500 Δ = 0.0040x = 7.69 A = 0.0580 B = 0.0600 Δ = -0.0020x = 7.83 A = 0.0960 B = 0.0740 Δ = 0.0220x = 7.97 A = 0.0880 B = 0.1000 Δ = -0.0120x = 8.11 A = 0.0900 B = 0.0840 Δ = 0.0060x = 8.25 A = 0.0920 B = 0.1080 Δ = -0.0160x = 8.39 A = 0.0860 B = 0.0880 Δ = -0.0020x = 8.52 A = 0.0880 B = 0.0620 Δ = 0.0260x = 8.66 A = 0.0580 B = 0.0720 Δ = -0.0140x = 8.80 A = 0.0580 B = 0.0400 Δ = 0.0180x = 8.94 A = 0.0340 B = 0.0460 Δ = -0.0120x = 9.08 A = 0.0340 B = 0.0140 Δ = 0.0200x = 9.22 A = 0.0100 B = 0.0300 Δ = -0.0200x = 9.35 A = 0.0060 B = 0.0200 Δ = -0.0140x = 9.49 A = 0.0040 B = 0.0100 Δ = -0.0060x = 9.63 A = 0.0020 B = 0.0060 Δ = -0.0040
beta[2]
reference stan24 bins · -0.00 … 0.05
00.060.060.120.1200.020.040.02 · 0.1220.02 · 0.104x = -0.00 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.00 A = 0.0040 B = 0.0120 Δ = -0.0080x = 0.00 A = 0.0060 B = 0.0220 Δ = -0.0160x = 0.00 A = 0.0100 B = 0.0240 Δ = -0.0140x = 0.01 A = 0.0340 B = 0.0180 Δ = 0.0160x = 0.01 A = 0.0360 B = 0.0400 Δ = -0.0040x = 0.01 A = 0.0600 B = 0.0380 Δ = 0.0220x = 0.01 A = 0.0400 B = 0.0640 Δ = -0.0240x = 0.02 A = 0.1220 B = 0.0940 Δ = 0.0280x = 0.02 A = 0.0800 B = 0.0940 Δ = -0.0140x = 0.02 A = 0.0920 B = 0.0880 Δ = 0.0040x = 0.02 A = 0.0900 B = 0.0760 Δ = 0.0140x = 0.02 A = 0.0740 B = 0.1040 Δ = -0.0300x = 0.03 A = 0.0840 B = 0.0700 Δ = 0.0140x = 0.03 A = 0.0660 B = 0.0560 Δ = 0.0100x = 0.03 A = 0.0480 B = 0.0460 Δ = 0.0020x = 0.03 A = 0.0660 B = 0.0560 Δ = 0.0100x = 0.03 A = 0.0320 B = 0.0300 Δ = 0.0020x = 0.04 A = 0.0180 B = 0.0200 Δ = -0.0020x = 0.04 A = 0.0160 B = 0.0120 Δ = 0.0040x = 0.04 A = 0.0100 B = 0.0120 Δ = -0.0020x = 0.04 A = 0.0060 B = 0.0080 Δ = -0.0020x = 0.04 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.05 A = 0.0020 B = 0.0040 Δ = -0.0020
beta[3]
reference stan24 bins · 0.23 … 0.63
00.060.060.120.120.400.600.44 · 0.1020.44 · 0.122x = 0.23 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.25 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.26 A = 0.0080 B = 0.0100 Δ = -0.0020x = 0.28 A = 0.0180 B = 0.0180 Δ = 0.0000x = 0.30 A = 0.0180 B = 0.0180 Δ = 0.0000x = 0.32 A = 0.0360 B = 0.0500 Δ = -0.0140x = 0.33 A = 0.0640 B = 0.0460 Δ = 0.0180x = 0.35 A = 0.0540 B = 0.0360 Δ = 0.0180x = 0.37 A = 0.0880 B = 0.0940 Δ = -0.0060x = 0.39 A = 0.0880 B = 0.0580 Δ = 0.0300x = 0.40 A = 0.0900 B = 0.0900 Δ = 0.0000x = 0.42 A = 0.0860 B = 0.1080 Δ = -0.0220x = 0.44 A = 0.1020 B = 0.1220 Δ = -0.0200x = 0.46 A = 0.0820 B = 0.0820 Δ = -0.0000x = 0.47 A = 0.0840 B = 0.0800 Δ = 0.0040x = 0.49 A = 0.0480 B = 0.0640 Δ = -0.0160x = 0.51 A = 0.0420 B = 0.0280 Δ = 0.0140x = 0.52 A = 0.0260 B = 0.0320 Δ = -0.0060x = 0.54 A = 0.0240 B = 0.0260 Δ = -0.0020x = 0.56 A = 0.0180 B = 0.0140 Δ = 0.0040x = 0.58 A = 0.0100 B = 0.0060 Δ = 0.0040x = 0.59 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.61 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.63 A = 0.0000 B = 0.0020 Δ = -0.0020
sigma
reference stan24 bins · 0.83 … 0.94
00.070.070.140.140.850.900.88 · 0.1400.88 · 0.122x = 0.83 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.84 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.84 A = 0.0100 B = 0.0040 Δ = 0.0060x = 0.84 A = 0.0060 B = 0.0080 Δ = -0.0020x = 0.85 A = 0.0080 B = 0.0200 Δ = -0.0120x = 0.85 A = 0.0300 B = 0.0440 Δ = -0.0140x = 0.86 A = 0.0500 B = 0.0460 Δ = 0.0040x = 0.86 A = 0.0920 B = 0.0660 Δ = 0.0260x = 0.87 A = 0.0900 B = 0.0880 Δ = 0.0020x = 0.87 A = 0.0880 B = 0.0820 Δ = 0.0060x = 0.88 A = 0.1400 B = 0.1220 Δ = 0.0180x = 0.88 A = 0.0940 B = 0.1060 Δ = -0.0120x = 0.89 A = 0.0880 B = 0.1220 Δ = -0.0340x = 0.89 A = 0.0840 B = 0.1020 Δ = -0.0180x = 0.90 A = 0.0620 B = 0.0540 Δ = 0.0080x = 0.90 A = 0.0480 B = 0.0520 Δ = -0.0040x = 0.91 A = 0.0280 B = 0.0360 Δ = -0.0080x = 0.91 A = 0.0300 B = 0.0180 Δ = 0.0120x = 0.92 A = 0.0120 B = 0.0040 Δ = 0.0080x = 0.92 A = 0.0140 B = 0.0040 Δ = 0.0100x = 0.93 A = 0.0100 B = 0.0100 Δ = 0.0000x = 0.93 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.94 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.94 A = 0.0040 B = 0.0000 Δ = 0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0340 ≤ tol 0.0895 · floors 0.0448/0.0294
posteriordb-earnings / logearn_interaction
answer record(beta[1], beta[2], beta[3], beta[4], sigma) stan pass 0.0429
00 statement source: posteriordb/earnings-logearn_interaction
given

For each of N individuals, the data provide the individual's earnings (a positive real-valued number), height in inches, and a binary indicator of male gender (1 = male, 0 = female). The model operates on the natural logarithm of earnings. The regression has four coefficients—an intercept, a slope on height, a slope on the male indicator, and a slope on the height-male interaction—each with a flat (improper uniform) prior over the real line. The residual standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each individual's log earnings is normally distributed with a mean equal to the intercept plus the height coefficient times that individual's height, plus the male coefficient times that individual's male indicator, plus the interaction coefficient times the product of height and male indicator. The standard deviation of this normal distribution is sigma, common across all individuals.

query

The marginal posterior distributions of the five parameters: the intercept (beta[1]), the height coefficient (beta[2]), the male indicator coefficient (beta[3]), the height-male interaction coefficient (beta[4]), and the residual standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.043
stan
1data {
2 int<lower=0> N;
3 vector[N] earn;
4 vector[N] height;
5 vector[N] male;
6}
7transformed data {
8 vector[N] log_earn; // log transformation
9 vector[N] inter; // interaction
10 log_earn = log(earn);
11 inter = height .* male;
12}
13parameters {
14 vector[4] beta;
15 real<lower=0> sigma;
16}
17model {
18 log_earn ~ normal(beta[1] + beta[2] * height + beta[3] * male
19 + beta[4] * inter, sigma);
20}
21
22//@ DATA { N: 1192, earn: [1192 values], height: [1192 values], male: [1192 values] } // values supplied at runtime
23//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","sigma"]
24//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
25
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], sigma)
beta[1]
reference stan24 bins · 5.57 … 10.6
00.060.060.120.1268108.43 · 0.1088.43 · 0.124x = 5.57 A = 0.0020 B = 0.0000 Δ = 0.0020x = 5.79 A = 0.0020 B = 0.0000 Δ = 0.0020x = 6.01 A = 0.0040 B = 0.0060 Δ = -0.0020x = 6.23 A = 0.0040 B = 0.0040 Δ = 0.0000x = 6.45 A = 0.0060 B = 0.0040 Δ = 0.0020x = 6.67 A = 0.0120 B = 0.0080 Δ = 0.0040x = 6.89 A = 0.0260 B = 0.0100 Δ = 0.0160x = 7.11 A = 0.0440 B = 0.0300 Δ = 0.0140x = 7.33 A = 0.0560 B = 0.0620 Δ = -0.0060x = 7.55 A = 0.0780 B = 0.0560 Δ = 0.0220x = 7.77 A = 0.0820 B = 0.0960 Δ = -0.0140x = 7.99 A = 0.0820 B = 0.1200 Δ = -0.0380x = 8.21 A = 0.0760 B = 0.0920 Δ = -0.0160x = 8.43 A = 0.1080 B = 0.1240 Δ = -0.0160x = 8.65 A = 0.0860 B = 0.1100 Δ = -0.0240x = 8.87 A = 0.1040 B = 0.0780 Δ = 0.0260x = 9.09 A = 0.0600 B = 0.0740 Δ = -0.0140x = 9.31 A = 0.0720 B = 0.0600 Δ = 0.0120x = 9.53 A = 0.0360 B = 0.0200 Δ = 0.0160x = 9.75 A = 0.0260 B = 0.0120 Δ = 0.0140x = 9.97 A = 0.0160 B = 0.0200 Δ = -0.0040x = 10.2 A = 0.0060 B = 0.0080 Δ = -0.0020x = 10.4 A = 0.0080 B = 0.0040 Δ = 0.0040x = 10.6 A = 0.0040 B = 0.0020 Δ = 0.0020
beta[2]
reference stan24 bins · -0.02 … 0.06
00.060.060.120.1200.050.02 · 0.1060.02 · 0.124x = -0.02 A = 0.0060 B = 0.0020 Δ = 0.0040x = -0.01 A = 0.0040 B = 0.0040 Δ = 0.0000x = -0.01 A = 0.0100 B = 0.0120 Δ = -0.0020x = -0.01 A = 0.0140 B = 0.0160 Δ = -0.0020x = -0.00 A = 0.0340 B = 0.0200 Δ = 0.0140x = -0.00 A = 0.0360 B = 0.0220 Δ = 0.0140x = 0.00 A = 0.0640 B = 0.0440 Δ = 0.0200x = 0.01 A = 0.0740 B = 0.0960 Δ = -0.0220x = 0.01 A = 0.0920 B = 0.0760 Δ = 0.0160x = 0.01 A = 0.1040 B = 0.1120 Δ = -0.0080x = 0.02 A = 0.0900 B = 0.1240 Δ = -0.0340x = 0.02 A = 0.1060 B = 0.1100 Δ = -0.0040x = 0.02 A = 0.0720 B = 0.1000 Δ = -0.0280x = 0.03 A = 0.0660 B = 0.0820 Δ = -0.0160x = 0.03 A = 0.0860 B = 0.0680 Δ = 0.0180x = 0.03 A = 0.0480 B = 0.0480 Δ = 0.0000x = 0.04 A = 0.0520 B = 0.0360 Δ = 0.0160x = 0.04 A = 0.0160 B = 0.0080 Δ = 0.0080x = 0.04 A = 0.0080 B = 0.0060 Δ = 0.0020x = 0.05 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.05 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.05 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.06 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.06 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[3]
reference stan24 bins · -4.49 … 3.83
00.060.060.120.120-0.51 · 0.1180.21 · 0.112x = -4.49 A = 0.0020 B = 0.0020 Δ = 0.0000x = -4.13 A = 0.0000 B = 0.0000 Δ = 0.0000x = -3.77 A = 0.0000 B = 0.0060 Δ = -0.0060x = -3.41 A = 0.0040 B = 0.0020 Δ = 0.0020x = -3.04 A = 0.0060 B = 0.0060 Δ = 0.0000x = -2.68 A = 0.0120 B = 0.0060 Δ = 0.0060x = -2.32 A = 0.0220 B = 0.0240 Δ = -0.0020x = -1.96 A = 0.0460 B = 0.0240 Δ = 0.0220x = -1.60 A = 0.0620 B = 0.0460 Δ = 0.0160x = -1.24 A = 0.0800 B = 0.1000 Δ = -0.0200x = -0.87 A = 0.0840 B = 0.0740 Δ = 0.0100x = -0.51 A = 0.1180 B = 0.0920 Δ = 0.0260x = -0.15 A = 0.1160 B = 0.1040 Δ = 0.0120x = 0.21 A = 0.0960 B = 0.1120 Δ = -0.0160x = 0.57 A = 0.0880 B = 0.1060 Δ = -0.0180x = 0.93 A = 0.0700 B = 0.0840 Δ = -0.0140x = 1.29 A = 0.0760 B = 0.0900 Δ = -0.0140x = 1.66 A = 0.0480 B = 0.0640 Δ = -0.0160x = 2.02 A = 0.0320 B = 0.0220 Δ = 0.0100x = 2.38 A = 0.0160 B = 0.0160 Δ = 0.0000x = 2.74 A = 0.0060 B = 0.0100 Δ = -0.0040x = 3.10 A = 0.0140 B = 0.0100 Δ = 0.0040x = 3.46 A = 0.0000 B = 0.0000 Δ = 0.0000x = 3.83 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[4]
reference stan24 bins · -0.05 … 0.07
00.060.060.120.12-0.0500.050.00 · 0.1220.00 · 0.120x = -0.05 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.05 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.04 A = 0.0120 B = 0.0040 Δ = 0.0080x = -0.04 A = 0.0060 B = 0.0080 Δ = -0.0020x = -0.03 A = 0.0180 B = 0.0140 Δ = 0.0040x = -0.03 A = 0.0280 B = 0.0240 Δ = 0.0040x = -0.02 A = 0.0460 B = 0.0620 Δ = -0.0160x = -0.01 A = 0.0680 B = 0.0680 Δ = 0.0000x = -0.01 A = 0.0880 B = 0.1100 Δ = -0.0220x = -0.00 A = 0.0600 B = 0.0940 Δ = -0.0340x = 0.00 A = 0.1220 B = 0.1200 Δ = 0.0020x = 0.01 A = 0.0960 B = 0.1020 Δ = -0.0060x = 0.01 A = 0.1080 B = 0.0820 Δ = 0.0260x = 0.02 A = 0.1100 B = 0.1000 Δ = 0.0100x = 0.02 A = 0.0660 B = 0.0800 Δ = -0.0140x = 0.03 A = 0.0740 B = 0.0600 Δ = 0.0140x = 0.04 A = 0.0460 B = 0.0240 Δ = 0.0220x = 0.04 A = 0.0280 B = 0.0260 Δ = 0.0020x = 0.05 A = 0.0100 B = 0.0060 Δ = 0.0040x = 0.05 A = 0.0080 B = 0.0060 Δ = 0.0020x = 0.06 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.06 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.07 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.07 A = 0.0020 B = 0.0020 Δ = 0.0000
sigma
reference stan24 bins · 0.83 … 0.94
00.070.070.150.150.850.900.88 · 0.1180.88 · 0.146x = 0.83 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.83 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.84 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.84 A = 0.0080 B = 0.0060 Δ = 0.0020x = 0.85 A = 0.0120 B = 0.0040 Δ = 0.0080x = 0.85 A = 0.0220 B = 0.0400 Δ = -0.0180x = 0.86 A = 0.0260 B = 0.0240 Δ = 0.0020x = 0.86 A = 0.0700 B = 0.0560 Δ = 0.0140x = 0.86 A = 0.0660 B = 0.0820 Δ = -0.0160x = 0.87 A = 0.0900 B = 0.0900 Δ = 0.0000x = 0.87 A = 0.0860 B = 0.0820 Δ = 0.0040x = 0.88 A = 0.1180 B = 0.1140 Δ = 0.0040x = 0.88 A = 0.1020 B = 0.1460 Δ = -0.0440x = 0.89 A = 0.0660 B = 0.0860 Δ = -0.0200x = 0.89 A = 0.0880 B = 0.0720 Δ = 0.0160x = 0.90 A = 0.0700 B = 0.0620 Δ = 0.0080x = 0.90 A = 0.0580 B = 0.0380 Δ = 0.0200x = 0.91 A = 0.0260 B = 0.0240 Δ = 0.0020x = 0.91 A = 0.0320 B = 0.0420 Δ = -0.0100x = 0.92 A = 0.0200 B = 0.0180 Δ = 0.0020x = 0.92 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.93 A = 0.0100 B = 0.0060 Δ = 0.0040x = 0.93 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.94 A = 0.0040 B = 0.0000 Δ = 0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0429 ≤ tol 0.2225 · floors 0.0904/0.0758
posteriordb-earnings / logearn_interaction_z
answer record(beta[1], beta[2], beta[3], beta[4], sigma) stan pass 0.0025
00 statement source: posteriordb/earnings-logearn_interaction_z
given

For each of N = 1192 individuals, the data provide raw earnings (positive reals), height in inches, and a binary male indicator (1 for male, 0 for female). The model operates on log-transformed earnings and standardized height (computed by subtracting the sample mean and dividing by the sample standard deviation of the height data). An interaction term is formed as the product of standardized height and the male indicator. All four regression coefficients beta[1], beta[2], beta[3], beta[4] have a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals (0, infinity).

model

For each individual, the natural logarithm of earnings is normally distributed with a mean equal to the sum of an intercept (beta[1]), a coefficient (beta[2]) times the person's standardized height, a coefficient (beta[3]) times the male indicator, and a coefficient (beta[4]) times the interaction between standardized height and male indicator, with a common standard deviation sigma across all individuals.

query

The marginal posterior distributions of the five parameters: beta[1] (the intercept), beta[2] (the standardized height coefficient), beta[3] (the male indicator coefficient), beta[4] (the interaction coefficient), and sigma (the error standard deviation).

answer spec record(beta[1], beta[2], beta[3], beta[4], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.003
stan
1data {
2 int<lower=0> N;
3 vector[N] earn;
4 vector[N] height;
5 vector[N] male;
6}
7transformed data {
8 vector[N] log_earn; // log transformation
9 vector[N] z_height; // standardization
10 vector[N] inter; // interaction
11 log_earn = log(earn);
12 z_height = (height - mean(height)) / sd(height);
13 inter = z_height .* male;
14}
15parameters {
16 vector[4] beta;
17 real<lower=0> sigma;
18}
19model {
20 log_earn ~ normal(beta[1] + beta[2] * z_height + beta[3] * male
21 + beta[4] * inter, sigma);
22}
23
24//@ DATA { N: 1192, earn: [1192 values], height: [1192 values], male: [1192 values] } // values supplied at runtime
25//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","sigma"]
26//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
27
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], sigma)
beta[1]
reference stan24 bins · 9.41 … 9.68
00.060.060.130.139.509.609.52 · 0.1289.52 · 0.120x = 9.41 A = 0.0080 B = 0.0000 Δ = 0.0080x = 9.42 A = 0.0060 B = 0.0000 Δ = 0.0060x = 9.43 A = 0.0120 B = 0.0100 Δ = 0.0020x = 9.44 A = 0.0080 B = 0.0220 Δ = -0.0140x = 9.45 A = 0.0340 B = 0.0340 Δ = 0.0000x = 9.46 A = 0.0500 B = 0.0400 Δ = 0.0100x = 9.48 A = 0.0500 B = 0.0560 Δ = -0.0060x = 9.49 A = 0.0720 B = 0.0720 Δ = 0.0000x = 9.50 A = 0.0660 B = 0.0960 Δ = -0.0300x = 9.51 A = 0.1200 B = 0.0960 Δ = 0.0240x = 9.52 A = 0.1280 B = 0.1200 Δ = 0.0080x = 9.54 A = 0.0940 B = 0.1000 Δ = -0.0060x = 9.55 A = 0.1120 B = 0.0940 Δ = 0.0180x = 9.56 A = 0.0720 B = 0.0620 Δ = 0.0100x = 9.57 A = 0.0520 B = 0.0800 Δ = -0.0280x = 9.58 A = 0.0480 B = 0.0300 Δ = 0.0180x = 9.59 A = 0.0320 B = 0.0300 Δ = 0.0020x = 9.61 A = 0.0100 B = 0.0320 Δ = -0.0220x = 9.62 A = 0.0120 B = 0.0100 Δ = 0.0020x = 9.63 A = 0.0080 B = 0.0040 Δ = 0.0040x = 9.64 A = 0.0020 B = 0.0060 Δ = -0.0040x = 9.65 A = 0.0000 B = 0.0060 Δ = -0.0060x = 9.66 A = 0.0000 B = 0.0000 Δ = 0.0000x = 9.68 A = 0.0040 B = 0.0000 Δ = 0.0040
beta[2]
reference stan24 bins · -0.10 … 0.24
00.070.070.140.1400.200.08 · 0.1140.06 · 0.142x = -0.10 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.08 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.07 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.06 A = 0.0080 B = 0.0020 Δ = 0.0060x = -0.04 A = 0.0120 B = 0.0100 Δ = 0.0020x = -0.03 A = 0.0280 B = 0.0160 Δ = 0.0120x = -0.01 A = 0.0520 B = 0.0320 Δ = 0.0200x = 0.00 A = 0.0560 B = 0.0680 Δ = -0.0120x = 0.02 A = 0.0660 B = 0.0680 Δ = -0.0020x = 0.03 A = 0.0880 B = 0.1000 Δ = -0.0120x = 0.05 A = 0.1020 B = 0.1340 Δ = -0.0320x = 0.06 A = 0.1080 B = 0.1420 Δ = -0.0340x = 0.08 A = 0.1140 B = 0.1200 Δ = -0.0060x = 0.09 A = 0.1060 B = 0.0940 Δ = 0.0120x = 0.11 A = 0.0860 B = 0.0560 Δ = 0.0300x = 0.12 A = 0.0800 B = 0.0580 Δ = 0.0220x = 0.14 A = 0.0360 B = 0.0360 Δ = 0.0000x = 0.15 A = 0.0240 B = 0.0200 Δ = 0.0040x = 0.17 A = 0.0140 B = 0.0200 Δ = -0.0060x = 0.18 A = 0.0060 B = 0.0120 Δ = -0.0060x = 0.20 A = 0.0020 B = 0.0100 Δ = -0.0080x = 0.21 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.22 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.24 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[3]
reference stan24 bins · 0.22 … 0.66
00.060.060.130.130.400.600.43 · 0.1260.41 · 0.112x = 0.22 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.24 A = 0.0080 B = 0.0060 Δ = 0.0020x = 0.26 A = 0.0100 B = 0.0140 Δ = -0.0040x = 0.28 A = 0.0240 B = 0.0120 Δ = 0.0120x = 0.30 A = 0.0220 B = 0.0340 Δ = -0.0120x = 0.32 A = 0.0280 B = 0.0500 Δ = -0.0220x = 0.34 A = 0.0380 B = 0.0580 Δ = -0.0200x = 0.35 A = 0.0580 B = 0.0840 Δ = -0.0260x = 0.38 A = 0.0720 B = 0.0780 Δ = -0.0060x = 0.39 A = 0.1000 B = 0.0820 Δ = 0.0180x = 0.41 A = 0.0980 B = 0.1120 Δ = -0.0140x = 0.43 A = 0.1260 B = 0.1020 Δ = 0.0240x = 0.45 A = 0.1020 B = 0.1020 Δ = -0.0000x = 0.47 A = 0.0880 B = 0.0760 Δ = 0.0120x = 0.49 A = 0.0700 B = 0.0680 Δ = 0.0020x = 0.51 A = 0.0460 B = 0.0580 Δ = -0.0120x = 0.53 A = 0.0300 B = 0.0260 Δ = 0.0040x = 0.55 A = 0.0360 B = 0.0160 Δ = 0.0200x = 0.57 A = 0.0200 B = 0.0040 Δ = 0.0160x = 0.59 A = 0.0100 B = 0.0140 Δ = -0.0040x = 0.61 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.63 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.64 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.66 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[4]
reference stan24 bins · -0.23 … 0.28
00.070.070.130.13-0.2000.200.01 · 0.1320.04 · 0.132x = -0.23 A = 0.0060 B = 0.0000 Δ = 0.0060x = -0.20 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.18 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.16 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.14 A = 0.0040 B = 0.0100 Δ = -0.0060x = -0.12 A = 0.0120 B = 0.0140 Δ = -0.0020x = -0.10 A = 0.0380 B = 0.0240 Δ = 0.0140x = -0.07 A = 0.0380 B = 0.0300 Δ = 0.0080x = -0.05 A = 0.0540 B = 0.0760 Δ = -0.0220x = -0.03 A = 0.0780 B = 0.0720 Δ = 0.0060x = -0.01 A = 0.1300 B = 0.1120 Δ = 0.0180x = 0.01 A = 0.1320 B = 0.1020 Δ = 0.0300x = 0.04 A = 0.1120 B = 0.1320 Δ = -0.0200x = 0.06 A = 0.0940 B = 0.1080 Δ = -0.0140x = 0.08 A = 0.0960 B = 0.1060 Δ = -0.0100x = 0.10 A = 0.0780 B = 0.0840 Δ = -0.0060x = 0.12 A = 0.0480 B = 0.0700 Δ = -0.0220x = 0.15 A = 0.0180 B = 0.0220 Δ = -0.0040x = 0.17 A = 0.0340 B = 0.0220 Δ = 0.0120x = 0.19 A = 0.0160 B = 0.0060 Δ = 0.0100x = 0.21 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.23 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.26 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.28 A = 0.0020 B = 0.0000 Δ = 0.0020
sigma
reference stan24 bins · 0.83 … 0.96
00.070.070.130.130.850.900.950.88 · 0.1340.88 · 0.128x = 0.83 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.83 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.84 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.84 A = 0.0120 B = 0.0180 Δ = -0.0060x = 0.85 A = 0.0280 B = 0.0400 Δ = -0.0120x = 0.86 A = 0.0500 B = 0.0580 Δ = -0.0080x = 0.86 A = 0.0720 B = 0.0600 Δ = 0.0120x = 0.87 A = 0.0680 B = 0.0740 Δ = -0.0060x = 0.87 A = 0.1280 B = 0.1160 Δ = 0.0120x = 0.88 A = 0.1160 B = 0.1280 Δ = -0.0120x = 0.88 A = 0.1340 B = 0.1280 Δ = 0.0060x = 0.89 A = 0.0900 B = 0.0860 Δ = 0.0040x = 0.89 A = 0.1080 B = 0.0860 Δ = 0.0220x = 0.90 A = 0.0800 B = 0.0620 Δ = 0.0180x = 0.91 A = 0.0400 B = 0.0460 Δ = -0.0060x = 0.91 A = 0.0280 B = 0.0400 Δ = -0.0120x = 0.92 A = 0.0200 B = 0.0240 Δ = -0.0040x = 0.92 A = 0.0120 B = 0.0080 Δ = 0.0040x = 0.93 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.93 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.94 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.94 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.95 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.96 A = 0.0000 B = 0.0020 Δ = -0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0025 ≤ tol 0.0119 · floors 0.0043/0.0039
posteriordb-earnings / logearn_logheight_male
answer record(beta[1], beta[2], beta[3], sigma) stan pass 0.0910
00 statement source: posteriordb/earnings-logearn_logheight_male
given

For each of N = 1192 workers the data provide the worker's earnings (a positive real value), height in inches (a positive real value), and a binary indicator of male gender. The model operates on the natural logarithm of earnings and the natural logarithm of height. The regression has three coefficients: an intercept, a slope on log-transformed height, and a slope on the male indicator, each with a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each worker's log-transformed earnings is Normal-distributed with a mean equal to the intercept plus the slope for log-transformed height times that worker's log-transformed height, plus the slope for male status times that worker's male indicator (0 if female, 1 if male), and a common standard deviation sigma across all workers.

query

The marginal posterior distribution of each of the four parameters: the intercept (reported as beta[1]), the slope on log-transformed height (reported as beta[2]), the slope on the male indicator (reported as beta[3]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.091
stan
1data {
2 int<lower=0> N;
3 vector[N] earn;
4 vector[N] height;
5 vector[N] male;
6}
7transformed data {
8 vector[N] log_earn; // log transformations
9 vector[N] log_height;
10 log_earn = log(earn);
11 log_height = log(height);
12}
13parameters {
14 vector[3] beta;
15 real<lower=0> sigma;
16}
17model {
18 // vectorization
19 log_earn ~ normal(beta[1] + beta[2] * log_height + beta[3] * male, sigma);
20}
21
22//@ DATA { N: 1192, earn: [1192 values], height: [1192 values], male: [1192 values] } // values supplied at runtime
23//@ PARAMS ["beta[1]","beta[2]","beta[3]","sigma"]
24//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
25
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], sigma)
beta[1]
reference stan24 bins · -3.35 … 10.8
00.060.060.120.120104.03 · 0.1062.18 · 0.118x = -3.35 A = 0.0040 B = 0.0040 Δ = 0.0000x = -2.74 A = 0.0040 B = 0.0060 Δ = -0.0020x = -2.12 A = 0.0100 B = 0.0040 Δ = 0.0060x = -1.51 A = 0.0080 B = 0.0280 Δ = -0.0200x = -0.89 A = 0.0260 B = 0.0200 Δ = 0.0060x = -0.28 A = 0.0360 B = 0.0320 Δ = 0.0040x = 0.34 A = 0.0460 B = 0.0500 Δ = -0.0040x = 0.95 A = 0.0580 B = 0.0520 Δ = 0.0060x = 1.57 A = 0.0740 B = 0.0540 Δ = 0.0200x = 2.18 A = 0.0860 B = 0.1180 Δ = -0.0320x = 2.80 A = 0.0740 B = 0.0880 Δ = -0.0140x = 3.41 A = 0.0660 B = 0.1180 Δ = -0.0520x = 4.03 A = 0.1060 B = 0.0980 Δ = 0.0080x = 4.64 A = 0.0940 B = 0.0860 Δ = 0.0080x = 5.26 A = 0.0720 B = 0.0680 Δ = 0.0040x = 5.87 A = 0.0700 B = 0.0480 Δ = 0.0220x = 6.49 A = 0.0480 B = 0.0480 Δ = 0.0000x = 7.10 A = 0.0360 B = 0.0280 Δ = 0.0080x = 7.72 A = 0.0360 B = 0.0160 Δ = 0.0200x = 8.33 A = 0.0160 B = 0.0080 Δ = 0.0080x = 8.95 A = 0.0140 B = 0.0080 Δ = 0.0060x = 9.56 A = 0.0100 B = 0.0080 Δ = 0.0020x = 10.2 A = 0.0020 B = 0.0040 Δ = -0.0020x = 10.8 A = 0.0040 B = 0.0060 Δ = -0.0020
beta[2]
reference stan24 bins · -0.32 … 3.08
00.060.060.120.12021.30 · 0.1021.45 · 0.118x = -0.32 A = 0.0040 B = 0.0060 Δ = -0.0020x = -0.17 A = 0.0020 B = 0.0040 Δ = -0.0020x = -0.03 A = 0.0100 B = 0.0080 Δ = 0.0020x = 0.12 A = 0.0140 B = 0.0080 Δ = 0.0060x = 0.27 A = 0.0140 B = 0.0080 Δ = 0.0060x = 0.42 A = 0.0340 B = 0.0160 Δ = 0.0180x = 0.57 A = 0.0380 B = 0.0280 Δ = 0.0100x = 0.71 A = 0.0480 B = 0.0480 Δ = -0.0000x = 0.86 A = 0.0660 B = 0.0480 Δ = 0.0180x = 1.01 A = 0.0720 B = 0.0620 Δ = 0.0100x = 1.16 A = 0.1000 B = 0.0880 Δ = 0.0120x = 1.30 A = 0.1020 B = 0.0980 Δ = 0.0040x = 1.45 A = 0.0660 B = 0.1180 Δ = -0.0520x = 1.60 A = 0.0800 B = 0.0880 Δ = -0.0080x = 1.75 A = 0.0820 B = 0.1160 Δ = -0.0340x = 1.90 A = 0.0720 B = 0.0640 Δ = 0.0080x = 2.04 A = 0.0600 B = 0.0480 Δ = 0.0120x = 2.19 A = 0.0480 B = 0.0480 Δ = -0.0000x = 2.34 A = 0.0360 B = 0.0360 Δ = 0.0000x = 2.49 A = 0.0260 B = 0.0180 Δ = 0.0080x = 2.63 A = 0.0060 B = 0.0280 Δ = -0.0220x = 2.78 A = 0.0120 B = 0.0040 Δ = 0.0080x = 2.93 A = 0.0060 B = 0.0060 Δ = 0.0000x = 3.08 A = 0.0020 B = 0.0040 Δ = -0.0020
beta[3]
reference stan24 bins · 0.20 … 0.63
00.060.060.120.120.400.600.42 · 0.1100.42 · 0.122x = 0.20 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.22 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.24 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.26 A = 0.0040 B = 0.0100 Δ = -0.0060x = 0.28 A = 0.0060 B = 0.0120 Δ = -0.0060x = 0.29 A = 0.0280 B = 0.0240 Δ = 0.0040x = 0.31 A = 0.0400 B = 0.0520 Δ = -0.0120x = 0.33 A = 0.0560 B = 0.0420 Δ = 0.0140x = 0.35 A = 0.0600 B = 0.0500 Δ = 0.0100x = 0.37 A = 0.0900 B = 0.0920 Δ = -0.0020x = 0.39 A = 0.0800 B = 0.1080 Δ = -0.0280x = 0.41 A = 0.1060 B = 0.1140 Δ = -0.0080x = 0.42 A = 0.1100 B = 0.1220 Δ = -0.0120x = 0.44 A = 0.0960 B = 0.0860 Δ = 0.0100x = 0.46 A = 0.0800 B = 0.0660 Δ = 0.0140x = 0.48 A = 0.0700 B = 0.0580 Δ = 0.0120x = 0.50 A = 0.0560 B = 0.0560 Δ = 0.0000x = 0.52 A = 0.0240 B = 0.0340 Δ = -0.0100x = 0.54 A = 0.0400 B = 0.0260 Δ = 0.0140x = 0.55 A = 0.0340 B = 0.0200 Δ = 0.0140x = 0.57 A = 0.0080 B = 0.0100 Δ = -0.0020x = 0.59 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.61 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.63 A = 0.0020 B = 0.0020 Δ = 0.0000
sigma
reference stan24 bins · 0.84 … 0.95
00.060.060.120.120.850.900.950.88 · 0.1240.89 · 0.120x = 0.84 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.84 A = 0.0080 B = 0.0040 Δ = 0.0040x = 0.85 A = 0.0120 B = 0.0180 Δ = -0.0060x = 0.85 A = 0.0280 B = 0.0200 Δ = 0.0080x = 0.86 A = 0.0480 B = 0.0300 Δ = 0.0180x = 0.86 A = 0.0480 B = 0.0460 Δ = 0.0020x = 0.87 A = 0.0960 B = 0.0580 Δ = 0.0380x = 0.87 A = 0.1080 B = 0.1080 Δ = 0.0000x = 0.88 A = 0.1140 B = 0.1100 Δ = 0.0040x = 0.88 A = 0.1240 B = 0.0980 Δ = 0.0260x = 0.89 A = 0.0940 B = 0.1200 Δ = -0.0260x = 0.89 A = 0.0980 B = 0.0880 Δ = 0.0100x = 0.90 A = 0.0720 B = 0.0720 Δ = 0.0000x = 0.90 A = 0.0520 B = 0.0720 Δ = -0.0200x = 0.91 A = 0.0440 B = 0.0620 Δ = -0.0180x = 0.91 A = 0.0200 B = 0.0380 Δ = -0.0180x = 0.92 A = 0.0080 B = 0.0160 Δ = -0.0080x = 0.92 A = 0.0080 B = 0.0240 Δ = -0.0160x = 0.93 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.93 A = 0.0080 B = 0.0100 Δ = -0.0020x = 0.94 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.94 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.95 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.95 A = 0.0000 B = 0.0020 Δ = -0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0910 ≤ tol 0.4362 · floors 0.2181/0.1353
posteriordb-eight_schools / eight_schools_noncentered
answer record(theta[1], theta[2], theta[3], theta[4], theta[5], theta[6], theta[7], theta[8], mu, tau) stan pass 0.2568
00 statement source: posteriordb/eight_schools-eight_schools_noncentered
given

Eight schools each ran an SAT-coaching program. For school j (j = 1..8) a separate analysis produced an estimated treatment effect y_j on test scores together with the known standard error sigma_j of that estimate (each sigma_j is positive); the eight estimates and their eight standard errors are provided as data (J = 8). The population mean mu has a Normal(mean 0, sd 5) prior. The population standard deviation tau, constrained to be positive, has a half-Cauchy(location 0, scale 5) prior.

model

Each school has an unknown true coaching effect theta_j, drawn independently from a Normal distribution with mean mu and standard deviation tau. The observed estimate y_j is then Normal-distributed around that true effect theta_j with the school's known standard error sigma_j.

query

The marginal posterior distribution of each parameter given the data: the population mean mu, the population standard deviation tau, and the eight true school effects theta_1, ..., theta_8.

answer spec record(theta[1], theta[2], theta[3], theta[4], theta[5], theta[6], theta[7], theta[8], mu, tau)
{
  "kind": "record",
  "fields": {
    "theta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "mu": {
      "kind": "dist",
      "domain": "real"
    },
    "tau": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.257
stan
1data {
2 int<lower=0> J; // number of schools
3 array[J] real y; // estimated treatment
4 array[J] real<lower=0> sigma; // std of estimated effect
5}
6parameters {
7 vector[J] theta_trans; // transformation of theta
8 real mu; // hyper-parameter of mean
9 real<lower=0> tau; // hyper-parameter of sd
10}
11transformed parameters {
12 vector[J] theta;
13 // original theta
14 theta = theta_trans * tau + mu;
15}
16model {
17 theta_trans ~ normal(0, 1);
18 y ~ normal(theta, sigma);
19 mu ~ normal(0, 5); // a non-informative prior
20 tau ~ cauchy(0, 5);
21}
22
23//@ DATA { J: 8, y: [8 values], sigma: [8 values] } // values supplied at runtime
24//@ PARAMS ["theta[1]","theta[2]","theta[3]","theta[4]","theta[5]","theta[6]","theta[7]","theta[8]","mu","tau"]
25//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
26
02answer overlay — reference vs stanrecord(theta[1], theta[2], theta[3], theta[4], theta[5], theta[6], theta[7], theta[8], mu, tau)
theta[1]
reference stan24 bins · -13.7 … 33.6
00.100.100.200.200204.80 · 0.1846.90 · 0.202x = -13.7 A = 0.0020 B = 0.0000 Δ = 0.0020x = -11.7 A = 0.0000 B = 0.0000 Δ = 0.0000x = -9.60 A = 0.0020 B = 0.0020 Δ = 0.0000x = -7.60 A = 0.0000 B = 0.0000 Δ = 0.0000x = -5.50 A = 0.0120 B = 0.0060 Δ = 0.0060x = -3.40 A = 0.0100 B = 0.0260 Δ = -0.0160x = -1.40 A = 0.0400 B = 0.0460 Δ = -0.0060x = 0.70 A = 0.1340 B = 0.0860 Δ = 0.0480x = 2.70 A = 0.1560 B = 0.1660 Δ = -0.0100x = 4.80 A = 0.1840 B = 0.1640 Δ = 0.0200x = 6.90 A = 0.1740 B = 0.2020 Δ = -0.0280x = 8.90 A = 0.0940 B = 0.1000 Δ = -0.0060x = 11 A = 0.0800 B = 0.0760 Δ = 0.0040x = 13 A = 0.0340 B = 0.0400 Δ = -0.0060x = 15.1 A = 0.0300 B = 0.0400 Δ = -0.0100x = 17.1 A = 0.0180 B = 0.0160 Δ = 0.0020x = 19.2 A = 0.0060 B = 0.0060 Δ = 0.0000x = 21.3 A = 0.0080 B = 0.0100 Δ = -0.0020x = 23.3 A = 0.0040 B = 0.0080 Δ = -0.0040x = 25.4 A = 0.0020 B = 0.0000 Δ = 0.0020x = 27.4 A = 0.0040 B = 0.0020 Δ = 0.0020x = 29.5 A = 0.0040 B = 0.0000 Δ = 0.0040x = 31.6 A = 0.0000 B = 0.0040 Δ = -0.0040x = 33.6 A = 0.0020 B = 0.0000 Δ = 0.0020
theta[2]
reference stan24 bins · -18 … 25
00.090.090.180.180204.40 · 0.1724.40 · 0.182x = -18 A = 0.0020 B = 0.0000 Δ = 0.0020x = -16.1 A = 0.0000 B = 0.0000 Δ = 0.0000x = -14.3 A = 0.0000 B = 0.0020 Δ = -0.0020x = -12.4 A = 0.0020 B = 0.0000 Δ = 0.0020x = -10.5 A = 0.0000 B = 0.0020 Δ = -0.0020x = -8.60 A = 0.0040 B = 0.0040 Δ = 0.0000x = -6.80 A = 0.0120 B = 0.0080 Δ = 0.0040x = -4.90 A = 0.0220 B = 0.0100 Δ = 0.0120x = -3 A = 0.0280 B = 0.0400 Δ = -0.0120x = -1.20 A = 0.0680 B = 0.0720 Δ = -0.0040x = 0.70 A = 0.0940 B = 0.1120 Δ = -0.0180x = 2.60 A = 0.1480 B = 0.1240 Δ = 0.0240x = 4.40 A = 0.1720 B = 0.1820 Δ = -0.0100x = 6.30 A = 0.1520 B = 0.1620 Δ = -0.0100x = 8.20 A = 0.1340 B = 0.1200 Δ = 0.0140x = 10.1 A = 0.0760 B = 0.0840 Δ = -0.0080x = 11.9 A = 0.0360 B = 0.0340 Δ = 0.0020x = 13.8 A = 0.0240 B = 0.0200 Δ = 0.0040x = 15.7 A = 0.0160 B = 0.0060 Δ = 0.0100x = 17.5 A = 0.0020 B = 0.0120 Δ = -0.0100x = 19.4 A = 0.0000 B = 0.0000 Δ = 0.0000x = 21.3 A = 0.0060 B = 0.0020 Δ = 0.0040x = 23.1 A = 0.0000 B = 0.0040 Δ = -0.0040x = 25 A = 0.0020 B = 0.0000 Δ = 0.0020
theta[3]
reference stan24 bins · -21.8 … 23.3
00.090.090.190.19-200205.70 · 0.1843.70 · 0.188x = -21.8 A = 0.0020 B = 0.0000 Δ = 0.0020x = -19.9 A = 0.0000 B = 0.0000 Δ = 0.0000x = -17.9 A = 0.0020 B = 0.0020 Δ = 0.0000x = -15.9 A = 0.0020 B = 0.0020 Δ = 0.0000x = -14 A = 0.0060 B = 0.0060 Δ = 0.0000x = -12 A = 0.0040 B = 0.0000 Δ = 0.0040x = -10.1 A = 0.0040 B = 0.0140 Δ = -0.0100x = -8.10 A = 0.0160 B = 0.0060 Δ = 0.0100x = -6.10 A = 0.0220 B = 0.0260 Δ = -0.0040x = -4.20 A = 0.0360 B = 0.0240 Δ = 0.0120x = -2.20 A = 0.0540 B = 0.0480 Δ = 0.0060x = -0.20 A = 0.0740 B = 0.1000 Δ = -0.0260x = 1.70 A = 0.1580 B = 0.1480 Δ = 0.0100x = 3.70 A = 0.1580 B = 0.1880 Δ = -0.0300x = 5.70 A = 0.1840 B = 0.1500 Δ = 0.0340x = 7.60 A = 0.1160 B = 0.1320 Δ = -0.0160x = 9.60 A = 0.0840 B = 0.0740 Δ = 0.0100x = 11.6 A = 0.0380 B = 0.0420 Δ = -0.0040x = 13.5 A = 0.0180 B = 0.0140 Δ = 0.0040x = 15.5 A = 0.0120 B = 0.0060 Δ = 0.0060x = 17.4 A = 0.0060 B = 0.0100 Δ = -0.0040x = 19.4 A = 0.0020 B = 0.0020 Δ = 0.0000x = 21.4 A = 0.0000 B = 0.0060 Δ = -0.0060x = 23.3 A = 0.0020 B = 0.0000 Δ = 0.0020
theta[4]
reference stan24 bins · -18.3 … 21.3
00.090.090.180.180204.10 · 0.1764.10 · 0.182x = -18.3 A = 0.0000 B = 0.0020 Δ = -0.0020x = -16.6 A = 0.0000 B = 0.0000 Δ = 0.0000x = -14.9 A = 0.0000 B = 0.0000 Δ = 0.0000x = -13.1 A = 0.0020 B = 0.0020 Δ = 0.0000x = -11.4 A = 0.0020 B = 0.0000 Δ = 0.0020x = -9.70 A = 0.0020 B = 0.0060 Δ = -0.0040x = -8 A = 0.0060 B = 0.0020 Δ = 0.0040x = -6.20 A = 0.0180 B = 0.0100 Δ = 0.0080x = -4.50 A = 0.0160 B = 0.0220 Δ = -0.0060x = -2.80 A = 0.0260 B = 0.0360 Δ = -0.0100x = -1.10 A = 0.0480 B = 0.0540 Δ = -0.0060x = 0.60 A = 0.0860 B = 0.0900 Δ = -0.0040x = 2.40 A = 0.1220 B = 0.1320 Δ = -0.0100x = 4.10 A = 0.1760 B = 0.1820 Δ = -0.0060x = 5.80 A = 0.1540 B = 0.1460 Δ = 0.0080x = 7.50 A = 0.1360 B = 0.1100 Δ = 0.0260x = 9.30 A = 0.1040 B = 0.0880 Δ = 0.0160x = 11 A = 0.0400 B = 0.0640 Δ = -0.0240x = 12.7 A = 0.0240 B = 0.0280 Δ = -0.0040x = 14.4 A = 0.0100 B = 0.0200 Δ = -0.0100x = 16.2 A = 0.0120 B = 0.0040 Δ = 0.0080x = 17.9 A = 0.0060 B = 0.0020 Δ = 0.0040x = 19.6 A = 0.0080 B = 0.0000 Δ = 0.0080x = 21.3 A = 0.0020 B = 0.0000 Δ = 0.0020
theta[5]
reference stan24 bins · -14.7 … 19.5
00.080.080.160.1606.10 · 0.1583.10 · 0.150x = -14.7 A = 0.0000 B = 0.0060 Δ = -0.0060x = -13.3 A = 0.0060 B = 0.0020 Δ = 0.0040x = -11.8 A = 0.0020 B = 0.0040 Δ = -0.0020x = -10.3 A = 0.0000 B = 0.0080 Δ = -0.0080x = -8.80 A = 0.0060 B = 0.0000 Δ = 0.0060x = -7.30 A = 0.0120 B = 0.0040 Δ = 0.0080x = -5.80 A = 0.0220 B = 0.0120 Δ = 0.0100x = -4.30 A = 0.0140 B = 0.0200 Δ = -0.0060x = -2.80 A = 0.0300 B = 0.0480 Δ = -0.0180x = -1.40 A = 0.0480 B = 0.0660 Δ = -0.0180x = 0.10 A = 0.0980 B = 0.0820 Δ = 0.0160x = 1.60 A = 0.1080 B = 0.0980 Δ = 0.0100x = 3.10 A = 0.1540 B = 0.1500 Δ = 0.0040x = 4.60 A = 0.1020 B = 0.1240 Δ = -0.0220x = 6.10 A = 0.1580 B = 0.1280 Δ = 0.0300x = 7.60 A = 0.0980 B = 0.1040 Δ = -0.0060x = 9.10 A = 0.0660 B = 0.0620 Δ = 0.0040x = 10.6 A = 0.0360 B = 0.0440 Δ = -0.0080x = 12 A = 0.0260 B = 0.0240 Δ = 0.0020x = 13.5 A = 0.0080 B = 0.0060 Δ = 0.0020x = 15 A = 0.0000 B = 0.0060 Δ = -0.0060x = 16.5 A = 0.0020 B = 0.0000 Δ = 0.0020x = 18 A = 0.0000 B = 0.0020 Δ = -0.0020x = 19.5 A = 0.0040 B = 0.0000 Δ = 0.0040
theta[6]
reference stan24 bins · -17.8 … 23.5
00.090.090.170.170203.70 · 0.1743.70 · 0.168x = -17.8 A = 0.0000 B = 0.0020 Δ = -0.0020x = -16 A = 0.0020 B = 0.0000 Δ = 0.0020x = -14.2 A = 0.0040 B = 0.0020 Δ = 0.0020x = -12.4 A = 0.0020 B = 0.0040 Δ = -0.0020x = -10.6 A = 0.0000 B = 0.0040 Δ = -0.0040x = -8.80 A = 0.0160 B = 0.0040 Δ = 0.0120x = -7 A = 0.0040 B = 0.0120 Δ = -0.0080x = -5.30 A = 0.0100 B = 0.0180 Δ = -0.0080x = -3.50 A = 0.0280 B = 0.0260 Δ = 0.0020x = -1.70 A = 0.0620 B = 0.0760 Δ = -0.0140x = 0.10 A = 0.1060 B = 0.0820 Δ = 0.0240x = 1.90 A = 0.1220 B = 0.1300 Δ = -0.0080x = 3.70 A = 0.1740 B = 0.1680 Δ = 0.0060x = 5.50 A = 0.1600 B = 0.1500 Δ = 0.0100x = 7.30 A = 0.1260 B = 0.1160 Δ = 0.0100x = 9.10 A = 0.0960 B = 0.0900 Δ = 0.0060x = 10.9 A = 0.0440 B = 0.0580 Δ = -0.0140x = 12.7 A = 0.0280 B = 0.0280 Δ = 0.0000x = 14.5 A = 0.0080 B = 0.0140 Δ = -0.0060x = 16.3 A = 0.0040 B = 0.0060 Δ = -0.0020x = 18.1 A = 0.0020 B = 0.0040 Δ = -0.0020x = 19.9 A = 0.0020 B = 0.0000 Δ = 0.0020x = 21.7 A = 0.0000 B = 0.0040 Δ = -0.0040x = 23.5 A = 0.0000 B = 0.0020 Δ = -0.0020
theta[7]
reference stan24 bins · -7.30 … 30.7
00.090.090.190.190204.20 · 0.1505.90 · 0.188x = -7.30 A = 0.0020 B = 0.0000 Δ = 0.0020x = -5.70 A = 0.0060 B = 0.0000 Δ = 0.0060x = -4 A = 0.0120 B = 0.0160 Δ = -0.0040x = -2.40 A = 0.0140 B = 0.0280 Δ = -0.0140x = -0.70 A = 0.0420 B = 0.0440 Δ = -0.0020x = 0.90 A = 0.0840 B = 0.0820 Δ = 0.0020x = 2.60 A = 0.1200 B = 0.1200 Δ = 0.0000x = 4.20 A = 0.1500 B = 0.1160 Δ = 0.0340x = 5.90 A = 0.1460 B = 0.1880 Δ = -0.0420x = 7.50 A = 0.1380 B = 0.1460 Δ = -0.0080x = 9.20 A = 0.0940 B = 0.0680 Δ = 0.0260x = 10.8 A = 0.0660 B = 0.0640 Δ = 0.0020x = 12.5 A = 0.0340 B = 0.0380 Δ = -0.0040x = 14.2 A = 0.0280 B = 0.0160 Δ = 0.0120x = 15.8 A = 0.0180 B = 0.0200 Δ = -0.0020x = 17.5 A = 0.0180 B = 0.0160 Δ = 0.0020x = 19.1 A = 0.0080 B = 0.0120 Δ = -0.0040x = 20.8 A = 0.0060 B = 0.0120 Δ = -0.0060x = 22.4 A = 0.0020 B = 0.0080 Δ = -0.0060x = 24.1 A = 0.0080 B = 0.0020 Δ = 0.0060x = 25.7 A = 0.0000 B = 0.0000 Δ = 0.0000x = 27.4 A = 0.0020 B = 0.0000 Δ = 0.0020x = 29 A = 0.0000 B = 0.0020 Δ = -0.0020x = 30.7 A = 0.0020 B = 0.0020 Δ = 0.0000
theta[8]
reference stan24 bins · -17.2 … 39
00.130.130.260.260204.80 · 0.2404.80 · 0.256x = -17.2 A = 0.0000 B = 0.0040 Δ = -0.0040x = -14.7 A = 0.0000 B = 0.0000 Δ = 0.0000x = -12.3 A = 0.0020 B = 0.0040 Δ = -0.0020x = -9.90 A = 0.0040 B = 0.0000 Δ = 0.0040x = -7.40 A = 0.0080 B = 0.0120 Δ = -0.0040x = -5 A = 0.0300 B = 0.0360 Δ = -0.0060x = -2.50 A = 0.0420 B = 0.0720 Δ = -0.0300x = -0.10 A = 0.0920 B = 0.0860 Δ = 0.0060x = 2.40 A = 0.1960 B = 0.1500 Δ = 0.0460x = 4.80 A = 0.2400 B = 0.2560 Δ = -0.0160x = 7.20 A = 0.1760 B = 0.1720 Δ = 0.0040x = 9.70 A = 0.1080 B = 0.1040 Δ = 0.0040x = 12.1 A = 0.0540 B = 0.0440 Δ = 0.0100x = 14.6 A = 0.0200 B = 0.0320 Δ = -0.0120x = 17 A = 0.0160 B = 0.0100 Δ = 0.0060x = 19.5 A = 0.0020 B = 0.0080 Δ = -0.0060x = 21.9 A = 0.0020 B = 0.0060 Δ = -0.0040x = 24.3 A = 0.0020 B = 0.0020 Δ = 0.0000x = 26.8 A = 0.0040 B = 0.0000 Δ = 0.0040x = 29.2 A = 0.0020 B = 0.0000 Δ = 0.0020x = 31.7 A = 0.0000 B = 0.0000 Δ = 0.0000x = 34.1 A = 0.0000 B = 0.0000 Δ = 0.0000x = 36.6 A = 0.0000 B = 0.0000 Δ = 0.0000x = 39 A = 0.0000 B = 0.0020 Δ = -0.0020
mu
reference stan24 bins · -6.41 … 13.8
00.070.070.130.130105.91 · 0.1304.15 · 0.134x = -6.41 A = 0.0040 B = 0.0000 Δ = 0.0040x = -5.53 A = 0.0000 B = 0.0020 Δ = -0.0020x = -4.65 A = 0.0020 B = 0.0020 Δ = 0.0000x = -3.77 A = 0.0040 B = 0.0080 Δ = -0.0040x = -2.89 A = 0.0120 B = 0.0080 Δ = 0.0040x = -2.01 A = 0.0180 B = 0.0220 Δ = -0.0040x = -1.13 A = 0.0200 B = 0.0260 Δ = -0.0060x = -0.25 A = 0.0340 B = 0.0340 Δ = 0.0000x = 0.63 A = 0.0560 B = 0.0460 Δ = 0.0100x = 1.51 A = 0.0820 B = 0.0700 Δ = 0.0120x = 2.39 A = 0.0700 B = 0.0940 Δ = -0.0240x = 3.27 A = 0.0920 B = 0.0980 Δ = -0.0060x = 4.15 A = 0.1000 B = 0.1340 Δ = -0.0340x = 5.03 A = 0.1200 B = 0.0960 Δ = 0.0240x = 5.91 A = 0.1300 B = 0.0960 Δ = 0.0340x = 6.79 A = 0.0700 B = 0.0780 Δ = -0.0080x = 7.67 A = 0.0380 B = 0.0660 Δ = -0.0280x = 8.55 A = 0.0420 B = 0.0340 Δ = 0.0080x = 9.43 A = 0.0340 B = 0.0260 Δ = 0.0080x = 10.3 A = 0.0340 B = 0.0200 Δ = 0.0140x = 11.2 A = 0.0200 B = 0.0120 Δ = 0.0080x = 12.1 A = 0.0040 B = 0.0160 Δ = -0.0120x = 12.9 A = 0.0120 B = 0.0080 Δ = 0.0040x = 13.8 A = 0.0020 B = 0.0040 Δ = -0.0020
tau
reference stan24 bins · 0.46 … 21.3
00.110.110.210.2110201.36 · 0.2120.46 · 0.198x = 0.46 A = 0.1680 B = 0.1980 Δ = -0.0300x = 1.36 A = 0.2120 B = 0.1660 Δ = 0.0460x = 2.27 A = 0.1440 B = 0.1320 Δ = 0.0120x = 3.18 A = 0.1040 B = 0.1200 Δ = -0.0160x = 4.08 A = 0.0740 B = 0.0880 Δ = -0.0140x = 4.99 A = 0.0660 B = 0.0880 Δ = -0.0220x = 5.90 A = 0.0460 B = 0.0460 Δ = 0.0000x = 6.80 A = 0.0480 B = 0.0280 Δ = 0.0200x = 7.71 A = 0.0380 B = 0.0320 Δ = 0.0060x = 8.61 A = 0.0320 B = 0.0300 Δ = 0.0020x = 9.52 A = 0.0120 B = 0.0140 Δ = -0.0020x = 10.4 A = 0.0160 B = 0.0140 Δ = 0.0020x = 11.3 A = 0.0080 B = 0.0080 Δ = 0.0000x = 12.2 A = 0.0080 B = 0.0000 Δ = 0.0080x = 13.1 A = 0.0080 B = 0.0060 Δ = 0.0020x = 14.1 A = 0.0060 B = 0.0080 Δ = -0.0020x = 15.0 A = 0.0000 B = 0.0060 Δ = -0.0060x = 15.9 A = 0.0020 B = 0.0020 Δ = 0.0000x = 16.8 A = 0.0020 B = 0.0020 Δ = 0.0000x = 17.7 A = 0.0020 B = 0.0020 Δ = 0.0000x = 18.6 A = 0.0000 B = 0.0020 Δ = -0.0020x = 19.5 A = 0.0020 B = 0.0040 Δ = -0.0020x = 20.4 A = 0.0000 B = 0.0020 Δ = -0.0020x = 21.3 A = 0.0020 B = 0.0020 Δ = 0.0000
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.2568 ≤ tol 0.8077 · floors 0.3903/0.4039
posteriordb-garch / garch11
answer record(mu, alpha0, alpha1, beta1) stan pass 0.0185
00 statement source: posteriordb/garch-garch11
given

The data consist of T time series observations y[1], y[2], ..., y[T] of real values, and a positive real initial conditional standard deviation sigma1 at time 1. The model has four parameters, each with a flat improper uniform prior: mu over the real line; alpha0 constrained positive over (0, infinity) with a flat improper uniform prior; alpha1 constrained to the interval [0, 1] with a flat improper uniform prior; and beta1 constrained to [0, 1 - alpha1] with a flat improper uniform prior.

model

This is a GARCH(1,1) model for conditional heteroscedasticity in time series. The conditional standard deviation at time 1 is fixed at the given value sigma1. For each time t from 2 to T, the conditional standard deviation evolves according to the recursion: sigma[t] equals the square root of alpha0 plus alpha1 times the squared deviation of the previous observation from mu, plus beta1 times the square of the previous conditional standard deviation. Each observation y[t] is generated from a normal distribution with mean mu and standard deviation sigma[t].

query

The marginal posterior distributions of the four parameters: mu (the mean), alpha0 (the intercept of the conditional variance), alpha1 (the lagged squared residual coefficient), and beta1 (the lagged conditional variance coefficient).

answer spec record(mu, alpha0, alpha1, beta1)
{
  "kind": "record",
  "fields": {
    "mu": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha0": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha1": {
      "kind": "dist",
      "domain": "real"
    },
    "beta1": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.019
stan
1data {
2 int<lower=0> T;
3 array[T] real y;
4 real<lower=0> sigma1;
5}
6parameters {
7 real mu;
8 real<lower=0> alpha0;
9 real<lower=0, upper=1> alpha1;
10 real<lower=0, upper=(1 - alpha1)> beta1;
11}
12model {
13 array[T] real sigma;
14 sigma[1] = sigma1;
15 for (t in 2 : T) {
16 sigma[t] = sqrt(alpha0 + alpha1 * square(y[t - 1] - mu)
17 + beta1 * square(sigma[t - 1]));
18 }
19
20 y ~ normal(mu, sigma);
21}
22
23//@ DATA { T: 200, y: [200 values], sigma1: 0.5 } // values supplied at runtime
24//@ PARAMS ["mu","alpha0","alpha1","beta1"]
25//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
26
02answer overlay — reference vs stanrecord(mu, alpha0, alpha1, beta1)
mu
reference stan24 bins · 4.64 … 5.43
00.070.070.140.1455.13 · 0.1265.02 · 0.136x = 4.64 A = 0.0020 B = 0.0000 Δ = 0.0020x = 4.68 A = 0.0000 B = 0.0020 Δ = -0.0020x = 4.71 A = 0.0000 B = 0.0020 Δ = -0.0020x = 4.75 A = 0.0080 B = 0.0100 Δ = -0.0020x = 4.78 A = 0.0100 B = 0.0080 Δ = 0.0020x = 4.82 A = 0.0240 B = 0.0060 Δ = 0.0180x = 4.85 A = 0.0240 B = 0.0320 Δ = -0.0080x = 4.89 A = 0.0360 B = 0.0280 Δ = 0.0080x = 4.92 A = 0.0700 B = 0.0640 Δ = 0.0060x = 4.95 A = 0.0960 B = 0.0820 Δ = 0.0140x = 4.99 A = 0.0880 B = 0.1080 Δ = -0.0200x = 5.02 A = 0.0900 B = 0.1360 Δ = -0.0460x = 5.06 A = 0.1100 B = 0.0880 Δ = 0.0220x = 5.09 A = 0.0900 B = 0.1060 Δ = -0.0160x = 5.13 A = 0.1260 B = 0.1180 Δ = 0.0080x = 5.16 A = 0.1040 B = 0.0580 Δ = 0.0460x = 5.19 A = 0.0420 B = 0.0640 Δ = -0.0220x = 5.23 A = 0.0300 B = 0.0400 Δ = -0.0100x = 5.26 A = 0.0240 B = 0.0160 Δ = 0.0080x = 5.30 A = 0.0120 B = 0.0160 Δ = -0.0040x = 5.33 A = 0.0060 B = 0.0040 Δ = 0.0020x = 5.37 A = 0.0020 B = 0.0080 Δ = -0.0060x = 5.40 A = 0.0040 B = 0.0020 Δ = 0.0020x = 5.43 A = 0.0020 B = 0.0020 Δ = 0.0000
alpha0
reference stan24 bins · 0.52 … 4.56
00.070.070.150.15241.40 · 0.1401.22 · 0.146x = 0.52 A = 0.0220 B = 0.0180 Δ = 0.0040x = 0.70 A = 0.0620 B = 0.0660 Δ = -0.0040x = 0.87 A = 0.0980 B = 0.0900 Δ = 0.0080x = 1.05 A = 0.1260 B = 0.1340 Δ = -0.0080x = 1.22 A = 0.1180 B = 0.1460 Δ = -0.0280x = 1.40 A = 0.1400 B = 0.1060 Δ = 0.0340x = 1.58 A = 0.0960 B = 0.1000 Δ = -0.0040x = 1.75 A = 0.0960 B = 0.0800 Δ = 0.0160x = 1.93 A = 0.0780 B = 0.0700 Δ = 0.0080x = 2.10 A = 0.0620 B = 0.0460 Δ = 0.0160x = 2.28 A = 0.0300 B = 0.0520 Δ = -0.0220x = 2.45 A = 0.0300 B = 0.0300 Δ = 0.0000x = 2.63 A = 0.0140 B = 0.0160 Δ = -0.0020x = 2.80 A = 0.0060 B = 0.0200 Δ = -0.0140x = 2.98 A = 0.0080 B = 0.0120 Δ = -0.0040x = 3.16 A = 0.0020 B = 0.0100 Δ = -0.0080x = 3.33 A = 0.0040 B = 0.0000 Δ = 0.0040x = 3.51 A = 0.0060 B = 0.0020 Δ = 0.0040x = 3.68 A = 0.0000 B = 0.0000 Δ = 0.0000x = 3.86 A = 0.0020 B = 0.0000 Δ = 0.0020x = 4.03 A = 0.0000 B = 0.0000 Δ = 0.0000x = 4.21 A = 0.0000 B = 0.0000 Δ = 0.0000x = 4.38 A = 0.0000 B = 0.0000 Δ = 0.0000x = 4.56 A = 0.0000 B = 0.0020 Δ = -0.0020
alpha1
reference stan24 bins · 0.26 … 0.91
00.060.060.130.130.500.57 · 0.1260.57 · 0.100x = 0.26 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.29 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.32 A = 0.0180 B = 0.0120 Δ = 0.0060x = 0.34 A = 0.0220 B = 0.0200 Δ = 0.0020x = 0.37 A = 0.0320 B = 0.0140 Δ = 0.0180x = 0.40 A = 0.0380 B = 0.0420 Δ = -0.0040x = 0.43 A = 0.0640 B = 0.0360 Δ = 0.0280x = 0.46 A = 0.0640 B = 0.0660 Δ = -0.0020x = 0.48 A = 0.0520 B = 0.0780 Δ = -0.0260x = 0.51 A = 0.0720 B = 0.0900 Δ = -0.0180x = 0.54 A = 0.0780 B = 0.0900 Δ = -0.0120x = 0.57 A = 0.1260 B = 0.1000 Δ = 0.0260x = 0.60 A = 0.0640 B = 0.0780 Δ = -0.0140x = 0.63 A = 0.0680 B = 0.0660 Δ = 0.0020x = 0.65 A = 0.0780 B = 0.0760 Δ = 0.0020x = 0.68 A = 0.0620 B = 0.0520 Δ = 0.0100x = 0.71 A = 0.0240 B = 0.0480 Δ = -0.0240x = 0.74 A = 0.0300 B = 0.0460 Δ = -0.0160x = 0.77 A = 0.0380 B = 0.0420 Δ = -0.0040x = 0.79 A = 0.0320 B = 0.0160 Δ = 0.0160x = 0.82 A = 0.0100 B = 0.0020 Δ = 0.0080x = 0.85 A = 0.0120 B = 0.0100 Δ = 0.0020x = 0.88 A = 0.0060 B = 0.0120 Δ = -0.0060x = 0.91 A = 0.0040 B = 0.0020 Δ = 0.0020
beta1
reference stan24 bins · 0.03 … 0.59
00.0420.0420.0840.0840.200.400.39 · 0.0840.22 · 0.080x = 0.03 A = 0.0080 B = 0.0040 Δ = 0.0040x = 0.05 A = 0.0160 B = 0.0120 Δ = 0.0040x = 0.07 A = 0.0340 B = 0.0220 Δ = 0.0120x = 0.10 A = 0.0200 B = 0.0360 Δ = -0.0160x = 0.12 A = 0.0380 B = 0.0460 Δ = -0.0080x = 0.15 A = 0.0360 B = 0.0540 Δ = -0.0180x = 0.17 A = 0.0760 B = 0.0780 Δ = -0.0020x = 0.20 A = 0.0520 B = 0.0640 Δ = -0.0120x = 0.22 A = 0.0780 B = 0.0800 Δ = -0.0020x = 0.25 A = 0.0800 B = 0.0620 Δ = 0.0180x = 0.27 A = 0.0560 B = 0.0740 Δ = -0.0180x = 0.29 A = 0.0620 B = 0.0660 Δ = -0.0040x = 0.32 A = 0.0540 B = 0.0600 Δ = -0.0060x = 0.34 A = 0.0640 B = 0.0600 Δ = 0.0040x = 0.37 A = 0.0460 B = 0.0540 Δ = -0.0080x = 0.39 A = 0.0840 B = 0.0520 Δ = 0.0320x = 0.42 A = 0.0500 B = 0.0440 Δ = 0.0060x = 0.44 A = 0.0520 B = 0.0380 Δ = 0.0140x = 0.47 A = 0.0300 B = 0.0380 Δ = -0.0080x = 0.49 A = 0.0160 B = 0.0280 Δ = -0.0120x = 0.52 A = 0.0240 B = 0.0080 Δ = 0.0160x = 0.54 A = 0.0160 B = 0.0180 Δ = -0.0020x = 0.56 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.59 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0185 ≤ tol 0.0708 · floors 0.0197/0.0302
posteriordb-gp_pois_regr / gp_pois_regr
answer record(rho, alpha, f[1], f[2], f[3], f[4], f[5], f[6], f[7], f[8], f[9], f[10], f[11]) stan pass 0.0370
00 statement source: posteriordb/gp_pois_regr-gp_pois_regr
given

For N = 11 observations, the data provide an input location x_i (a real number) and a count observation k_i (a non-negative integer) for each observation i. The model has two hyperparameters: rho, a length scale parameter constrained to be positive, with a gamma(25, 4) prior; and alpha, a marginal standard deviation parameter constrained to be positive, with a half-normal prior truncated to the positive reals (equivalently, a normal(0, 2) prior restricted to alpha > 0).

model

The observed counts follow a Poisson regression with latent Gaussian process. For each observation i, the count k_i is Poisson-distributed with log-rate parameter f_i, where f is a latent one-dimensional Gaussian process evaluated at the input locations x_1, ..., x_N. The Gaussian process is specified by an exponential-quadratic (squared exponential) covariance kernel with length-scale parameter rho and marginal standard deviation parameter alpha. The latent GP values f_1, ..., f_N are generated from a multivariate normal distribution with mean zero and covariance matrix determined by evaluating the kernel at the observed input locations.

query

The marginal posterior distributions of the two hyperparameters rho (length scale) and alpha (marginal standard deviation), and the latent Gaussian process values f[1], f[2], f[3], f[4], f[5], f[6], f[7], f[8], f[9], f[10], f[11].

answer spec record(rho, alpha, f[1], f[2], f[3], f[4], f[5], f[6], f[7], f[8], f[9], f[10], f[11])
{
  "kind": "record",
  "fields": {
    "rho": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "f[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "f[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "f[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "f[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "f[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "f[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "f[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "f[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "f[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "f[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "f[11]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.037
stan
1data {
2 int<lower=1> N;
3 array[N] real x;
4 array[N] int k;
5}
6parameters {
7 real<lower=0> rho;
8 real<lower=0> alpha;
9 vector[N] f_tilde;
10}
11transformed parameters {
12 vector[N] f;
13 {
14 matrix[N, N] cov = gp_exp_quad_cov(x, alpha, rho)
15 + diag_matrix(rep_vector(1e-10, N));
16 matrix[N, N] L_cov = cholesky_decompose(cov);
17 f = L_cov * f_tilde;
18 }
19}
20model {
21 rho ~ gamma(25, 4);
22 alpha ~ normal(0, 2);
23 f_tilde ~ normal(0, 1);
24
25 k ~ poisson_log(f);
26}
27
28//@ DATA { N: 11, x: [11 values], k: [11 values] } // values supplied at runtime
29//@ PARAMS ["rho","alpha","f[1]","f[2]","f[3]","f[4]","f[5]","f[6]","f[7]","f[8]","f[9]","f[10]","f[11]"]
30//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
31
02answer overlay — reference vs stanrecord(rho, alpha, f[1], f[2], f[3], f[4], f[5], f[6], f[7], f[8], f[9], f[10], f[11])
parameterreference mean±sdstan mean±sd
rho5.68 ± 0.6945.61 ± 0.667
alpha3.00 ± 0.8162.89 ± 0.736
f[1]3.64 ± 0.1563.64 ± 0.154
f[2]3.68 ± 0.1283.69 ± 0.128
f[3]3.25 ± 0.1463.26 ± 0.143
f[4]2.41 ± 0.2022.42 ± 0.189
f[5]1.57 ± 0.2461.58 ± 0.240
f[6]1.30 ± 0.2601.31 ± 0.268
f[7]1.94 ± 0.2221.93 ± 0.236
f[8]3.18 ± 0.1463.17 ± 0.155
f[9]4.25 ± 0.0974.25 ± 0.098
f[10]4.42 ± 0.0864.41 ± 0.089
f[11]3.51 ± 0.1643.51 ± 0.164
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0370 ≤ tol 0.1404 · floors 0.0666/0.0702
posteriordb-gp_pois_regr / gp_regr
answer record(rho, alpha, sigma) stan pass 0.0563
00 statement source: posteriordb/gp_pois_regr-gp_regr
given

The data comprise N = 11 paired observations of input locations x and output values y. Each input x is a real number, and each output y is a real-valued observation. The model is fit to estimate three parameters: rho, a length-scale parameter constrained positive with a gamma(shape 25, rate 4) prior; alpha, the marginal standard deviation of the Gaussian process, constrained positive with a normal(mean 0, standard deviation 2) prior; and sigma, the noise standard deviation, constrained positive with a normal(mean 0, standard deviation 1) prior.

model

The observed outputs y follow a multivariate normal distribution with mean vector 0 and covariance matrix formed as K plus sigma times the identity matrix, where K is the N by N covariance matrix computed using an exponential quadratic (squared exponential) kernel evaluated at the input locations x, with hyperparameters alpha (the amplitude or marginal standard deviation) and rho (the length scale). The observations are thus jointly normal with zero mean and covariance K + sigma*I, where the diagonal elements of the noise contribution are sigma (not sigma squared), corresponding to a noise standard deviation of sigma on each observation.

query

The marginal posterior distributions of the three parameters: rho (the length scale), alpha (the Gaussian process amplitude), and sigma (the noise standard deviation).

answer spec record(rho, alpha, sigma)
{
  "kind": "record",
  "fields": {
    "rho": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.056
stan
1data {
2 int<lower=1> N;
3 array[N] real x;
4 vector[N] y;
5}
6parameters {
7 real<lower=0> rho;
8 real<lower=0> alpha;
9 real<lower=0> sigma;
10}
11model {
12 matrix[N, N] cov = gp_exp_quad_cov(x, alpha, rho)
13 + diag_matrix(rep_vector(sigma, N));
14 matrix[N, N] L_cov = cholesky_decompose(cov);
15
16 rho ~ gamma(25, 4);
17 alpha ~ normal(0, 2);
18 sigma ~ normal(0, 1);
19
20 y ~ multi_normal_cholesky(rep_vector(0, N), L_cov);
21}
22
23//@ DATA { N: 11, x: [11 values], y: [11 values] } // values supplied at runtime
24//@ PARAMS ["rho","alpha","sigma"]
25//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
26
02answer overlay — reference vs stanrecord(rho, alpha, sigma)
rho
reference stan24 bins · 3.68 … 11.6
00.060.060.110.115107.12 · 0.1126.43 · 0.112x = 3.68 A = 0.0060 B = 0.0020 Δ = 0.0040x = 4.02 A = 0.0060 B = 0.0040 Δ = 0.0020x = 4.37 A = 0.0140 B = 0.0200 Δ = -0.0060x = 4.71 A = 0.0260 B = 0.0120 Δ = 0.0140x = 5.06 A = 0.0380 B = 0.0600 Δ = -0.0220x = 5.40 A = 0.0580 B = 0.0780 Δ = -0.0200x = 5.74 A = 0.0780 B = 0.0740 Δ = 0.0040x = 6.09 A = 0.1000 B = 0.0840 Δ = 0.0160x = 6.43 A = 0.0920 B = 0.1120 Δ = -0.0200x = 6.77 A = 0.1080 B = 0.1080 Δ = 0.0000x = 7.12 A = 0.1120 B = 0.0840 Δ = 0.0280x = 7.46 A = 0.0900 B = 0.0960 Δ = -0.0060x = 7.81 A = 0.0940 B = 0.0860 Δ = 0.0080x = 8.15 A = 0.0600 B = 0.0620 Δ = -0.0020x = 8.49 A = 0.0460 B = 0.0260 Δ = 0.0200x = 8.84 A = 0.0340 B = 0.0320 Δ = 0.0020x = 9.18 A = 0.0140 B = 0.0220 Δ = -0.0080x = 9.53 A = 0.0140 B = 0.0100 Δ = 0.0040x = 9.87 A = 0.0020 B = 0.0080 Δ = -0.0060x = 10.2 A = 0.0000 B = 0.0120 Δ = -0.0120x = 10.6 A = 0.0060 B = 0.0060 Δ = 0.0000x = 10.9 A = 0.0000 B = 0.0020 Δ = -0.0020x = 11.2 A = 0.0000 B = 0.0000 Δ = 0.0000x = 11.6 A = 0.0020 B = 0.0000 Δ = 0.0020
alpha
reference stan24 bins · 0.94 … 4.91
00.060.060.120.12241.81 · 0.1022.15 · 0.122x = 0.94 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.12 A = 0.0140 B = 0.0060 Δ = 0.0080x = 1.29 A = 0.0360 B = 0.0360 Δ = 0.0000x = 1.46 A = 0.0540 B = 0.0600 Δ = -0.0060x = 1.63 A = 0.0880 B = 0.0740 Δ = 0.0140x = 1.81 A = 0.1020 B = 0.0920 Δ = 0.0100x = 1.98 A = 0.0820 B = 0.0940 Δ = -0.0120x = 2.15 A = 0.0780 B = 0.1220 Δ = -0.0440x = 2.32 A = 0.1000 B = 0.0660 Δ = 0.0340x = 2.50 A = 0.0880 B = 0.0960 Δ = -0.0080x = 2.67 A = 0.0600 B = 0.0700 Δ = -0.0100x = 2.84 A = 0.0780 B = 0.0640 Δ = 0.0140x = 3.01 A = 0.0400 B = 0.0440 Δ = -0.0040x = 3.18 A = 0.0360 B = 0.0320 Δ = 0.0040x = 3.36 A = 0.0380 B = 0.0440 Δ = -0.0060x = 3.53 A = 0.0300 B = 0.0340 Δ = -0.0040x = 3.70 A = 0.0140 B = 0.0100 Δ = 0.0040x = 3.87 A = 0.0180 B = 0.0220 Δ = -0.0040x = 4.05 A = 0.0100 B = 0.0160 Δ = -0.0060x = 4.22 A = 0.0160 B = 0.0100 Δ = 0.0060x = 4.39 A = 0.0080 B = 0.0060 Δ = 0.0020x = 4.56 A = 0.0040 B = 0.0000 Δ = 0.0040x = 4.74 A = 0.0000 B = 0.0000 Δ = 0.0000x = 4.91 A = 0.0060 B = 0.0000 Δ = 0.0060
sigma
reference stan24 bins · 0.86 … 3.81
00.060.060.120.121231.50 · 0.1201.76 · 0.116x = 0.86 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.99 A = 0.0200 B = 0.0180 Δ = 0.0020x = 1.11 A = 0.0420 B = 0.0400 Δ = 0.0020x = 1.24 A = 0.0660 B = 0.0700 Δ = -0.0040x = 1.37 A = 0.0960 B = 0.0700 Δ = 0.0260x = 1.50 A = 0.1200 B = 0.1020 Δ = 0.0180x = 1.63 A = 0.0960 B = 0.1000 Δ = -0.0040x = 1.76 A = 0.0940 B = 0.1160 Δ = -0.0220x = 1.89 A = 0.0860 B = 0.1080 Δ = -0.0220x = 2.01 A = 0.0700 B = 0.0840 Δ = -0.0140x = 2.14 A = 0.0660 B = 0.0820 Δ = -0.0160x = 2.27 A = 0.0700 B = 0.0520 Δ = 0.0180x = 2.40 A = 0.0500 B = 0.0420 Δ = 0.0080x = 2.53 A = 0.0340 B = 0.0300 Δ = 0.0040x = 2.66 A = 0.0260 B = 0.0220 Δ = 0.0040x = 2.79 A = 0.0220 B = 0.0120 Δ = 0.0100x = 2.91 A = 0.0180 B = 0.0160 Δ = 0.0020x = 3.04 A = 0.0080 B = 0.0100 Δ = -0.0020x = 3.17 A = 0.0040 B = 0.0100 Δ = -0.0060x = 3.30 A = 0.0060 B = 0.0060 Δ = 0.0000x = 3.43 A = 0.0020 B = 0.0000 Δ = 0.0020x = 3.56 A = 0.0000 B = 0.0020 Δ = -0.0020x = 3.69 A = 0.0000 B = 0.0020 Δ = -0.0020x = 3.81 A = 0.0000 B = 0.0020 Δ = -0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0563 ≤ tol 0.2085 · floors 0.0645/0.0650
posteriordb-hmm_example / hmm_example
answer record(theta1[1], theta1[2], theta2[1], theta2[2], mu[1], mu[2]) stan pass 0.0092
00 statement source: posteriordb/hmm_example-hmm_example
given

For a sequence of N observations indexed t = 1 to N, with K = 2 hidden states, the data provide an array y of N real-valued observations. The model has two transition probability vectors: theta1, the row of transition probabilities from state 1 (a probability vector summing to 1 with each component non-negative); and theta2, the row of transition probabilities from state 2 (similarly, a probability vector summing to 1). Both theta1 and theta2 have flat (improper uniform) priors. The model also has state-specific emission means mu[1] and mu[2], constrained so that mu[1] <= mu[2] and both positive. These means have Normal priors: mu[1] ~ Normal(3, 1) and mu[2] ~ Normal(10, 1).

model

A Hidden Markov Model generates the sequence of observations. At time t = 1, the hidden state is drawn uniformly at random from the K states (no explicit prior). At each subsequent time t = 2, 3, ..., N, the hidden state transitions according to the transition probabilities: if the state at time t-1 is state j, the state at time t is drawn from the categorical distribution with probabilities given by theta[j] (either theta1 if j=1, or theta2 if j=2). Given the hidden state k at time t, the observation y[t] is drawn from a Normal distribution with mean mu[k] and fixed standard deviation 1. Thus each observation y[t] ~ Normal(mu[state[t]], 1), where state[t] evolves according to the Markov transition probabilities across the entire sequence.

query

The marginal posterior distributions of the five parameters: theta1[1] and theta1[2] (the transition probabilities from state 1), theta2[1] and theta2[2] (the transition probabilities from state 2), and mu[1] and mu[2] (the state-specific observation means, ordered so that mu[1] <= mu[2]).

answer spec record(theta1[1], theta1[2], theta2[1], theta2[2], mu[1], mu[2])
{
  "kind": "record",
  "fields": {
    "theta1[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta1[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta2[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta2[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "mu[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "mu[2]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.009
stan
1// simple hmm example (1 output; 2 states)
2data {
3 int<lower=0> N;
4 int<lower=0> K;
5 array[N] real y;
6}
7parameters {
8 simplex[K] theta1;
9 simplex[K] theta2;
10 // real mu[K];
11 positive_ordered[K] mu;
12}
13transformed parameters {
14 array[K] simplex[K] theta;
15 theta[1] = theta1;
16 theta[2] = theta2;
17}
18model {
19 // priors
20 target += normal_lpdf(mu[1] | 3, 1);
21 target += normal_lpdf(mu[2] | 10, 1);
22 // forward algorithm
23 {
24 array[K] real acc;
25 array[N, K] real gamma;
26 for (k in 1 : K) {
27 gamma[1, k] = normal_lpdf(y[1] | mu[k], 1);
28 }
29 for (t in 2 : N) {
30 for (k in 1 : K) {
31 for (j in 1 : K) {
32 acc[j] = gamma[t - 1, j] + log(theta[j, k])
33 + normal_lpdf(y[t] | mu[k], 1);
34 }
35 gamma[t, k] = log_sum_exp(acc);
36 }
37 }
38 target += log_sum_exp(gamma[N]);
39 }
40}
41generated quantities {
42 array[N] int<lower=1, upper=K> z_star;
43 real log_p_z_star;
44 {
45 array[N, K] int back_ptr;
46 array[N, K] real best_logp;
47 for (k in 1 : K) {
48 best_logp[1, k] = normal_lpdf(y[1] | mu[k], 1);
49 }
50 for (t in 2 : N) {
51 for (k in 1 : K) {
52 best_logp[t, k] = negative_infinity();
53 for (j in 1 : K) {
54 real logp;
55 logp = best_logp[t - 1, j] + log(theta[j, k])
56 + normal_lpdf(y[t] | mu[k], 1);
57 if (logp > best_logp[t, k]) {
58 back_ptr[t, k] = j;
59 best_logp[t, k] = logp;
60 }
61 }
62 }
63 }
64 log_p_z_star = max(best_logp[N]);
65 for (k in 1 : K) {
66 if (best_logp[N, k] == log_p_z_star) {
67 z_star[N] = k;
68 }
69 }
70 for (t in 1 : (N - 1)) {
71 z_star[N - t] = back_ptr[N - t + 1, z_star[N - t + 1]];
72 }
73 }
74}
75
76//@ DATA { N: 100, K: 2, y: [100 values] } // values supplied at runtime
77//@ PARAMS ["theta1[1]","theta1[2]","theta2[1]","theta2[2]","mu[1]","mu[2]"]
78//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
79
02answer overlay — reference vs stanrecord(theta1[1], theta1[2], theta2[1], theta2[2], mu[1], mu[2])
theta1[1]
reference stan24 bins · 0.28 … 0.91
00.060.060.120.120.500.63 · 0.1160.69 · 0.122x = 0.28 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.31 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.33 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.36 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.39 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.42 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.44 A = 0.0140 B = 0.0080 Δ = 0.0060x = 0.47 A = 0.0120 B = 0.0160 Δ = -0.0040x = 0.50 A = 0.0300 B = 0.0520 Δ = -0.0220x = 0.53 A = 0.0400 B = 0.0460 Δ = -0.0060x = 0.55 A = 0.0680 B = 0.0480 Δ = 0.0200x = 0.58 A = 0.0620 B = 0.0580 Δ = 0.0040x = 0.61 A = 0.0740 B = 0.0680 Δ = 0.0060x = 0.63 A = 0.1160 B = 0.1020 Δ = 0.0140x = 0.66 A = 0.0920 B = 0.0760 Δ = 0.0160x = 0.69 A = 0.1000 B = 0.1220 Δ = -0.0220x = 0.72 A = 0.1000 B = 0.0840 Δ = 0.0160x = 0.74 A = 0.0820 B = 0.0780 Δ = 0.0040x = 0.77 A = 0.0820 B = 0.0600 Δ = 0.0220x = 0.80 A = 0.0500 B = 0.0740 Δ = -0.0240x = 0.82 A = 0.0400 B = 0.0460 Δ = -0.0060x = 0.85 A = 0.0100 B = 0.0140 Δ = -0.0040x = 0.88 A = 0.0060 B = 0.0100 Δ = -0.0040x = 0.91 A = 0.0120 B = 0.0140 Δ = -0.0020
theta1[2]
reference stan24 bins · 0.09 … 0.72
00.060.060.120.120.500.37 · 0.1160.31 · 0.116x = 0.09 A = 0.0120 B = 0.0140 Δ = -0.0020x = 0.12 A = 0.0060 B = 0.0100 Δ = -0.0040x = 0.15 A = 0.0100 B = 0.0140 Δ = -0.0040x = 0.17 A = 0.0400 B = 0.0460 Δ = -0.0060x = 0.20 A = 0.0500 B = 0.0740 Δ = -0.0240x = 0.23 A = 0.0820 B = 0.0600 Δ = 0.0220x = 0.26 A = 0.0820 B = 0.0780 Δ = 0.0040x = 0.28 A = 0.1000 B = 0.0900 Δ = 0.0100x = 0.31 A = 0.1000 B = 0.1160 Δ = -0.0160x = 0.34 A = 0.0920 B = 0.0760 Δ = 0.0160x = 0.37 A = 0.1160 B = 0.1020 Δ = 0.0140x = 0.39 A = 0.0740 B = 0.0740 Δ = 0.0000x = 0.42 A = 0.0620 B = 0.0520 Δ = 0.0100x = 0.45 A = 0.0680 B = 0.0480 Δ = 0.0200x = 0.47 A = 0.0400 B = 0.0460 Δ = -0.0060x = 0.50 A = 0.0300 B = 0.0520 Δ = -0.0220x = 0.53 A = 0.0120 B = 0.0160 Δ = -0.0040x = 0.56 A = 0.0140 B = 0.0080 Δ = 0.0060x = 0.58 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.61 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.64 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.67 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.69 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.72 A = 0.0000 B = 0.0020 Δ = -0.0020
theta2[1]
reference stan24 bins · 0.01 … 0.20
00.070.070.150.150.100.05 · 0.1460.05 · 0.110x = 0.01 A = 0.0080 B = 0.0120 Δ = -0.0040x = 0.02 A = 0.0200 B = 0.0220 Δ = -0.0020x = 0.03 A = 0.0360 B = 0.0480 Δ = -0.0120x = 0.04 A = 0.0560 B = 0.0640 Δ = -0.0080x = 0.05 A = 0.0800 B = 0.1060 Δ = -0.0260x = 0.05 A = 0.1460 B = 0.1100 Δ = 0.0360x = 0.06 A = 0.1060 B = 0.1080 Δ = -0.0020x = 0.07 A = 0.1000 B = 0.1080 Δ = -0.0080x = 0.08 A = 0.1140 B = 0.0760 Δ = 0.0380x = 0.09 A = 0.0880 B = 0.0740 Δ = 0.0140x = 0.09 A = 0.0740 B = 0.0700 Δ = 0.0040x = 0.10 A = 0.0380 B = 0.0720 Δ = -0.0340x = 0.11 A = 0.0440 B = 0.0300 Δ = 0.0140x = 0.12 A = 0.0160 B = 0.0200 Δ = -0.0040x = 0.13 A = 0.0340 B = 0.0200 Δ = 0.0140x = 0.13 A = 0.0140 B = 0.0160 Δ = -0.0020x = 0.14 A = 0.0060 B = 0.0080 Δ = -0.0020x = 0.15 A = 0.0120 B = 0.0160 Δ = -0.0040x = 0.16 A = 0.0020 B = 0.0120 Δ = -0.0100x = 0.16 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.17 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.18 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.19 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.20 A = 0.0020 B = 0.0040 Δ = -0.0020
theta2[2]
reference stan24 bins · 0.80 … 0.99
00.070.070.150.150.900.95 · 0.1460.93 · 0.120x = 0.80 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.81 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.82 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.83 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.84 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.84 A = 0.0020 B = 0.0120 Δ = -0.0100x = 0.85 A = 0.0120 B = 0.0160 Δ = -0.0040x = 0.86 A = 0.0060 B = 0.0080 Δ = -0.0020x = 0.87 A = 0.0140 B = 0.0160 Δ = -0.0020x = 0.87 A = 0.0340 B = 0.0200 Δ = 0.0140x = 0.88 A = 0.0160 B = 0.0200 Δ = -0.0040x = 0.89 A = 0.0440 B = 0.0300 Δ = 0.0140x = 0.90 A = 0.0380 B = 0.0720 Δ = -0.0340x = 0.91 A = 0.0740 B = 0.0700 Δ = 0.0040x = 0.91 A = 0.0880 B = 0.0740 Δ = 0.0140x = 0.92 A = 0.1000 B = 0.0640 Δ = 0.0360x = 0.93 A = 0.1140 B = 0.1200 Δ = -0.0060x = 0.94 A = 0.1060 B = 0.1080 Δ = -0.0020x = 0.95 A = 0.1460 B = 0.1100 Δ = 0.0360x = 0.95 A = 0.0800 B = 0.1060 Δ = -0.0260x = 0.96 A = 0.0560 B = 0.0640 Δ = -0.0080x = 0.97 A = 0.0360 B = 0.0480 Δ = -0.0120x = 0.98 A = 0.0200 B = 0.0220 Δ = -0.0020x = 0.99 A = 0.0080 B = 0.0120 Δ = -0.0040
mu[1]
reference stan24 bins · 2.43 … 3.73
00.060.060.120.122.5033.503.05 · 0.1123.10 · 0.120x = 2.43 A = 0.0040 B = 0.0020 Δ = 0.0020x = 2.48 A = 0.0000 B = 0.0120 Δ = -0.0120x = 2.54 A = 0.0080 B = 0.0020 Δ = 0.0060x = 2.60 A = 0.0200 B = 0.0120 Δ = 0.0080x = 2.65 A = 0.0200 B = 0.0220 Δ = -0.0020x = 2.71 A = 0.0460 B = 0.0260 Δ = 0.0200x = 2.77 A = 0.0500 B = 0.0600 Δ = -0.0100x = 2.82 A = 0.0760 B = 0.0420 Δ = 0.0340x = 2.88 A = 0.0800 B = 0.0660 Δ = 0.0140x = 2.94 A = 0.0820 B = 0.0980 Δ = -0.0160x = 2.99 A = 0.0760 B = 0.0840 Δ = -0.0080x = 3.05 A = 0.1120 B = 0.0920 Δ = 0.0200x = 3.10 A = 0.0720 B = 0.1200 Δ = -0.0480x = 3.16 A = 0.0840 B = 0.1020 Δ = -0.0180x = 3.22 A = 0.0940 B = 0.0620 Δ = 0.0320x = 3.27 A = 0.0540 B = 0.0600 Δ = -0.0060x = 3.33 A = 0.0520 B = 0.0580 Δ = -0.0060x = 3.39 A = 0.0260 B = 0.0300 Δ = -0.0040x = 3.44 A = 0.0240 B = 0.0220 Δ = 0.0020x = 3.50 A = 0.0100 B = 0.0060 Δ = 0.0040x = 3.56 A = 0.0040 B = 0.0120 Δ = -0.0080x = 3.62 A = 0.0040 B = 0.0020 Δ = 0.0020x = 3.67 A = 0.0020 B = 0.0060 Δ = -0.0040x = 3.73 A = 0.0000 B = 0.0020 Δ = -0.0020
mu[2]
reference stan24 bins · 8.47 … 9.24
00.070.070.130.138.5098.87 · 0.1288.77 · 0.134x = 8.47 A = 0.0000 B = 0.0020 Δ = -0.0020x = 8.51 A = 0.0020 B = 0.0000 Δ = 0.0020x = 8.54 A = 0.0040 B = 0.0020 Δ = 0.0020x = 8.57 A = 0.0140 B = 0.0120 Δ = 0.0020x = 8.61 A = 0.0180 B = 0.0120 Δ = 0.0060x = 8.64 A = 0.0120 B = 0.0320 Δ = -0.0200x = 8.67 A = 0.0700 B = 0.0480 Δ = 0.0220x = 8.71 A = 0.0600 B = 0.0700 Δ = -0.0100x = 8.74 A = 0.0960 B = 0.0880 Δ = 0.0080x = 8.77 A = 0.0960 B = 0.1340 Δ = -0.0380x = 8.80 A = 0.1120 B = 0.1040 Δ = 0.0080x = 8.84 A = 0.1160 B = 0.1160 Δ = 0.0000x = 8.87 A = 0.1280 B = 0.1060 Δ = 0.0220x = 8.90 A = 0.1000 B = 0.0860 Δ = 0.0140x = 8.94 A = 0.0760 B = 0.0600 Δ = 0.0160x = 8.97 A = 0.0400 B = 0.0540 Δ = -0.0140x = 9.00 A = 0.0200 B = 0.0340 Δ = -0.0140x = 9.04 A = 0.0160 B = 0.0260 Δ = -0.0100x = 9.07 A = 0.0120 B = 0.0100 Δ = 0.0020x = 9.10 A = 0.0040 B = 0.0020 Δ = 0.0020x = 9.14 A = 0.0020 B = 0.0000 Δ = 0.0020x = 9.17 A = 0.0000 B = 0.0020 Δ = -0.0020x = 9.20 A = 0.0000 B = 0.0000 Δ = 0.0000x = 9.24 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0092 ≤ tol 0.0514 · floors 0.0257/0.0135
posteriordb-hudson_lynx_hare / lotka_volterra
answer record(theta[1], theta[2], theta[3], theta[4], z_init[1], z_init[2], sigma[1], sigma[2]) stan pass 0.1012
00 statement source: posteriordb/hudson_lynx_hare-lotka_volterra
given

For each of N measurement time points, observations are provided: the time ts[n] and measured populations y[n,1] (prey) and y[n,2] (predator). Initial measured populations y_init[1] (prey) and y_init[2] (predator) are also observed, all positive real numbers. The model includes four positive system parameters theta[1] (prey birth rate), theta[2] (predation rate on prey), theta[3] (predator death rate), and theta[4] (predator efficiency); two positive initial populations z_init[1] (prey) and z_init[2] (predator) at time 0; and two positive measurement error standard deviations sigma[1] (prey) and sigma[2] (predator). The priors are: theta[1] and theta[3] each have a normal distribution with mean 1 and standard deviation 0.5; theta[2] and theta[4] each have a normal distribution with mean 0.05 and standard deviation 0.05; z_init[1] and z_init[2] each have a lognormal distribution with location (log-scale mean) log(10) and scale 1; sigma[1] and sigma[2] each have a lognormal distribution with location -1 and scale 1.

model

The latent prey and predator populations evolve according to the Lotka-Volterra differential equations. Denoting prey as u and predator as v, the system is du/dt = (theta[1] - theta[2]*v)*u and dv/dt = (-theta[3] + theta[4]*u)*v, with initial conditions u(0) = z_init[1] and v(0) = z_init[2]. The system is integrated numerically at each of the N measurement times to yield latent population trajectories. The observed initial populations y_init[1] and y_init[2] are independent lognormal random variables: y_init[k] has distribution lognormal with location log(z_init[k]) and scale sigma[k] for k = 1, 2. At each measurement time n, the observed populations y[n,1] and y[n,2] are independent, with y[n,k] distributed as lognormal with location log of the corresponding latent population and scale sigma[k].

query

The marginal posterior distributions of the eight parameters: theta[1] (prey birth rate), theta[2] (predation rate on prey), theta[3] (predator death rate), theta[4] (predator efficiency), z_init[1] (initial prey population), z_init[2] (initial predator population), sigma[1] (measurement error standard deviation for prey), and sigma[2] (measurement error standard deviation for predator).

answer spec record(theta[1], theta[2], theta[3], theta[4], z_init[1], z_init[2], sigma[1], sigma[2])
{
  "kind": "record",
  "fields": {
    "theta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "z_init[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "z_init[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma[2]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.101
stan
1functions {
2 array[] real dz_dt(real t, // time
3 array[] real z,
4 // system state {prey, predator}
5 array[] real theta, // parameters
6 array[] real x_r, // unused data
7 array[] int x_i) {
8 real u = z[1];
9 real v = z[2];
10
11 real alpha = theta[1];
12 real beta = theta[2];
13 real gamma = theta[3];
14 real delta = theta[4];
15
16 real du_dt = (alpha - beta * v) * u;
17 real dv_dt = (-gamma + delta * u) * v;
18 return {du_dt, dv_dt};
19 }
20}
21data {
22 int<lower=0> N; // number of measurement times
23 array[N] real ts; // measurement times > 0
24 array[2] real y_init; // initial measured populations
25 array[N, 2] real<lower=0> y; // measured populations
26}
27parameters {
28 array[4] real<lower=0> theta; // { alpha, beta, gamma, delta }
29 array[2] real<lower=0> z_init; // initial population
30 array[2] real<lower=0> sigma; // measurement errors
31}
32transformed parameters {
33 array[N, 2] real z = integrate_ode_rk45(dz_dt, z_init, 0, ts, theta,
34 rep_array(0.0, 0), rep_array(
35 0, 0), 1e-5, 1e-3, 5e2);
36}
37model {
38 theta[{1, 3}] ~ normal(1, 0.5);
39 theta[{2, 4}] ~ normal(0.05, 0.05);
40 sigma ~ lognormal(-1, 1);
41 z_init ~ lognormal(log(10), 1);
42 for (k in 1 : 2) {
43 y_init[k] ~ lognormal(log(z_init[k]), sigma[k]);
44 y[ : , k] ~ lognormal(log(z[ : , k]), sigma[k]);
45 }
46}
47generated quantities {
48 array[2] real y_init_rep;
49 array[N, 2] real y_rep;
50 for (k in 1 : 2) {
51 y_init_rep[k] = lognormal_rng(log(z_init[k]), sigma[k]);
52 for (n in 1 : N) {
53 y_rep[n, k] = lognormal_rng(log(z[n, k]), sigma[k]);
54 }
55 }
56}
57
58//@ DATA { N: 20, ts: [20 values], y_init: [2 values], y: [20×2 matrix] } // values supplied at runtime
59//@ PARAMS ["theta[1]","theta[2]","theta[3]","theta[4]","z_init[1]","z_init[2]","sigma[1]","sigma[2]"]
60//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
61
02answer overlay — reference vs stanrecord(theta[1], theta[2], theta[3], theta[4], z_init[1], z_init[2], sigma[1], sigma[2])
theta[1]
reference stan24 bins · 0.36 … 0.78
00.060.060.120.120.400.600.51 · 0.1180.53 · 0.122x = 0.36 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.38 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.40 A = 0.0020 B = 0.0100 Δ = -0.0080x = 0.42 A = 0.0160 B = 0.0140 Δ = 0.0020x = 0.44 A = 0.0240 B = 0.0220 Δ = 0.0020x = 0.46 A = 0.0320 B = 0.0360 Δ = -0.0040x = 0.47 A = 0.0780 B = 0.0600 Δ = 0.0180x = 0.49 A = 0.0980 B = 0.0660 Δ = 0.0320x = 0.51 A = 0.1180 B = 0.1040 Δ = 0.0140x = 0.53 A = 0.0960 B = 0.1220 Δ = -0.0260x = 0.54 A = 0.0960 B = 0.1180 Δ = -0.0220x = 0.56 A = 0.1180 B = 0.1160 Δ = 0.0020x = 0.58 A = 0.0940 B = 0.1040 Δ = -0.0100x = 0.60 A = 0.0640 B = 0.0720 Δ = -0.0080x = 0.62 A = 0.0660 B = 0.0500 Δ = 0.0160x = 0.63 A = 0.0320 B = 0.0160 Δ = 0.0160x = 0.65 A = 0.0200 B = 0.0380 Δ = -0.0180x = 0.67 A = 0.0140 B = 0.0080 Δ = 0.0060x = 0.69 A = 0.0100 B = 0.0140 Δ = -0.0040x = 0.70 A = 0.0060 B = 0.0160 Δ = -0.0100x = 0.72 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.74 A = 0.0040 B = 0.0080 Δ = -0.0040x = 0.76 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.78 A = 0.0020 B = 0.0000 Δ = 0.0020
theta[2]
reference stan24 bins · 0.02 … 0.04
00.080.080.160.160.020.030.040.03 · 0.1180.03 · 0.156x = 0.02 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.02 A = 0.0140 B = 0.0040 Δ = 0.0100x = 0.02 A = 0.0120 B = 0.0140 Δ = -0.0020x = 0.02 A = 0.0320 B = 0.0320 Δ = 0.0000x = 0.02 A = 0.0340 B = 0.0580 Δ = -0.0240x = 0.02 A = 0.0660 B = 0.0560 Δ = 0.0100x = 0.02 A = 0.0960 B = 0.0580 Δ = 0.0380x = 0.03 A = 0.0820 B = 0.0780 Δ = 0.0040x = 0.03 A = 0.1160 B = 0.0980 Δ = 0.0180x = 0.03 A = 0.0920 B = 0.0880 Δ = 0.0040x = 0.03 A = 0.0880 B = 0.1020 Δ = -0.0140x = 0.03 A = 0.0720 B = 0.0900 Δ = -0.0180x = 0.03 A = 0.1180 B = 0.1560 Δ = -0.0380x = 0.03 A = 0.0500 B = 0.0440 Δ = 0.0060x = 0.03 A = 0.0540 B = 0.0240 Δ = 0.0300x = 0.03 A = 0.0200 B = 0.0180 Δ = 0.0020x = 0.03 A = 0.0120 B = 0.0280 Δ = -0.0160x = 0.04 A = 0.0120 B = 0.0180 Δ = -0.0060x = 0.04 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.04 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.04 A = 0.0020 B = 0.0140 Δ = -0.0120x = 0.04 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.04 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.04 A = 0.0040 B = 0.0040 Δ = 0.0000
theta[3]
reference stan24 bins · 0.56 … 1.16
00.070.070.140.1410.79 · 0.1220.79 · 0.140x = 0.56 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.58 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.61 A = 0.0060 B = 0.0160 Δ = -0.0100x = 0.64 A = 0.0200 B = 0.0260 Δ = -0.0060x = 0.66 A = 0.0240 B = 0.0220 Δ = 0.0020x = 0.69 A = 0.0740 B = 0.0480 Δ = 0.0260x = 0.71 A = 0.0780 B = 0.0780 Δ = -0.0000x = 0.74 A = 0.0880 B = 0.1000 Δ = -0.0120x = 0.77 A = 0.1160 B = 0.1240 Δ = -0.0080x = 0.79 A = 0.1220 B = 0.1400 Δ = -0.0180x = 0.82 A = 0.0940 B = 0.1060 Δ = -0.0120x = 0.84 A = 0.1020 B = 0.0920 Δ = 0.0100x = 0.87 A = 0.0860 B = 0.0760 Δ = 0.0100x = 0.90 A = 0.0700 B = 0.0500 Δ = 0.0200x = 0.92 A = 0.0380 B = 0.0340 Δ = 0.0040x = 0.95 A = 0.0300 B = 0.0340 Δ = -0.0040x = 0.97 A = 0.0220 B = 0.0120 Δ = 0.0100x = 1.00 A = 0.0080 B = 0.0100 Δ = -0.0020x = 1.03 A = 0.0060 B = 0.0160 Δ = -0.0100x = 1.05 A = 0.0040 B = 0.0020 Δ = 0.0020x = 1.08 A = 0.0020 B = 0.0020 Δ = 0.0000x = 1.11 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.13 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.16 A = 0.0040 B = 0.0000 Δ = 0.0040
theta[4]
reference stan24 bins · 0.02 … 0.04
00.070.070.140.140.020.030.02 · 0.1200.02 · 0.142x = 0.02 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.02 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.02 A = 0.0100 B = 0.0140 Δ = -0.0040x = 0.02 A = 0.0120 B = 0.0300 Δ = -0.0180x = 0.02 A = 0.0440 B = 0.0400 Δ = 0.0040x = 0.02 A = 0.0560 B = 0.0480 Δ = 0.0080x = 0.02 A = 0.0880 B = 0.0840 Δ = 0.0040x = 0.02 A = 0.1040 B = 0.0960 Δ = 0.0080x = 0.02 A = 0.1180 B = 0.1200 Δ = -0.0020x = 0.02 A = 0.1200 B = 0.1420 Δ = -0.0220x = 0.02 A = 0.1180 B = 0.0980 Δ = 0.0200x = 0.03 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.03 A = 0.0860 B = 0.0660 Δ = 0.0200x = 0.03 A = 0.0760 B = 0.0760 Δ = 0.0000x = 0.03 A = 0.0500 B = 0.0780 Δ = -0.0280x = 0.03 A = 0.0380 B = 0.0220 Δ = 0.0160x = 0.03 A = 0.0320 B = 0.0160 Δ = 0.0160x = 0.03 A = 0.0140 B = 0.0280 Δ = -0.0140x = 0.03 A = 0.0080 B = 0.0140 Δ = -0.0060x = 0.03 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.03 A = 0.0040 B = 0.0080 Δ = -0.0040x = 0.03 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.04 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.04 A = 0.0040 B = 0.0000 Δ = 0.0040
z_init[1]
reference stan24 bins · 25.0 … 42.6
00.060.060.120.12304035.0 · 0.12432.6 · 0.108x = 25.0 A = 0.0020 B = 0.0000 Δ = 0.0020x = 25.7 A = 0.0000 B = 0.0020 Δ = -0.0020x = 26.5 A = 0.0020 B = 0.0040 Δ = -0.0020x = 27.3 A = 0.0100 B = 0.0120 Δ = -0.0020x = 28.0 A = 0.0060 B = 0.0120 Δ = -0.0060x = 28.8 A = 0.0180 B = 0.0220 Δ = -0.0040x = 29.6 A = 0.0240 B = 0.0640 Δ = -0.0400x = 30.4 A = 0.0480 B = 0.0520 Δ = -0.0040x = 31.1 A = 0.0500 B = 0.0620 Δ = -0.0120x = 31.9 A = 0.0920 B = 0.0780 Δ = 0.0140x = 32.6 A = 0.1160 B = 0.1080 Δ = 0.0080x = 33.4 A = 0.1020 B = 0.0920 Δ = 0.0100x = 34.2 A = 0.1220 B = 0.1000 Δ = 0.0220x = 35.0 A = 0.1240 B = 0.0720 Δ = 0.0520x = 35.7 A = 0.0800 B = 0.0740 Δ = 0.0060x = 36.5 A = 0.0480 B = 0.0560 Δ = -0.0080x = 37.3 A = 0.0360 B = 0.0540 Δ = -0.0180x = 38.0 A = 0.0300 B = 0.0480 Δ = -0.0180x = 38.8 A = 0.0240 B = 0.0280 Δ = -0.0040x = 39.6 A = 0.0320 B = 0.0240 Δ = 0.0080x = 40.3 A = 0.0120 B = 0.0140 Δ = -0.0020x = 41.1 A = 0.0060 B = 0.0180 Δ = -0.0120x = 41.9 A = 0.0060 B = 0.0000 Δ = 0.0060x = 42.6 A = 0.0100 B = 0.0040 Δ = 0.0060
z_init[2]
reference stan24 bins · 4.26 … 7.84
00.070.070.130.1365.98 · 0.1306.13 · 0.118x = 4.26 A = 0.0040 B = 0.0000 Δ = 0.0040x = 4.42 A = 0.0000 B = 0.0000 Δ = 0.0000x = 4.57 A = 0.0040 B = 0.0000 Δ = 0.0040x = 4.73 A = 0.0120 B = 0.0000 Δ = 0.0120x = 4.89 A = 0.0040 B = 0.0160 Δ = -0.0120x = 5.04 A = 0.0260 B = 0.0160 Δ = 0.0100x = 5.20 A = 0.0600 B = 0.0400 Δ = 0.0200x = 5.35 A = 0.0740 B = 0.0780 Δ = -0.0040x = 5.51 A = 0.0700 B = 0.1040 Δ = -0.0340x = 5.66 A = 0.1080 B = 0.1080 Δ = -0.0000x = 5.82 A = 0.0880 B = 0.0900 Δ = -0.0020x = 5.98 A = 0.1300 B = 0.1020 Δ = 0.0280x = 6.13 A = 0.1300 B = 0.1180 Δ = 0.0120x = 6.29 A = 0.0980 B = 0.0860 Δ = 0.0120x = 6.44 A = 0.0580 B = 0.0940 Δ = -0.0360x = 6.60 A = 0.0400 B = 0.0520 Δ = -0.0120x = 6.75 A = 0.0360 B = 0.0380 Δ = -0.0020x = 6.91 A = 0.0220 B = 0.0200 Δ = 0.0020x = 7.06 A = 0.0140 B = 0.0180 Δ = -0.0040x = 7.22 A = 0.0080 B = 0.0060 Δ = 0.0020x = 7.38 A = 0.0080 B = 0.0020 Δ = 0.0060x = 7.53 A = 0.0020 B = 0.0040 Δ = -0.0020x = 7.69 A = 0.0040 B = 0.0000 Δ = 0.0040x = 7.84 A = 0.0000 B = 0.0080 Δ = -0.0080
sigma[1]
reference stan24 bins · 0.16 … 0.46
00.070.070.140.140.200.300.400.24 · 0.1340.24 · 0.144x = 0.16 A = 0.0040 B = 0.0100 Δ = -0.0060x = 0.18 A = 0.0140 B = 0.0220 Δ = -0.0080x = 0.19 A = 0.0460 B = 0.0440 Δ = 0.0020x = 0.20 A = 0.0900 B = 0.0860 Δ = 0.0040x = 0.21 A = 0.1300 B = 0.1160 Δ = 0.0140x = 0.23 A = 0.1200 B = 0.1200 Δ = 0.0000x = 0.24 A = 0.1340 B = 0.1440 Δ = -0.0100x = 0.25 A = 0.1120 B = 0.1120 Δ = 0.0000x = 0.27 A = 0.0820 B = 0.0940 Δ = -0.0120x = 0.28 A = 0.0920 B = 0.0620 Δ = 0.0300x = 0.29 A = 0.0640 B = 0.0460 Δ = 0.0180x = 0.30 A = 0.0400 B = 0.0400 Δ = -0.0000x = 0.32 A = 0.0280 B = 0.0340 Δ = -0.0060x = 0.33 A = 0.0120 B = 0.0220 Δ = -0.0100x = 0.34 A = 0.0140 B = 0.0220 Δ = -0.0080x = 0.35 A = 0.0080 B = 0.0020 Δ = 0.0060x = 0.37 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.38 A = 0.0020 B = 0.0080 Δ = -0.0060x = 0.39 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.41 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.42 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.43 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.44 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.46 A = 0.0000 B = 0.0020 Δ = -0.0020
sigma[2]
reference stan24 bins · 0.16 … 0.41
00.060.060.130.130.200.300.400.24 · 0.1280.26 · 0.106x = 0.16 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.17 A = 0.0100 B = 0.0140 Δ = -0.0040x = 0.18 A = 0.0120 B = 0.0180 Δ = -0.0060x = 0.19 A = 0.0380 B = 0.0540 Δ = -0.0160x = 0.20 A = 0.0760 B = 0.0700 Δ = 0.0060x = 0.21 A = 0.0840 B = 0.0980 Δ = -0.0140x = 0.23 A = 0.1180 B = 0.0760 Δ = 0.0420x = 0.24 A = 0.1280 B = 0.1040 Δ = 0.0240x = 0.25 A = 0.0800 B = 0.0720 Δ = 0.0080x = 0.26 A = 0.0940 B = 0.1060 Δ = -0.0120x = 0.27 A = 0.0820 B = 0.0980 Δ = -0.0160x = 0.28 A = 0.0580 B = 0.0760 Δ = -0.0180x = 0.29 A = 0.0640 B = 0.0700 Δ = -0.0060x = 0.30 A = 0.0380 B = 0.0260 Δ = 0.0120x = 0.31 A = 0.0240 B = 0.0400 Δ = -0.0160x = 0.33 A = 0.0160 B = 0.0140 Δ = 0.0020x = 0.34 A = 0.0180 B = 0.0140 Δ = 0.0040x = 0.35 A = 0.0180 B = 0.0120 Δ = 0.0060x = 0.36 A = 0.0220 B = 0.0060 Δ = 0.0160x = 0.37 A = 0.0060 B = 0.0100 Δ = -0.0040x = 0.38 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.39 A = 0.0000 B = 0.0140 Δ = -0.0140x = 0.40 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.41 A = 0.0040 B = 0.0000 Δ = 0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.1012 ≤ tol 0.4363 · floors 0.2181/0.1800
posteriordb-irt_2pl / irt_2pl
answer record(sigma_theta, theta[1], theta[2], theta[3], theta[4], theta[5], theta[6], theta[7], theta[8], theta[9], theta[10], theta[11], theta[12], theta[13], theta[14], theta[15], theta[16], theta[17], theta[18], theta[19], theta[20], theta[21], theta[22], theta[23], theta[24], theta[25], theta[26], theta[27], theta[28], theta[29], theta[30], theta[31], theta[32], theta[33], theta[34], theta[35], theta[36], theta[37], theta[38], theta[39], theta[40], theta[41], theta[42], theta[43], theta[44], theta[45], theta[46], theta[47], theta[48], theta[49], theta[50], theta[51], theta[52], theta[53], theta[54], theta[55], theta[56], theta[57], theta[58], theta[59], theta[60], theta[61], theta[62], theta[63], theta[64], theta[65], theta[66], theta[67], theta[68], theta[69], theta[70], theta[71], theta[72], theta[73], theta[74], theta[75], theta[76], theta[77], theta[78], theta[79], theta[80], theta[81], theta[82], theta[83], theta[84], theta[85], theta[86], theta[87], theta[88], theta[89], theta[90], theta[91], theta[92], theta[93], theta[94], theta[95], theta[96], theta[97], theta[98], theta[99], theta[100], sigma_a, a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], a[16], a[17], a[18], a[19], a[20], mu_b, sigma_b, b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20]) stan pass 0.0745
00 statement source: posteriordb/irt_2pl-irt_2pl
given

Item-response data for I = 20 items and J = 100 students are provided as a binary matrix y[i,j] (1 = correct, 0 = incorrect), where i indexes items and j indexes students. The student ability standard deviation sigma_theta is constrained positive with a half-Cauchy(location 0, scale 2) prior. The item discrimination standard deviation sigma_a is constrained positive with a half-Cauchy(location 0, scale 2) prior. The item difficulty mean mu_b has a Normal(mean 0, sd 5) prior. The item difficulty standard deviation sigma_b is constrained positive with a half-Cauchy(location 0, scale 2) prior.

model

Each student j has a latent ability theta_j drawn from Normal(0, sigma_theta). Each item i has a discrimination parameter a_i drawn from LogNormal(0, sigma_a) (constrained positive) and a difficulty parameter b_i drawn from Normal(mu_b, sigma_b). The probability that student j answers item i correctly is inv_logit(a_i * (theta_j - b_i)).

query

The marginal posterior distribution of each parameter given the data: the ability standard deviation sigma_theta, the J = 100 student abilities theta_1, ..., theta_100, the discrimination standard deviation sigma_a, the I = 20 item discriminations a_1, ..., a_20, the difficulty mean mu_b, the difficulty standard deviation sigma_b, and the I = 20 item difficulties b_1, ..., b_20.

answer spec record(sigma_theta, theta[1], theta[2], theta[3], theta[4], theta[5], theta[6], theta[7], theta[8], theta[9], theta[10], theta[11], theta[12], theta[13], theta[14], theta[15], theta[16], theta[17], theta[18], theta[19], theta[20], theta[21], theta[22], theta[23], theta[24], theta[25], theta[26], theta[27], theta[28], theta[29], theta[30], theta[31], theta[32], theta[33], theta[34], theta[35], theta[36], theta[37], theta[38], theta[39], theta[40], theta[41], theta[42], theta[43], theta[44], theta[45], theta[46], theta[47], theta[48], theta[49], theta[50], theta[51], theta[52], theta[53], theta[54], theta[55], theta[56], theta[57], theta[58], theta[59], theta[60], theta[61], theta[62], theta[63], theta[64], theta[65], theta[66], theta[67], theta[68], theta[69], theta[70], theta[71], theta[72], theta[73], theta[74], theta[75], theta[76], theta[77], theta[78], theta[79], theta[80], theta[81], theta[82], theta[83], theta[84], theta[85], theta[86], theta[87], theta[88], theta[89], theta[90], theta[91], theta[92], theta[93], theta[94], theta[95], theta[96], theta[97], theta[98], theta[99], theta[100], sigma_a, a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], a[16], a[17], a[18], a[19], a[20], mu_b, sigma_b, b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20])
{
  "kind": "record",
  "fields": {
    "sigma_theta": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[40]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[41]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[42]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[43]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[44]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[45]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[46]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[47]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[48]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[49]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[50]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[51]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[52]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[53]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[54]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[55]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[56]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[57]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[58]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[59]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[60]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[61]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[62]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[63]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[64]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[65]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[66]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[67]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[68]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[69]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[70]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[71]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[72]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[73]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[74]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[75]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[76]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[77]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[78]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[79]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[80]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[81]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[82]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[83]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[84]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[85]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[86]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[87]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[88]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[89]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[90]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[91]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[92]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[93]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[94]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[95]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[96]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[97]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[98]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[99]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[100]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_a": {
      "kind": "dist",
      "domain": "real"
    },
    "a[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "mu_b": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_b": {
      "kind": "dist",
      "domain": "real"
    },
    "b[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[20]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.075
stan
1data {
2 int<lower=0> I;
3 int<lower=0> J;
4 array[I, J] int<lower=0, upper=1> y;
5}
6parameters {
7 real<lower=0> sigma_theta;
8 vector[J] theta;
9
10 real<lower=0> sigma_a;
11 vector<lower=0>[I] a;
12
13 real mu_b;
14 real<lower=0> sigma_b;
15 vector[I] b;
16}
17model {
18 sigma_theta ~ cauchy(0, 2);
19 theta ~ normal(0, sigma_theta);
20
21 sigma_a ~ cauchy(0, 2);
22 a ~ lognormal(0, sigma_a);
23
24 mu_b ~ normal(0, 5);
25 sigma_b ~ cauchy(0, 2);
26 b ~ normal(mu_b, sigma_b);
27
28 for (i in 1 : I) {
29 y[i] ~ bernoulli_logit(a[i] * (theta - b[i]));
30 }
31}
32
33//@ DATA { I: 20, J: 100, y: [20×100 matrix] } // values supplied at runtime
34//@ PARAMS ["sigma_theta","theta[1]","theta[2]","theta[3]","theta[4]","theta[5]","theta[6]","theta[7]","theta[8]","theta[9]","theta[10]","theta[11]","theta[12]","theta[13]","theta[14]","theta[15]","theta[16]","theta[17]","theta[18]","theta[19]","theta[20]","theta[21]","theta[22]","theta[23]","theta[24]","theta[25]","theta[26]","theta[27]","theta[28]","theta[29]","theta[30]","theta[31]","theta[32]","theta[33]","theta[34]","theta[35]","theta[36]","theta[37]","theta[38]","theta[39]","theta[40]","theta[41]","theta[42]","theta[43]","theta[44]","theta[45]","theta[46]","theta[47]","theta[48]","theta[49]","theta[50]","theta[51]","theta[52]","theta[53]","theta[54]","theta[55]","theta[56]","theta[57]","theta[58]","theta[59]","theta[60]","theta[61]","theta[62]","theta[63]","theta[64]","theta[65]","theta[66]","theta[67]","theta[68]","theta[69]","theta[70]","theta[71]","theta[72]","theta[73]","theta[74]","theta[75]","theta[76]","theta[77]","theta[78]","theta[79]","theta[80]","theta[81]","theta[82]","theta[83]","theta[84]","theta[85]","theta[86]","theta[87]","theta[88]","theta[89]","theta[90]","theta[91]","theta[92]","theta[93]","theta[94]","theta[95]","theta[96]","theta[97]","theta[98]","theta[99]","theta[100]","sigma_a","a[1]","a[2]","a[3]","a[4]","a[5]","a[6]","a[7]","a[8]","a[9]","a[10]","a[11]","a[12]","a[13]","a[14]","a[15]","a[16]","a[17]","a[18]","a[19]","a[20]","mu_b","sigma_b","b[1]","b[2]","b[3]","b[4]","b[5]","b[6]","b[7]","b[8]","b[9]","b[10]","b[11]","b[12]","b[13]","b[14]","b[15]","b[16]","b[17]","b[18]","b[19]","b[20]"]
35//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
36
02answer overlay — reference vs stanrecord(sigma_theta, theta[1], theta[2], theta[3], theta[4], theta[5], theta[6], theta[7], theta[8], theta[9], theta[10], theta[11], theta[12], theta[13], theta[14], theta[15], theta[16], theta[17], theta[18], theta[19], theta[20], theta[21], theta[22], theta[23], theta[24], theta[25], theta[26], theta[27], theta[28], theta[29], theta[30], theta[31], theta[32], theta[33], theta[34], theta[35], theta[36], theta[37], theta[38], theta[39], theta[40], theta[41], theta[42], theta[43], theta[44], theta[45], theta[46], theta[47], theta[48], theta[49], theta[50], theta[51], theta[52], theta[53], theta[54], theta[55], theta[56], theta[57], theta[58], theta[59], theta[60], theta[61], theta[62], theta[63], theta[64], theta[65], theta[66], theta[67], theta[68], theta[69], theta[70], theta[71], theta[72], theta[73], theta[74], theta[75], theta[76], theta[77], theta[78], theta[79], theta[80], theta[81], theta[82], theta[83], theta[84], theta[85], theta[86], theta[87], theta[88], theta[89], theta[90], theta[91], theta[92], theta[93], theta[94], theta[95], theta[96], theta[97], theta[98], theta[99], theta[100], sigma_a, a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], a[16], a[17], a[18], a[19], a[20], mu_b, sigma_b, b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20])
parameterreference mean±sdstan mean±sd
sigma_theta1.04 ± 0.191
theta[1]-0.670 ± 0.518
theta[2]0.243 ± 0.547
theta[3]1.06 ± 0.604
theta[4]-0.737 ± 0.547
theta[5]-0.710 ± 0.509
theta[6]-0.918 ± 0.544
theta[7]-0.256 ± 0.533
theta[8]1.42 ± 0.658
theta[9]0.386 ± 0.568
theta[10]1.66 ± 0.733
theta[11]-0.195 ± 0.537
theta[12]-0.836 ± 0.536
theta[13]-0.617 ± 0.534
theta[14]0.221 ± 0.560
theta[15]-1.76 ± 0.561
theta[16]-0.459 ± 0.550
theta[17]1.80 ± 0.759
theta[18]0.227 ± 0.566
theta[19]-0.183 ± 0.523
theta[20]-1.04 ± 0.541
theta[21]0.471 ± 0.579
theta[22]1.03 ± 0.618
theta[23]0.156 ± 0.547
theta[24]2.08 ± 0.743
theta[25]0.976 ± 0.639
theta[26]1.33 ± 0.644
theta[27]0.312 ± 0.570
theta[28]0.592 ± 0.599
theta[29]0.956 ± 0.615
theta[30]0.384 ± 0.546
theta[31]-0.275 ± 0.505
theta[32]0.949 ± 0.576
theta[33]-0.031 ± 0.544
theta[34]-0.944 ± 0.502
theta[35]-0.761 ± 0.532
theta[36]0.329 ± 0.541
theta[37]-1.90 ± 0.593
theta[38]0.691 ± 0.630
theta[39]0.167 ± 0.581
theta[40]-0.294 ± 0.498
theta[41]1.04 ± 0.628
theta[42]-0.971 ± 0.517
theta[43]-0.511 ± 0.493
theta[44]-0.230 ± 0.559
theta[45]0.275 ± 0.573
theta[46]0.746 ± 0.634
theta[47]1.70 ± 0.719
theta[48]0.514 ± 0.591
theta[49]-0.395 ± 0.518
theta[50]-0.129 ± 0.514
theta[51]-0.976 ± 0.537
theta[52]-1.06 ± 0.509
theta[53]0.476 ± 0.590
theta[54]-0.525 ± 0.557
theta[55]-0.992 ± 0.538
theta[56]0.443 ± 0.562
theta[57]0.718 ± 0.638
theta[58]0.333 ± 0.588
theta[59]1.61 ± 0.690
theta[60]0.085 ± 0.559
theta[61]0.013 ± 0.592
theta[62]-0.821 ± 0.547
theta[63]0.314 ± 0.560
theta[64]-1.30 ± 0.512
theta[65]-1.33 ± 0.534
theta[66]0.318 ± 0.582
theta[67]0.519 ± 0.606
theta[68]-0.147 ± 0.556
theta[69]-0.316 ± 0.512
theta[70]-0.574 ± 0.487
theta[71]-0.298 ± 0.525
theta[72]-1.68 ± 0.556
theta[73]-1.14 ± 0.535
theta[74]0.326 ± 0.528
theta[75]0.660 ± 0.608
theta[76]0.980 ± 0.612
theta[77]0.085 ± 0.541
theta[78]-0.638 ± 0.536
theta[79]-1.38 ± 0.564
theta[80]-0.226 ± 0.518
theta[81]0.365 ± 0.577
theta[82]-0.255 ± 0.554
theta[83]1.41 ± 0.641
theta[84]0.960 ± 0.623
theta[85]0.860 ± 0.638
theta[86]-1.53 ± 0.570
theta[87]-0.319 ± 0.549
theta[88]-0.195 ± 0.540
theta[89]-0.540 ± 0.547
theta[90]-1.47 ± 0.568
theta[91]-0.949 ± 0.561
theta[92]0.970 ± 0.587
theta[93]0.103 ± 0.545
theta[94]-0.236 ± 0.531
theta[95]-0.327 ± 0.561
theta[96]1.49 ± 0.725
theta[97]0.253 ± 0.527
theta[98]0.325 ± 0.548
theta[99]-0.350 ± 0.549
theta[100]-1.08 ± 0.523
sigma_a0.516 ± 0.179
a[1]1.08 ± 0.376
a[2]1.29 ± 0.443
a[3]1.03 ± 0.337
a[4]0.866 ± 0.276
a[5]1.13 ± 0.404
a[6]1.10 ± 0.382
a[7]0.902 ± 0.286
a[8]0.470 ± 0.194
a[9]1.96 ± 1.39
a[10]0.832 ± 0.266
a[11]1.46 ± 0.491
a[12]1.86 ± 1.14
a[13]0.954 ± 0.305
a[14]1.44 ± 0.503
a[15]1.04 ± 0.360
a[16]1.04 ± 0.328
a[17]0.786 ± 0.269
a[18]1.67 ± 0.615
a[19]0.721 ± 0.252
a[20]0.540 ± 0.194
mu_b-0.980 ± 0.557
sigma_b2.20 ± 0.539
b[1]-3.69 ± 1.12
b[2]2.02 ± 0.559
b[3]0.134 ± 0.272
b[4]0.383 ± 0.342
b[5]-3.33 ± 0.970
b[6]-2.37 ± 0.738
b[7]-3.15 ± 1.01
b[8]-1.56 ± 0.776
b[9]-4.75 ± 1.42
b[10]2.00 ± 0.688
b[11]-1.12 ± 0.341
b[12]-2.33 ± 0.672
b[13]2.79 ± 0.804
b[14]0.023 ± 0.212
b[15]-1.50 ± 0.533
b[16]-0.603 ± 0.291
b[17]-0.937 ± 0.492
b[18]-1.51 ± 0.410
b[19]-1.28 ± 0.605
b[20]1.56 ± 0.750
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0745 ≤ tol 0.3174 · floors 0.1587/0.1160
posteriordb-kidiq / kidscore_interaction
answer record(beta[1], beta[2], beta[3], beta[4], sigma) stan pass 0.5886
00 statement source: posteriordb/kidiq-kidscore_interaction
given

For each of N = 434 children, the data provide the child's cognitive test score (bounded between 0 and 200), a binary indicator of whether the child's mother completed high school (1 = yes, 0 = no), and the child's mother's IQ score (bounded between 0 and 200). The model includes four regression coefficients—an intercept and slopes on the mother's high school completion, the mother's IQ, and the interaction between these two predictors—each with a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a half-Cauchy(location 0, scale 2.5) prior.

model

Each child's cognitive test score is normally distributed with a mean equal to the intercept plus the slope on mother's high school completion times the indicator, plus the slope on mother's IQ times the IQ score, plus the slope on the interaction between these two predictors times their product, and a common standard deviation sigma across all children.

query

The marginal posterior distributions of the five parameters: the intercept (reported as beta[1]), the slope on the mother's high school indicator (reported as beta[2]), the slope on the mother's IQ (reported as beta[3]), the slope on the interaction (reported as beta[4]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.589
stan
1data {
2 int<lower=0> N;
3 vector<lower=0, upper=200>[N] kid_score;
4 vector<lower=0, upper=200>[N] mom_iq;
5 vector<lower=0, upper=1>[N] mom_hs;
6}
7transformed data {
8 // interaction
9 vector[N] inter;
10 inter = mom_hs .* mom_iq;
11}
12parameters {
13 vector[4] beta;
14 real<lower=0> sigma;
15}
16model {
17 sigma ~ cauchy(0, 2.5);
18 kid_score ~ normal(beta[1] + beta[2] * mom_hs + beta[3] * mom_iq
19 + beta[4] * inter, sigma);
20}
21
22//@ DATA { N: 434, kid_score: [434 values], mom_hs: [434 values], mom_iq: [434 values] } // values supplied at runtime
23//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","sigma"]
24//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
25
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], sigma)
beta[1]
reference stan24 bins · -45.2 … 32.8
00.060.060.130.130-18.1 · 0.092-18.1 · 0.126x = -45.2 A = 0.0120 B = 0.0020 Δ = 0.0100x = -41.8 A = 0.0040 B = 0.0040 Δ = 0.0000x = -38.4 A = 0.0120 B = 0.0060 Δ = 0.0060x = -35 A = 0.0240 B = 0.0120 Δ = 0.0120x = -31.6 A = 0.0400 B = 0.0340 Δ = 0.0060x = -28.2 A = 0.0460 B = 0.0460 Δ = 0.0000x = -24.9 A = 0.0480 B = 0.0460 Δ = 0.0020x = -21.5 A = 0.0800 B = 0.0620 Δ = 0.0180x = -18.1 A = 0.0920 B = 0.1260 Δ = -0.0340x = -14.7 A = 0.0880 B = 0.0860 Δ = 0.0020x = -11.3 A = 0.0840 B = 0.1040 Δ = -0.0200x = -7.90 A = 0.0820 B = 0.0860 Δ = -0.0040x = -4.50 A = 0.0920 B = 0.0840 Δ = 0.0080x = -1.10 A = 0.0760 B = 0.0880 Δ = -0.0120x = 2.30 A = 0.0580 B = 0.0740 Δ = -0.0160x = 5.60 A = 0.0440 B = 0.0780 Δ = -0.0340x = 9 A = 0.0380 B = 0.0320 Δ = 0.0060x = 12.4 A = 0.0420 B = 0.0120 Δ = 0.0300x = 15.8 A = 0.0140 B = 0.0080 Δ = 0.0060x = 19.2 A = 0.0080 B = 0.0040 Δ = 0.0040x = 22.6 A = 0.0060 B = 0.0000 Δ = 0.0060x = 26 A = 0.0020 B = 0.0020 Δ = 0.0000x = 29.4 A = 0.0000 B = 0.0020 Δ = -0.0020x = 32.8 A = 0.0080 B = 0.0020 Δ = 0.0060
beta[2]
reference stan24 bins · -1.70 … 90.1
00.060.060.130.1305058.2 · 0.10446.2 · 0.126x = -1.70 A = 0.0020 B = 0.0000 Δ = 0.0020x = 2.30 A = 0.0020 B = 0.0000 Δ = 0.0020x = 6.30 A = 0.0040 B = 0.0020 Δ = 0.0020x = 10.3 A = 0.0020 B = 0.0020 Δ = 0.0000x = 14.3 A = 0.0060 B = 0.0040 Δ = 0.0020x = 18.3 A = 0.0160 B = 0.0100 Δ = 0.0060x = 22.2 A = 0.0240 B = 0.0120 Δ = 0.0120x = 26.2 A = 0.0420 B = 0.0180 Δ = 0.0240x = 30.2 A = 0.0460 B = 0.0680 Δ = -0.0220x = 34.2 A = 0.0540 B = 0.0720 Δ = -0.0180x = 38.2 A = 0.0880 B = 0.0460 Δ = 0.0420x = 42.2 A = 0.0980 B = 0.0900 Δ = 0.0080x = 46.2 A = 0.0920 B = 0.1260 Δ = -0.0340x = 50.2 A = 0.0740 B = 0.1080 Δ = -0.0340x = 54.2 A = 0.0840 B = 0.1200 Δ = -0.0360x = 58.2 A = 0.1040 B = 0.1000 Δ = 0.0040x = 62.1 A = 0.0880 B = 0.0660 Δ = 0.0220x = 66.1 A = 0.0540 B = 0.0540 Δ = 0.0000x = 70.1 A = 0.0400 B = 0.0320 Δ = 0.0080x = 74.1 A = 0.0320 B = 0.0260 Δ = 0.0060x = 78.1 A = 0.0320 B = 0.0200 Δ = 0.0120x = 82.1 A = 0.0040 B = 0.0180 Δ = -0.0140x = 86.1 A = 0.0040 B = 0.0000 Δ = 0.0040x = 90.1 A = 0.0080 B = 0.0060 Δ = 0.0020
beta[3]
reference stan24 bins · 0.49 … 1.37
00.060.060.120.120.5010.95 · 0.1041.03 · 0.116x = 0.49 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.53 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.57 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.60 A = 0.0080 B = 0.0040 Δ = 0.0040x = 0.64 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.68 A = 0.0240 B = 0.0120 Δ = 0.0120x = 0.72 A = 0.0300 B = 0.0160 Δ = 0.0140x = 0.76 A = 0.0460 B = 0.0400 Δ = 0.0060x = 0.80 A = 0.0580 B = 0.0740 Δ = -0.0160x = 0.83 A = 0.0720 B = 0.0960 Δ = -0.0240x = 0.87 A = 0.0900 B = 0.0920 Δ = -0.0020x = 0.91 A = 0.0760 B = 0.0860 Δ = -0.0100x = 0.95 A = 0.1040 B = 0.1040 Δ = 0.0000x = 0.99 A = 0.0800 B = 0.1000 Δ = -0.0200x = 1.03 A = 0.0960 B = 0.1160 Δ = -0.0200x = 1.06 A = 0.0900 B = 0.0940 Δ = -0.0040x = 1.10 A = 0.0620 B = 0.0500 Δ = 0.0120x = 1.14 A = 0.0480 B = 0.0460 Δ = 0.0020x = 1.18 A = 0.0400 B = 0.0260 Δ = 0.0140x = 1.22 A = 0.0320 B = 0.0240 Δ = 0.0080x = 1.26 A = 0.0080 B = 0.0060 Δ = 0.0020x = 1.29 A = 0.0080 B = 0.0040 Δ = 0.0040x = 1.33 A = 0.0080 B = 0.0020 Δ = 0.0060x = 1.37 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[4]
reference stan24 bins · -0.88 … 0.07
00.070.070.130.13-0.500-0.38 · 0.106-0.42 · 0.130x = -0.88 A = 0.0100 B = 0.0040 Δ = 0.0060x = -0.84 A = 0.0060 B = 0.0120 Δ = -0.0060x = -0.80 A = 0.0080 B = 0.0080 Δ = 0.0000x = -0.76 A = 0.0280 B = 0.0260 Δ = 0.0020x = -0.72 A = 0.0340 B = 0.0280 Δ = 0.0060x = -0.68 A = 0.0480 B = 0.0340 Δ = 0.0140x = -0.63 A = 0.0560 B = 0.0560 Δ = 0.0000x = -0.59 A = 0.0960 B = 0.0740 Δ = 0.0220x = -0.55 A = 0.0960 B = 0.1000 Δ = -0.0040x = -0.51 A = 0.0700 B = 0.1020 Δ = -0.0320x = -0.47 A = 0.0840 B = 0.1120 Δ = -0.0280x = -0.42 A = 0.0820 B = 0.1300 Δ = -0.0480x = -0.38 A = 0.1060 B = 0.0820 Δ = 0.0240x = -0.34 A = 0.0920 B = 0.0680 Δ = 0.0240x = -0.30 A = 0.0480 B = 0.0660 Δ = -0.0180x = -0.26 A = 0.0520 B = 0.0460 Δ = 0.0060x = -0.22 A = 0.0300 B = 0.0220 Δ = 0.0080x = -0.18 A = 0.0200 B = 0.0140 Δ = 0.0060x = -0.13 A = 0.0180 B = 0.0080 Δ = 0.0100x = -0.09 A = 0.0020 B = 0.0040 Δ = -0.0020x = -0.05 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.01 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.03 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.07 A = 0.0020 B = 0.0000 Δ = 0.0020
sigma
reference stan24 bins · 16.4 … 19.8
00.060.060.120.121818.3 · 0.10018.0 · 0.116x = 16.4 A = 0.0060 B = 0.0060 Δ = 0.0000x = 16.5 A = 0.0020 B = 0.0000 Δ = 0.0020x = 16.7 A = 0.0060 B = 0.0120 Δ = -0.0060x = 16.8 A = 0.0100 B = 0.0100 Δ = 0.0000x = 17.0 A = 0.0280 B = 0.0380 Δ = -0.0100x = 17.1 A = 0.0480 B = 0.0380 Δ = 0.0100x = 17.3 A = 0.0460 B = 0.0440 Δ = 0.0020x = 17.4 A = 0.0600 B = 0.0780 Δ = -0.0180x = 17.6 A = 0.0760 B = 0.0920 Δ = -0.0160x = 17.7 A = 0.0760 B = 0.0800 Δ = -0.0040x = 17.9 A = 0.0920 B = 0.0640 Δ = 0.0280x = 18.0 A = 0.0900 B = 0.1160 Δ = -0.0260x = 18.1 A = 0.0920 B = 0.0960 Δ = -0.0040x = 18.3 A = 0.1000 B = 0.0760 Δ = 0.0240x = 18.4 A = 0.0840 B = 0.0680 Δ = 0.0160x = 18.6 A = 0.0700 B = 0.0400 Δ = 0.0300x = 18.7 A = 0.0400 B = 0.0340 Δ = 0.0060x = 18.9 A = 0.0200 B = 0.0560 Δ = -0.0360x = 19.0 A = 0.0220 B = 0.0240 Δ = -0.0020x = 19.2 A = 0.0140 B = 0.0100 Δ = 0.0040x = 19.3 A = 0.0140 B = 0.0080 Δ = 0.0060x = 19.5 A = 0.0020 B = 0.0020 Δ = 0.0000x = 19.6 A = 0.0000 B = 0.0020 Δ = -0.0020x = 19.8 A = 0.0020 B = 0.0060 Δ = -0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.5886 ≤ tol 2.9477 · floors 1.0106/1.4738
posteriordb-kidiq / kidscore_momhs
answer record(beta[1], beta[2], sigma) stan pass 0.0842
00 statement source: posteriordb/kidiq-kidscore_momhs
given

For each of N = 434 children the data provide the child's cognitive test score (between 0 and 200) and a binary indicator of whether the child's mother completed high school (1 = yes, 0 = no). The regression has two coefficients, an intercept and a slope on the high-school indicator, each with a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a half-Cauchy(location 0, scale 2.5) prior.

model

Each child's test score is Normal-distributed with a mean equal to the intercept plus the slope times the mother's high-school indicator, and a common standard deviation sigma across all children.

query

The marginal posterior distribution of each of the three parameters: the intercept (reported as beta[1]), the slope on the mother's high-school indicator (reported as beta[2]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.084
stan
1data {
2 int<lower=0> N;
3 vector<lower=0, upper=200>[N] kid_score;
4 vector<lower=0, upper=1>[N] mom_hs;
5}
6parameters {
7 vector[2] beta;
8 real<lower=0> sigma;
9}
10model {
11 sigma ~ cauchy(0, 2.5);
12 kid_score ~ normal(beta[1] + beta[2] * mom_hs, sigma);
13}
14
15//@ DATA { N: 434, kid_score: [434 values], mom_hs: [434 values] } // values supplied at runtime
16//@ PARAMS ["beta[1]","beta[2]","sigma"]
17//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
18
02answer overlay — reference vs stanrecord(beta[1], beta[2], sigma)
beta[1]
reference stan24 bins · 70.9 … 83.8
00.060.060.130.13758077.6 · 0.12677.6 · 0.122x = 70.9 A = 0.0040 B = 0.0020 Δ = 0.0020x = 71.4 A = 0.0040 B = 0.0040 Δ = 0.0000x = 72 A = 0.0080 B = 0.0040 Δ = 0.0040x = 72.6 A = 0.0000 B = 0.0060 Δ = -0.0060x = 73.1 A = 0.0020 B = 0.0040 Δ = -0.0020x = 73.7 A = 0.0260 B = 0.0240 Δ = 0.0020x = 74.3 A = 0.0220 B = 0.0280 Δ = -0.0060x = 74.8 A = 0.0480 B = 0.0340 Δ = 0.0140x = 75.4 A = 0.0720 B = 0.0480 Δ = 0.0240x = 75.9 A = 0.1020 B = 0.0720 Δ = 0.0300x = 76.5 A = 0.0760 B = 0.0660 Δ = 0.0100x = 77.1 A = 0.0920 B = 0.1000 Δ = -0.0080x = 77.6 A = 0.1260 B = 0.1220 Δ = 0.0040x = 78.2 A = 0.1060 B = 0.1160 Δ = -0.0100x = 78.8 A = 0.0860 B = 0.0940 Δ = -0.0080x = 79.3 A = 0.0720 B = 0.1020 Δ = -0.0300x = 79.9 A = 0.0560 B = 0.0620 Δ = -0.0060x = 80.4 A = 0.0400 B = 0.0320 Δ = 0.0080x = 81.0 A = 0.0100 B = 0.0280 Δ = -0.0180x = 81.6 A = 0.0200 B = 0.0240 Δ = -0.0040x = 82.1 A = 0.0200 B = 0.0160 Δ = 0.0040x = 82.7 A = 0.0020 B = 0.0100 Δ = -0.0080x = 83.3 A = 0.0040 B = 0.0000 Δ = 0.0040x = 83.8 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[2]
reference stan24 bins · 3.69 … 19.4
00.080.080.160.161013.2 · 0.12211.2 · 0.164x = 3.69 A = 0.0020 B = 0.0000 Δ = 0.0020x = 4.37 A = 0.0020 B = 0.0000 Δ = 0.0020x = 5.05 A = 0.0020 B = 0.0060 Δ = -0.0040x = 5.74 A = 0.0020 B = 0.0060 Δ = -0.0040x = 6.42 A = 0.0080 B = 0.0180 Δ = -0.0100x = 7.10 A = 0.0160 B = 0.0240 Δ = -0.0080x = 7.78 A = 0.0140 B = 0.0220 Δ = -0.0080x = 8.47 A = 0.0400 B = 0.0460 Δ = -0.0060x = 9.15 A = 0.0620 B = 0.0620 Δ = 0.0000x = 9.83 A = 0.0680 B = 0.0840 Δ = -0.0160x = 10.5 A = 0.1120 B = 0.0940 Δ = 0.0180x = 11.2 A = 0.1060 B = 0.1640 Δ = -0.0580x = 11.9 A = 0.1140 B = 0.1180 Δ = -0.0040x = 12.6 A = 0.1140 B = 0.0980 Δ = 0.0160x = 13.2 A = 0.1220 B = 0.0820 Δ = 0.0400x = 13.9 A = 0.0880 B = 0.0480 Δ = 0.0400x = 14.6 A = 0.0480 B = 0.0480 Δ = 0.0000x = 15.3 A = 0.0300 B = 0.0280 Δ = 0.0020x = 16.0 A = 0.0280 B = 0.0220 Δ = 0.0060x = 16.6 A = 0.0080 B = 0.0080 Δ = 0.0000x = 17.3 A = 0.0040 B = 0.0100 Δ = -0.0060x = 18.0 A = 0.0040 B = 0.0080 Δ = -0.0040x = 18.7 A = 0.0000 B = 0.0040 Δ = -0.0040x = 19.4 A = 0.0060 B = 0.0000 Δ = 0.0060
sigma
reference stan24 bins · 18 … 22.0
00.060.060.120.1218202219.9 · 0.12219.9 · 0.116x = 18 A = 0.0060 B = 0.0040 Δ = 0.0020x = 18.2 A = 0.0000 B = 0.0020 Δ = -0.0020x = 18.4 A = 0.0000 B = 0.0140 Δ = -0.0140x = 18.5 A = 0.0040 B = 0.0260 Δ = -0.0220x = 18.7 A = 0.0220 B = 0.0180 Δ = 0.0040x = 18.9 A = 0.0440 B = 0.0320 Δ = 0.0120x = 19.1 A = 0.0500 B = 0.0660 Δ = -0.0160x = 19.2 A = 0.0660 B = 0.0700 Δ = -0.0040x = 19.4 A = 0.0800 B = 0.0940 Δ = -0.0140x = 19.6 A = 0.0940 B = 0.0860 Δ = 0.0080x = 19.8 A = 0.0980 B = 0.0880 Δ = 0.0100x = 19.9 A = 0.1220 B = 0.1160 Δ = 0.0060x = 20.1 A = 0.0900 B = 0.0820 Δ = 0.0080x = 20.3 A = 0.0760 B = 0.0780 Δ = -0.0020x = 20.4 A = 0.0780 B = 0.0720 Δ = 0.0060x = 20.6 A = 0.0460 B = 0.0400 Δ = 0.0060x = 20.8 A = 0.0360 B = 0.0340 Δ = 0.0020x = 21.0 A = 0.0280 B = 0.0220 Δ = 0.0060x = 21.1 A = 0.0320 B = 0.0140 Δ = 0.0180x = 21.3 A = 0.0120 B = 0.0180 Δ = -0.0060x = 21.5 A = 0.0080 B = 0.0060 Δ = 0.0020x = 21.7 A = 0.0080 B = 0.0040 Δ = 0.0040x = 21.8 A = 0.0000 B = 0.0120 Δ = -0.0120x = 22.0 A = 0.0000 B = 0.0020 Δ = -0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0842 ≤ tol 0.2948 · floors 0.1474/0.1196
posteriordb-kidiq / kidscore_momhsiq
answer record(beta[1], beta[2], beta[3], sigma) stan pass 0.2133
00 statement source: posteriordb/kidiq-kidscore_momhsiq
given

For each of N = 434 children, the data provide the child's cognitive test score (between 0 and 200), an indicator of whether the mother completed high school (1 = yes, 0 = no), and the mother's cognitive test score. The regression has three coefficients: an intercept and slopes for the high-school indicator and the mother's score, each with a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a half-Cauchy(location 0, scale 2.5) prior.

model

Each child's test score is Normal-distributed with a mean equal to the intercept plus the mother's high-school indicator coefficient times the indicator, plus the mother's IQ coefficient times the mother's score, and a common standard deviation sigma across all children.

query

The marginal posterior distribution of each of the four parameters: the intercept (reported as beta[1]), the mother's high school completion effect (reported as beta[2]), the mother's IQ effect (reported as beta[3]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.213
stan
1data {
2 int<lower=0> N;
3 vector<lower=0, upper=200>[N] kid_score;
4 vector<lower=0, upper=200>[N] mom_iq;
5 vector<lower=0, upper=1>[N] mom_hs;
6}
7parameters {
8 vector[3] beta;
9 real<lower=0> sigma;
10}
11model {
12 sigma ~ cauchy(0, 2.5);
13 kid_score ~ normal(beta[1] + beta[2] * mom_hs + beta[3] * mom_iq, sigma);
14}
15
16//@ DATA { N: 434, kid_score: [434 values], mom_hs: [434 values], mom_iq: [434 values] } // values supplied at runtime
17//@ PARAMS ["beta[1]","beta[2]","beta[3]","sigma"]
18//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
19
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], sigma)
beta[1]
reference stan24 bins · 6.90 … 43
00.070.070.140.14204025.8 · 0.11824.2 · 0.142x = 6.90 A = 0.0020 B = 0.0000 Δ = 0.0020x = 8.50 A = 0.0040 B = 0.0020 Δ = 0.0020x = 10.1 A = 0.0060 B = 0.0000 Δ = 0.0060x = 11.6 A = 0.0080 B = 0.0040 Δ = 0.0040x = 13.2 A = 0.0120 B = 0.0000 Δ = 0.0120x = 14.8 A = 0.0180 B = 0.0180 Δ = 0.0000x = 16.4 A = 0.0180 B = 0.0320 Δ = -0.0140x = 17.9 A = 0.0460 B = 0.0340 Δ = 0.0120x = 19.5 A = 0.0520 B = 0.0460 Δ = 0.0060x = 21.1 A = 0.0800 B = 0.0520 Δ = 0.0280x = 22.6 A = 0.1160 B = 0.1020 Δ = 0.0140x = 24.2 A = 0.0980 B = 0.1420 Δ = -0.0440x = 25.8 A = 0.1180 B = 0.1060 Δ = 0.0120x = 27.3 A = 0.0920 B = 0.1260 Δ = -0.0340x = 28.9 A = 0.0800 B = 0.0940 Δ = -0.0140x = 30.5 A = 0.0700 B = 0.0720 Δ = -0.0020x = 32 A = 0.0680 B = 0.0600 Δ = 0.0080x = 33.6 A = 0.0460 B = 0.0460 Δ = 0.0000x = 35.2 A = 0.0280 B = 0.0340 Δ = -0.0060x = 36.7 A = 0.0160 B = 0.0220 Δ = -0.0060x = 38.3 A = 0.0140 B = 0.0040 Δ = 0.0100x = 39.9 A = 0.0020 B = 0.0020 Δ = 0.0000x = 41.5 A = 0.0020 B = 0.0000 Δ = 0.0020x = 43 A = 0.0040 B = 0.0020 Δ = 0.0020
beta[2]
reference stan24 bins · 0.11 … 11.5
00.060.060.120.125104.55 · 0.0906.52 · 0.124x = 0.11 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.60 A = 0.0040 B = 0.0020 Δ = 0.0020x = 1.10 A = 0.0060 B = 0.0000 Δ = 0.0060x = 1.59 A = 0.0080 B = 0.0020 Δ = 0.0060x = 2.08 A = 0.0120 B = 0.0180 Δ = -0.0060x = 2.58 A = 0.0380 B = 0.0280 Δ = 0.0100x = 3.07 A = 0.0380 B = 0.0300 Δ = 0.0080x = 3.56 A = 0.0380 B = 0.0600 Δ = -0.0220x = 4.06 A = 0.0700 B = 0.0560 Δ = 0.0140x = 4.55 A = 0.0900 B = 0.0940 Δ = -0.0040x = 5.04 A = 0.0820 B = 0.0720 Δ = 0.0100x = 5.54 A = 0.0780 B = 0.0840 Δ = -0.0060x = 6.03 A = 0.0900 B = 0.1000 Δ = -0.0100x = 6.52 A = 0.0820 B = 0.1240 Δ = -0.0420x = 7.02 A = 0.0740 B = 0.0620 Δ = 0.0120x = 7.51 A = 0.0800 B = 0.0780 Δ = 0.0020x = 8 A = 0.0640 B = 0.0520 Δ = 0.0120x = 8.50 A = 0.0360 B = 0.0420 Δ = -0.0060x = 8.99 A = 0.0400 B = 0.0420 Δ = -0.0020x = 9.48 A = 0.0260 B = 0.0180 Δ = 0.0080x = 9.98 A = 0.0220 B = 0.0080 Δ = 0.0140x = 10.5 A = 0.0120 B = 0.0100 Δ = 0.0020x = 11.0 A = 0.0060 B = 0.0100 Δ = -0.0040x = 11.5 A = 0.0020 B = 0.0060 Δ = -0.0040
beta[3]
reference stan24 bins · 0.38 … 0.74
00.060.060.130.130.400.600.58 · 0.1200.55 · 0.128x = 0.38 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.40 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.41 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.43 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.44 A = 0.0120 B = 0.0100 Δ = 0.0020x = 0.46 A = 0.0180 B = 0.0220 Δ = -0.0040x = 0.47 A = 0.0380 B = 0.0320 Δ = 0.0060x = 0.49 A = 0.0420 B = 0.0540 Δ = -0.0120x = 0.51 A = 0.0840 B = 0.0700 Δ = 0.0140x = 0.52 A = 0.0760 B = 0.0820 Δ = -0.0060x = 0.54 A = 0.0760 B = 0.1000 Δ = -0.0240x = 0.55 A = 0.1060 B = 0.1280 Δ = -0.0220x = 0.57 A = 0.1020 B = 0.1240 Δ = -0.0220x = 0.58 A = 0.1200 B = 0.0820 Δ = 0.0380x = 0.60 A = 0.0960 B = 0.1020 Δ = -0.0060x = 0.62 A = 0.0700 B = 0.0540 Δ = 0.0160x = 0.63 A = 0.0420 B = 0.0560 Δ = -0.0140x = 0.65 A = 0.0220 B = 0.0340 Δ = -0.0120x = 0.66 A = 0.0260 B = 0.0200 Δ = 0.0060x = 0.68 A = 0.0200 B = 0.0100 Δ = 0.0100x = 0.69 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.71 A = 0.0120 B = 0.0040 Δ = 0.0080x = 0.72 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.74 A = 0.0040 B = 0.0000 Δ = 0.0040
sigma
reference stan24 bins · 15.8 … 19.9
00.060.060.120.12161818.3 · 0.11818.1 · 0.124x = 15.8 A = 0.0020 B = 0.0000 Δ = 0.0020x = 16.0 A = 0.0000 B = 0.0000 Δ = 0.0000x = 16.1 A = 0.0000 B = 0.0040 Δ = -0.0040x = 16.3 A = 0.0020 B = 0.0060 Δ = -0.0040x = 16.5 A = 0.0040 B = 0.0080 Δ = -0.0040x = 16.7 A = 0.0040 B = 0.0140 Δ = -0.0100x = 16.9 A = 0.0080 B = 0.0080 Δ = 0.0000x = 17.0 A = 0.0120 B = 0.0220 Δ = -0.0100x = 17.2 A = 0.0300 B = 0.0300 Δ = 0.0000x = 17.4 A = 0.0640 B = 0.0380 Δ = 0.0260x = 17.6 A = 0.0820 B = 0.0760 Δ = 0.0060x = 17.7 A = 0.1020 B = 0.0900 Δ = 0.0120x = 17.9 A = 0.1080 B = 0.0920 Δ = 0.0160x = 18.1 A = 0.1120 B = 0.1240 Δ = -0.0120x = 18.3 A = 0.1180 B = 0.1220 Δ = -0.0040x = 18.4 A = 0.1040 B = 0.0940 Δ = 0.0100x = 18.6 A = 0.0760 B = 0.0860 Δ = -0.0100x = 18.8 A = 0.0560 B = 0.0700 Δ = -0.0140x = 19.0 A = 0.0560 B = 0.0520 Δ = 0.0040x = 19.2 A = 0.0300 B = 0.0300 Δ = -0.0000x = 19.3 A = 0.0120 B = 0.0240 Δ = -0.0120x = 19.5 A = 0.0080 B = 0.0040 Δ = 0.0040x = 19.7 A = 0.0060 B = 0.0040 Δ = 0.0020x = 19.9 A = 0.0040 B = 0.0020 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.2133 ≤ tol 1.2171 · floors 0.6085/0.4829
posteriordb-kidiq / kidscore_momiq
answer record(beta[1], beta[2], sigma) stan pass 0.3178
00 statement source: posteriordb/kidiq-kidscore_momiq
given

For each of N = 434 children the data provide the child's intelligence quotient (IQ) test score (between 0 and 200) and the child's mother's IQ score (between 0 and 200). The regression has two coefficients, an intercept and a slope on maternal IQ, each with a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a half-Cauchy(location 0, scale 2.5) prior.

model

Each child's test score is Normal-distributed with a mean equal to the intercept plus the slope times the mother's IQ score, and a common standard deviation sigma across all children.

query

The marginal posterior distribution of each of the three parameters: the intercept (reported as beta[1]), the slope on maternal IQ (reported as beta[2]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.318
stan
1data {
2 int<lower=0> N;
3 vector<lower=0, upper=200>[N] kid_score;
4 vector<lower=0, upper=200>[N] mom_iq;
5}
6parameters {
7 vector[2] beta;
8 real<lower=0> sigma;
9}
10model {
11 sigma ~ cauchy(0, 2.5);
12 kid_score ~ normal(beta[1] + beta[2] * mom_iq, sigma);
13}
14
15//@ DATA { N: 434, kid_score: [434 values], mom_iq: [434 values] } // values supplied at runtime
16//@ PARAMS ["beta[1]","beta[2]","sigma"]
17//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
18
02answer overlay — reference vs stanrecord(beta[1], beta[2], sigma)
beta[1]
reference stan24 bins · 5.70 … 42.5
00.060.060.130.13204023.3 · 0.12628.1 · 0.112x = 5.70 A = 0.0020 B = 0.0000 Δ = 0.0020x = 7.30 A = 0.0020 B = 0.0000 Δ = 0.0020x = 8.90 A = 0.0000 B = 0.0000 Δ = 0.0000x = 10.5 A = 0.0040 B = 0.0060 Δ = -0.0020x = 12.1 A = 0.0040 B = 0.0040 Δ = 0.0000x = 13.7 A = 0.0040 B = 0.0200 Δ = -0.0160x = 15.3 A = 0.0240 B = 0.0260 Δ = -0.0020x = 16.9 A = 0.0220 B = 0.0320 Δ = -0.0100x = 18.5 A = 0.0540 B = 0.0480 Δ = 0.0060x = 20.1 A = 0.0680 B = 0.0960 Δ = -0.0280x = 21.7 A = 0.0760 B = 0.1020 Δ = -0.0260x = 23.3 A = 0.1260 B = 0.1040 Δ = 0.0220x = 24.9 A = 0.1020 B = 0.0760 Δ = 0.0260x = 26.5 A = 0.1080 B = 0.1060 Δ = 0.0020x = 28.1 A = 0.1080 B = 0.1120 Δ = -0.0040x = 29.7 A = 0.0720 B = 0.0620 Δ = 0.0100x = 31.3 A = 0.0800 B = 0.0560 Δ = 0.0240x = 32.9 A = 0.0500 B = 0.0440 Δ = 0.0060x = 34.5 A = 0.0380 B = 0.0600 Δ = -0.0220x = 36.1 A = 0.0260 B = 0.0180 Δ = 0.0080x = 37.7 A = 0.0100 B = 0.0180 Δ = -0.0080x = 39.3 A = 0.0080 B = 0.0080 Δ = 0.0000x = 40.9 A = 0.0040 B = 0.0020 Δ = 0.0020x = 42.5 A = 0.0080 B = 0.0000 Δ = 0.0080
beta[2]
reference stan24 bins · 0.45 … 0.79
00.060.060.120.120.600.63 · 0.1180.60 · 0.124x = 0.45 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.46 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.47 A = 0.0100 B = 0.0080 Δ = 0.0020x = 0.49 A = 0.0120 B = 0.0140 Δ = -0.0020x = 0.51 A = 0.0240 B = 0.0160 Δ = 0.0080x = 0.52 A = 0.0280 B = 0.0440 Δ = -0.0160x = 0.54 A = 0.0500 B = 0.0460 Δ = 0.0040x = 0.55 A = 0.0600 B = 0.0520 Δ = 0.0080x = 0.57 A = 0.0720 B = 0.0660 Δ = 0.0060x = 0.58 A = 0.0980 B = 0.0740 Δ = 0.0240x = 0.60 A = 0.1000 B = 0.1240 Δ = -0.0240x = 0.61 A = 0.0960 B = 0.0760 Δ = 0.0200x = 0.63 A = 0.1180 B = 0.0920 Δ = 0.0260x = 0.64 A = 0.0960 B = 0.0940 Δ = 0.0020x = 0.66 A = 0.0700 B = 0.0900 Δ = -0.0200x = 0.67 A = 0.0580 B = 0.0780 Δ = -0.0200x = 0.69 A = 0.0420 B = 0.0500 Δ = -0.0080x = 0.70 A = 0.0300 B = 0.0220 Δ = 0.0080x = 0.72 A = 0.0120 B = 0.0180 Δ = -0.0060x = 0.73 A = 0.0020 B = 0.0180 Δ = -0.0160x = 0.75 A = 0.0040 B = 0.0080 Δ = -0.0040x = 0.76 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.78 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.79 A = 0.0020 B = 0.0000 Δ = 0.0020
sigma
reference stan24 bins · 16.7 … 20.3
00.060.060.120.12182018.3 · 0.11017.9 · 0.124x = 16.7 A = 0.0040 B = 0.0020 Δ = 0.0020x = 16.8 A = 0.0080 B = 0.0060 Δ = 0.0020x = 17.0 A = 0.0120 B = 0.0160 Δ = -0.0040x = 17.1 A = 0.0120 B = 0.0200 Δ = -0.0080x = 17.3 A = 0.0220 B = 0.0340 Δ = -0.0120x = 17.5 A = 0.0600 B = 0.0480 Δ = 0.0120x = 17.6 A = 0.0560 B = 0.0560 Δ = 0.0000x = 17.8 A = 0.0700 B = 0.0820 Δ = -0.0120x = 17.9 A = 0.1000 B = 0.1240 Δ = -0.0240x = 18.1 A = 0.0900 B = 0.1220 Δ = -0.0320x = 18.3 A = 0.1100 B = 0.1060 Δ = 0.0040x = 18.4 A = 0.0800 B = 0.0720 Δ = 0.0080x = 18.6 A = 0.1000 B = 0.0960 Δ = 0.0040x = 18.7 A = 0.0880 B = 0.0780 Δ = 0.0100x = 18.9 A = 0.0580 B = 0.0460 Δ = 0.0120x = 19.1 A = 0.0340 B = 0.0200 Δ = 0.0140x = 19.2 A = 0.0320 B = 0.0180 Δ = 0.0140x = 19.4 A = 0.0280 B = 0.0220 Δ = 0.0060x = 19.5 A = 0.0180 B = 0.0040 Δ = 0.0140x = 19.7 A = 0.0080 B = 0.0080 Δ = 0.0000x = 19.8 A = 0.0060 B = 0.0040 Δ = 0.0020x = 20.0 A = 0.0020 B = 0.0100 Δ = -0.0080x = 20.1 A = 0.0020 B = 0.0020 Δ = 0.0000x = 20.3 A = 0.0000 B = 0.0040 Δ = -0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.3178 ≤ tol 0.7203 · floors 0.3601/0.3502
posteriordb-kidiq_with_mom_work / kidscore_interaction_c
answer record(beta[1], beta[2], beta[3], beta[4], sigma) stan pass 0.0660
00 statement source: posteriordb/kidiq_with_mom_work-kidscore_interaction_c
given

For each of N = 434 children, the data provide the child's cognitive test score and two parent measures: the mother's high school completion status and the mother's IQ score. To facilitate interpretation, the model centers both the mother's high school measure and the mother's IQ by subtracting their sample means. The regression includes four coefficients: an intercept, a slope for centered mother's high school, a slope for centered mother's IQ, and a slope for their interaction. The regression coefficients beta[1], beta[2], beta[3], and beta[4] each have a flat (improper uniform) prior over the reals. The error standard deviation sigma, constrained to be positive, has a half-Cauchy(location 0, scale 2.5) prior.

model

Each child's test score is normally distributed with a mean equal to the intercept plus the slope for centered mother's high school times that child's centered mother's high school value, plus the slope for centered mother's IQ times that child's centered mother's IQ value, plus the interaction coefficient times the product of the centered mother's high school and centered mother's IQ values. The standard deviation of this normal distribution is sigma, shared across all children.

query

The marginal posterior distribution of each of the five parameters: the intercept (reported as beta[1]), the coefficient for centered mother's high school measure (reported as beta[2]), the coefficient for centered mother's IQ (reported as beta[3]), the coefficient for the interaction between centered mother's high school measure and centered mother's IQ (reported as beta[4]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.066
stan
1data {
2 int<lower=0> N;
3 vector[N] kid_score;
4 vector[N] mom_hs;
5 vector[N] mom_iq;
6}
7transformed data {
8 // centered predictors
9 vector[N] c_mom_hs;
10 vector[N] c_mom_iq;
11 vector[N] inter;
12 c_mom_hs = mom_hs - mean(mom_hs);
13 c_mom_iq = mom_iq - mean(mom_iq);
14 inter = c_mom_hs .* c_mom_iq;
15}
16parameters {
17 vector[4] beta;
18 real<lower=0> sigma;
19}
20model {
21 kid_score ~ normal(beta[1] + beta[2] * c_mom_hs + beta[3] * c_mom_iq
22 + beta[4] * inter, sigma);
23}
24
25//@ DATA { N: 434, kid_score: [434 values], mom_hs: [434 values], mom_iq: [434 values] } // values supplied at runtime
26//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","sigma"]
27//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
28
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], sigma)
beta[1]
reference stan24 bins · 84.7 … 90.0
00.050.050.110.11868887.4 · 0.10687.9 · 0.108x = 84.7 A = 0.0020 B = 0.0000 Δ = 0.0020x = 84.9 A = 0.0020 B = 0.0000 Δ = 0.0020x = 85.1 A = 0.0000 B = 0.0020 Δ = -0.0020x = 85.3 A = 0.0020 B = 0.0000 Δ = 0.0020x = 85.6 A = 0.0060 B = 0.0080 Δ = -0.0020x = 85.8 A = 0.0160 B = 0.0080 Δ = 0.0080x = 86.0 A = 0.0220 B = 0.0300 Δ = -0.0080x = 86.3 A = 0.0280 B = 0.0560 Δ = -0.0280x = 86.5 A = 0.0400 B = 0.0540 Δ = -0.0140x = 86.7 A = 0.0540 B = 0.0620 Δ = -0.0080x = 87.0 A = 0.0740 B = 0.0800 Δ = -0.0060x = 87.2 A = 0.0980 B = 0.0840 Δ = 0.0140x = 87.4 A = 0.1060 B = 0.0820 Δ = 0.0240x = 87.7 A = 0.0900 B = 0.1020 Δ = -0.0120x = 87.9 A = 0.0960 B = 0.1080 Δ = -0.0120x = 88.1 A = 0.0920 B = 0.0900 Δ = 0.0020x = 88.4 A = 0.0700 B = 0.0400 Δ = 0.0300x = 88.6 A = 0.0580 B = 0.0780 Δ = -0.0200x = 88.8 A = 0.0560 B = 0.0580 Δ = -0.0020x = 89.1 A = 0.0380 B = 0.0280 Δ = 0.0100x = 89.3 A = 0.0140 B = 0.0180 Δ = -0.0040x = 89.5 A = 0.0200 B = 0.0080 Δ = 0.0120x = 89.8 A = 0.0140 B = 0.0000 Δ = 0.0140x = 90.0 A = 0.0020 B = 0.0040 Δ = -0.0020
beta[2]
reference stan24 bins · -5.15 … 10.3
00.060.060.130.130101.58 · 0.1082.93 · 0.126x = -5.15 A = 0.0040 B = 0.0000 Δ = 0.0040x = -4.48 A = 0.0020 B = 0.0020 Δ = 0.0000x = -3.80 A = 0.0020 B = 0.0020 Δ = 0.0000x = -3.13 A = 0.0060 B = 0.0040 Δ = 0.0020x = -2.46 A = 0.0080 B = 0.0080 Δ = 0.0000x = -1.78 A = 0.0180 B = 0.0200 Δ = -0.0020x = -1.11 A = 0.0220 B = 0.0280 Δ = -0.0060x = -0.44 A = 0.0360 B = 0.0320 Δ = 0.0040x = 0.23 A = 0.0520 B = 0.0780 Δ = -0.0260x = 0.91 A = 0.0940 B = 0.0780 Δ = 0.0160x = 1.58 A = 0.1080 B = 0.0980 Δ = 0.0100x = 2.25 A = 0.1040 B = 0.1160 Δ = -0.0120x = 2.93 A = 0.1000 B = 0.1260 Δ = -0.0260x = 3.60 A = 0.1020 B = 0.1180 Δ = -0.0160x = 4.27 A = 0.0960 B = 0.0760 Δ = 0.0200x = 4.95 A = 0.0940 B = 0.0660 Δ = 0.0280x = 5.62 A = 0.0400 B = 0.0480 Δ = -0.0080x = 6.29 A = 0.0640 B = 0.0480 Δ = 0.0160x = 6.96 A = 0.0260 B = 0.0260 Δ = 0.0000x = 7.64 A = 0.0100 B = 0.0160 Δ = -0.0060x = 8.31 A = 0.0100 B = 0.0040 Δ = 0.0060x = 8.98 A = 0.0000 B = 0.0020 Δ = -0.0020x = 9.66 A = 0.0020 B = 0.0020 Δ = 0.0000x = 10.3 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[3]
reference stan24 bins · 0.42 … 0.79
00.070.070.130.130.600.58 · 0.1300.58 · 0.112x = 0.42 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.43 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.45 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.47 A = 0.0040 B = 0.0160 Δ = -0.0120x = 0.48 A = 0.0160 B = 0.0220 Δ = -0.0060x = 0.50 A = 0.0280 B = 0.0420 Δ = -0.0140x = 0.51 A = 0.0500 B = 0.0360 Δ = 0.0140x = 0.53 A = 0.0640 B = 0.0660 Δ = -0.0020x = 0.55 A = 0.1000 B = 0.0820 Δ = 0.0180x = 0.56 A = 0.0900 B = 0.1020 Δ = -0.0120x = 0.58 A = 0.1300 B = 0.1120 Δ = 0.0180x = 0.59 A = 0.1140 B = 0.1100 Δ = 0.0040x = 0.61 A = 0.1100 B = 0.0980 Δ = 0.0120x = 0.63 A = 0.0760 B = 0.0740 Δ = 0.0020x = 0.64 A = 0.0740 B = 0.0760 Δ = -0.0020x = 0.66 A = 0.0480 B = 0.0500 Δ = -0.0020x = 0.67 A = 0.0320 B = 0.0460 Δ = -0.0140x = 0.69 A = 0.0280 B = 0.0200 Δ = 0.0080x = 0.71 A = 0.0140 B = 0.0140 Δ = 0.0000x = 0.72 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.74 A = 0.0000 B = 0.0080 Δ = -0.0080x = 0.75 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.77 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.79 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[4]
reference stan24 bins · -1.00 … 0.07
00.060.060.120.12-1-0.500-0.40 · 0.118-0.54 · 0.116x = -1.00 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.96 A = 0.0060 B = 0.0000 Δ = 0.0060x = -0.91 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.86 A = 0.0020 B = 0.0120 Δ = -0.0100x = -0.82 A = 0.0180 B = 0.0120 Δ = 0.0060x = -0.77 A = 0.0300 B = 0.0260 Δ = 0.0040x = -0.72 A = 0.0400 B = 0.0280 Δ = 0.0120x = -0.68 A = 0.0440 B = 0.0520 Δ = -0.0080x = -0.63 A = 0.1080 B = 0.0760 Δ = 0.0320x = -0.58 A = 0.0880 B = 0.1080 Δ = -0.0200x = -0.54 A = 0.0960 B = 0.1160 Δ = -0.0200x = -0.49 A = 0.1100 B = 0.0960 Δ = 0.0140x = -0.44 A = 0.0900 B = 0.1120 Δ = -0.0220x = -0.40 A = 0.1180 B = 0.0900 Δ = 0.0280x = -0.35 A = 0.0860 B = 0.0840 Δ = 0.0020x = -0.30 A = 0.0660 B = 0.0760 Δ = -0.0100x = -0.25 A = 0.0420 B = 0.0480 Δ = -0.0060x = -0.21 A = 0.0200 B = 0.0320 Δ = -0.0120x = -0.16 A = 0.0180 B = 0.0120 Δ = 0.0060x = -0.11 A = 0.0080 B = 0.0000 Δ = 0.0080x = -0.07 A = 0.0000 B = 0.0060 Δ = -0.0060x = -0.02 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.03 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.07 A = 0.0020 B = 0.0020 Δ = 0.0000
sigma
reference stan24 bins · 16.5 … 20.2
00.060.060.110.11182017.6 · 0.11218.3 · 0.112x = 16.5 A = 0.0000 B = 0.0040 Δ = -0.0040x = 16.6 A = 0.0060 B = 0.0020 Δ = 0.0040x = 16.8 A = 0.0100 B = 0.0080 Δ = 0.0020x = 17.0 A = 0.0120 B = 0.0240 Δ = -0.0120x = 17.1 A = 0.0380 B = 0.0300 Δ = 0.0080x = 17.3 A = 0.0640 B = 0.0820 Δ = -0.0180x = 17.4 A = 0.0820 B = 0.0700 Δ = 0.0120x = 17.6 A = 0.1120 B = 0.0800 Δ = 0.0320x = 17.8 A = 0.0800 B = 0.1020 Δ = -0.0220x = 17.9 A = 0.0940 B = 0.1060 Δ = -0.0120x = 18.1 A = 0.0980 B = 0.0860 Δ = 0.0120x = 18.3 A = 0.0820 B = 0.1120 Δ = -0.0300x = 18.4 A = 0.0900 B = 0.0800 Δ = 0.0100x = 18.6 A = 0.0660 B = 0.0660 Δ = 0.0000x = 18.8 A = 0.0480 B = 0.0480 Δ = 0.0000x = 18.9 A = 0.0540 B = 0.0260 Δ = 0.0280x = 19.1 A = 0.0260 B = 0.0300 Δ = -0.0040x = 19.2 A = 0.0100 B = 0.0260 Δ = -0.0160x = 19.4 A = 0.0140 B = 0.0040 Δ = 0.0100x = 19.6 A = 0.0100 B = 0.0080 Δ = 0.0020x = 19.7 A = 0.0020 B = 0.0040 Δ = -0.0020x = 19.9 A = 0.0000 B = 0.0020 Δ = -0.0020x = 20.1 A = 0.0000 B = 0.0000 Δ = 0.0000x = 20.2 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0660 ≤ tol 0.2432 · floors 0.0958/0.1141
posteriordb-kidiq_with_mom_work / kidscore_interaction_c2
answer record(beta[1], beta[2], beta[3], beta[4], sigma) stan pass 0.0875
00 statement source: posteriordb/kidiq_with_mom_work-kidscore_interaction_c2
given

For each of N = 434 children, the data provide the child's cognitive test score and two maternal characteristics: whether the child's mother completed high school (1 = yes, 0 = no) and the mother's IQ score. The regression has four coefficients. Two are defined on centered versions of the maternal predictors: maternal high school completion is centered at 0.5, and maternal IQ is centered at 100. The third coefficient is the intercept. The fourth is the slope on the interaction between the two centered predictors. Each of the four coefficients has a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each child's test score is normally distributed with mean equal to the intercept plus a linear combination of the centered maternal predictors and their interaction, with a common standard deviation sigma. Specifically, the centered maternal high school indicator is computed as mom_hs minus 0.5, the centered maternal IQ is computed as mom_iq minus 100, and the interaction is the product of these two centered values. The mean is then beta[1] (intercept) plus beta[2] times the centered high school indicator, plus beta[3] times the centered IQ, plus beta[4] times the interaction, with standard deviation sigma.

query

The marginal posterior distributions of the five parameters: the intercept beta[1], the coefficient on centered maternal high school completion beta[2], the coefficient on centered maternal IQ beta[3], the coefficient on the interaction between centered maternal high school and centered maternal IQ beta[4], and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.088
stan
1data {
2 int<lower=0> N;
3 vector[N] kid_score;
4 vector[N] mom_hs;
5 vector[N] mom_iq;
6}
7transformed data {
8 // centering on reference points
9 vector[N] c2_mom_hs;
10 vector[N] c2_mom_iq;
11 vector[N] inter;
12 c2_mom_hs = mom_hs - 0.5;
13 c2_mom_iq = mom_iq - 100;
14 inter = c2_mom_hs .* c2_mom_iq;
15}
16parameters {
17 vector[4] beta;
18 real<lower=0> sigma;
19}
20model {
21 kid_score ~ normal(beta[1] + beta[2] * c2_mom_hs + beta[3] * c2_mom_iq
22 + beta[4] * inter, sigma);
23}
24
25//@ DATA { N: 434, kid_score: [434 values], mom_hs: [434 values], mom_iq: [434 values] } // values supplied at runtime
26//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","sigma"]
27//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
28
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], sigma)
beta[1]
reference stan24 bins · 83.3 … 90.7
00.060.060.120.12859086.5 · 0.12487.2 · 0.102x = 83.3 A = 0.0020 B = 0.0020 Δ = 0.0000x = 83.6 A = 0.0060 B = 0.0020 Δ = 0.0040x = 83.9 A = 0.0080 B = 0.0120 Δ = -0.0040x = 84.3 A = 0.0120 B = 0.0180 Δ = -0.0060x = 84.6 A = 0.0080 B = 0.0220 Δ = -0.0140x = 84.9 A = 0.0380 B = 0.0300 Δ = 0.0080x = 85.2 A = 0.0440 B = 0.0400 Δ = 0.0040x = 85.5 A = 0.0760 B = 0.0580 Δ = 0.0180x = 85.9 A = 0.0780 B = 0.0760 Δ = 0.0020x = 86.2 A = 0.1060 B = 0.0900 Δ = 0.0160x = 86.5 A = 0.1240 B = 0.0980 Δ = 0.0260x = 86.8 A = 0.0880 B = 0.0760 Δ = 0.0120x = 87.2 A = 0.0940 B = 0.1020 Δ = -0.0080x = 87.5 A = 0.0780 B = 0.0860 Δ = -0.0080x = 87.8 A = 0.0660 B = 0.0940 Δ = -0.0280x = 88.1 A = 0.0660 B = 0.0700 Δ = -0.0040x = 88.5 A = 0.0340 B = 0.0400 Δ = -0.0060x = 88.8 A = 0.0280 B = 0.0340 Δ = -0.0060x = 89.1 A = 0.0240 B = 0.0100 Δ = 0.0140x = 89.4 A = 0.0140 B = 0.0200 Δ = -0.0060x = 89.8 A = 0.0000 B = 0.0080 Δ = -0.0080x = 90.1 A = 0.0020 B = 0.0060 Δ = -0.0040x = 90.4 A = 0.0020 B = 0.0040 Δ = -0.0020x = 90.7 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[2]
reference stan24 bins · -5.36 … 10
00.060.060.120.120101.98 · 0.1221.32 · 0.112x = -5.36 A = 0.0040 B = 0.0000 Δ = 0.0040x = -4.69 A = 0.0000 B = 0.0020 Δ = -0.0020x = -4.03 A = 0.0000 B = 0.0020 Δ = -0.0020x = -3.36 A = 0.0020 B = 0.0020 Δ = 0.0000x = -2.69 A = 0.0060 B = 0.0120 Δ = -0.0060x = -2.02 A = 0.0060 B = 0.0140 Δ = -0.0080x = -1.35 A = 0.0280 B = 0.0320 Δ = -0.0040x = -0.69 A = 0.0360 B = 0.0360 Δ = 0.0000x = -0.02 A = 0.0560 B = 0.0500 Δ = 0.0060x = 0.65 A = 0.0540 B = 0.0520 Δ = 0.0020x = 1.32 A = 0.0740 B = 0.1120 Δ = -0.0380x = 1.98 A = 0.1220 B = 0.1100 Δ = 0.0120x = 2.65 A = 0.1120 B = 0.0980 Δ = 0.0140x = 3.32 A = 0.1100 B = 0.1020 Δ = 0.0080x = 3.99 A = 0.1060 B = 0.1100 Δ = -0.0040x = 4.66 A = 0.0780 B = 0.0760 Δ = 0.0020x = 5.32 A = 0.0640 B = 0.0660 Δ = -0.0020x = 5.99 A = 0.0440 B = 0.0600 Δ = -0.0160x = 6.66 A = 0.0540 B = 0.0280 Δ = 0.0260x = 7.33 A = 0.0240 B = 0.0180 Δ = 0.0060x = 7.99 A = 0.0160 B = 0.0060 Δ = 0.0100x = 8.66 A = 0.0000 B = 0.0080 Δ = -0.0080x = 9.33 A = 0.0020 B = 0.0020 Δ = 0.0000x = 10 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[3]
reference stan24 bins · 0.44 … 1.01
00.070.070.130.130.600.8010.74 · 0.1240.74 · 0.132x = 0.44 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.47 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.49 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.52 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.54 A = 0.0040 B = 0.0140 Δ = -0.0100x = 0.57 A = 0.0140 B = 0.0140 Δ = 0.0000x = 0.59 A = 0.0380 B = 0.0500 Δ = -0.0120x = 0.62 A = 0.0460 B = 0.0480 Δ = -0.0020x = 0.64 A = 0.0600 B = 0.0580 Δ = 0.0020x = 0.67 A = 0.0720 B = 0.1040 Δ = -0.0320x = 0.69 A = 0.1160 B = 0.1020 Δ = 0.0140x = 0.71 A = 0.1200 B = 0.1080 Δ = 0.0120x = 0.74 A = 0.1240 B = 0.1320 Δ = -0.0080x = 0.76 A = 0.1220 B = 0.1220 Δ = 0.0000x = 0.79 A = 0.0980 B = 0.0700 Δ = 0.0280x = 0.81 A = 0.0580 B = 0.0740 Δ = -0.0160x = 0.84 A = 0.0460 B = 0.0400 Δ = 0.0060x = 0.86 A = 0.0300 B = 0.0240 Δ = 0.0060x = 0.89 A = 0.0240 B = 0.0140 Δ = 0.0100x = 0.91 A = 0.0140 B = 0.0100 Δ = 0.0040x = 0.94 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.96 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.99 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.01 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[4]
reference stan24 bins · -0.99 … -0.02
00.060.060.120.12-0.50-0.48 · 0.120-0.44 · 0.104x = -0.99 A = 0.0000 B = 0.0040 Δ = -0.0040x = -0.94 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.90 A = 0.0040 B = 0.0060 Δ = -0.0020x = -0.86 A = 0.0040 B = 0.0080 Δ = -0.0040x = -0.82 A = 0.0100 B = 0.0180 Δ = -0.0080x = -0.78 A = 0.0260 B = 0.0180 Δ = 0.0080x = -0.73 A = 0.0400 B = 0.0440 Δ = -0.0040x = -0.69 A = 0.0460 B = 0.0400 Δ = 0.0060x = -0.65 A = 0.0600 B = 0.0440 Δ = 0.0160x = -0.61 A = 0.0840 B = 0.0720 Δ = 0.0120x = -0.57 A = 0.0840 B = 0.0840 Δ = 0.0000x = -0.53 A = 0.0900 B = 0.1020 Δ = -0.0120x = -0.48 A = 0.1200 B = 0.0940 Δ = 0.0260x = -0.44 A = 0.1020 B = 0.1040 Δ = -0.0020x = -0.40 A = 0.0840 B = 0.0880 Δ = -0.0040x = -0.36 A = 0.0600 B = 0.0860 Δ = -0.0260x = -0.32 A = 0.0800 B = 0.0560 Δ = 0.0240x = -0.27 A = 0.0300 B = 0.0560 Δ = -0.0260x = -0.23 A = 0.0340 B = 0.0380 Δ = -0.0040x = -0.19 A = 0.0200 B = 0.0140 Δ = 0.0060x = -0.15 A = 0.0100 B = 0.0100 Δ = 0.0000x = -0.11 A = 0.0040 B = 0.0080 Δ = -0.0040x = -0.06 A = 0.0040 B = 0.0040 Δ = 0.0000x = -0.02 A = 0.0020 B = 0.0000 Δ = 0.0020
sigma
reference stan24 bins · 16.3 … 20.0
00.060.060.130.13182018.2 · 0.11217.9 · 0.128x = 16.3 A = 0.0000 B = 0.0040 Δ = -0.0040x = 16.4 A = 0.0040 B = 0.0020 Δ = 0.0020x = 16.6 A = 0.0080 B = 0.0040 Δ = 0.0040x = 16.7 A = 0.0000 B = 0.0200 Δ = -0.0200x = 16.9 A = 0.0220 B = 0.0140 Δ = 0.0080x = 17.1 A = 0.0340 B = 0.0460 Δ = -0.0120x = 17.2 A = 0.0420 B = 0.0280 Δ = 0.0140x = 17.4 A = 0.0660 B = 0.0680 Δ = -0.0020x = 17.6 A = 0.1020 B = 0.0940 Δ = 0.0080x = 17.7 A = 0.0980 B = 0.1040 Δ = -0.0060x = 17.9 A = 0.0800 B = 0.1280 Δ = -0.0480x = 18.1 A = 0.1080 B = 0.0900 Δ = 0.0180x = 18.2 A = 0.1120 B = 0.0740 Δ = 0.0380x = 18.4 A = 0.0940 B = 0.0900 Δ = 0.0040x = 18.5 A = 0.0680 B = 0.0820 Δ = -0.0140x = 18.7 A = 0.0560 B = 0.0440 Δ = 0.0120x = 18.9 A = 0.0420 B = 0.0440 Δ = -0.0020x = 19.0 A = 0.0260 B = 0.0200 Δ = 0.0060x = 19.2 A = 0.0180 B = 0.0160 Δ = 0.0020x = 19.4 A = 0.0140 B = 0.0080 Δ = 0.0060x = 19.5 A = 0.0020 B = 0.0100 Δ = -0.0080x = 19.7 A = 0.0020 B = 0.0060 Δ = -0.0040x = 19.8 A = 0.0000 B = 0.0000 Δ = 0.0000x = 20.0 A = 0.0020 B = 0.0040 Δ = -0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0875 ≤ tol 0.2602 · floors 0.1082/0.1038
posteriordb-kidiq_with_mom_work / kidscore_interaction_z
answer record(beta[1], beta[2], beta[3], beta[4], sigma) stan pass 0.1480
00 statement source: posteriordb/kidiq_with_mom_work-kidscore_interaction_z
given

For each of N children, the data provide the child's cognitive test score, a binary indicator of whether the mother completed high school, and the mother's IQ score. The regression has four coefficients: an intercept, a slope on the standardized mother's high school indicator, a slope on the standardized mother's IQ, and a slope on the interaction between these two standardized predictors. Standardization of each predictor is performed by subtracting the sample mean and dividing by twice the sample standard deviation. The four regression coefficients (beta[1], beta[2], beta[3], beta[4]) each have a flat (improper uniform) prior over the reals. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each child's test score is normally distributed with a mean equal to the intercept plus the slope on standardized mother's high school indicator times that indicator, plus the slope on standardized mother's IQ times the mother's IQ, plus the slope on the interaction times the product of the two standardized predictors, and a common standard deviation sigma across all children.

query

The marginal posterior distributions of each of the five parameters: the intercept (reported as beta[1]), the slope on the standardized mother's high school indicator (reported as beta[2]), the slope on the standardized mother's IQ (reported as beta[3]), the slope on the interaction between standardized predictors (reported as beta[4]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.148
stan
1data {
2 int<lower=0> N;
3 vector[N] kid_score;
4 vector[N] mom_hs;
5 vector[N] mom_iq;
6}
7transformed data {
8 // standardizing
9 vector[N] z_mom_hs;
10 vector[N] z_mom_iq;
11 vector[N] inter;
12 z_mom_hs = (mom_hs - mean(mom_hs)) / (2 * sd(mom_hs));
13 z_mom_iq = (mom_iq - mean(mom_iq)) / (2 * sd(mom_iq));
14 inter = z_mom_hs .* z_mom_iq;
15}
16parameters {
17 vector[4] beta;
18 real<lower=0> sigma;
19}
20model {
21 kid_score ~ normal(beta[1] + beta[2] * z_mom_hs + beta[3] * z_mom_iq
22 + beta[4] * inter, sigma);
23}
24
25//@ DATA { N: 434, kid_score: [434 values], mom_hs: [434 values], mom_iq: [434 values] } // values supplied at runtime
26//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","sigma"]
27//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
28
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], sigma)
beta[1]
reference stan24 bins · 84.9 … 90.2
00.060.060.120.1286889087.7 · 0.11687.5 · 0.110x = 84.9 A = 0.0020 B = 0.0020 Δ = 0.0000x = 85.2 A = 0.0020 B = 0.0020 Δ = 0.0000x = 85.4 A = 0.0060 B = 0.0040 Δ = 0.0020x = 85.6 A = 0.0100 B = 0.0100 Δ = 0.0000x = 85.9 A = 0.0120 B = 0.0120 Δ = 0.0000x = 86.1 A = 0.0180 B = 0.0180 Δ = 0.0000x = 86.3 A = 0.0320 B = 0.0320 Δ = 0.0000x = 86.5 A = 0.0620 B = 0.0540 Δ = 0.0080x = 86.8 A = 0.0500 B = 0.0600 Δ = -0.0100x = 87.0 A = 0.0860 B = 0.0760 Δ = 0.0100x = 87.2 A = 0.0640 B = 0.0820 Δ = -0.0180x = 87.5 A = 0.1080 B = 0.1100 Δ = -0.0020x = 87.7 A = 0.1160 B = 0.0860 Δ = 0.0300x = 87.9 A = 0.0740 B = 0.0840 Δ = -0.0100x = 88.2 A = 0.1000 B = 0.0860 Δ = 0.0140x = 88.4 A = 0.0800 B = 0.0840 Δ = -0.0040x = 88.6 A = 0.0420 B = 0.0640 Δ = -0.0220x = 88.8 A = 0.0560 B = 0.0480 Δ = 0.0080x = 89.1 A = 0.0320 B = 0.0240 Δ = 0.0080x = 89.3 A = 0.0140 B = 0.0240 Δ = -0.0100x = 89.5 A = 0.0180 B = 0.0140 Δ = 0.0040x = 89.8 A = 0.0120 B = 0.0120 Δ = 0.0000x = 90.0 A = 0.0040 B = 0.0040 Δ = 0.0000x = 90.2 A = 0.0000 B = 0.0080 Δ = -0.0080
beta[2]
reference stan24 bins · -3.75 … 9.08
00.070.070.140.14051.83 · 0.1342.95 · 0.136x = -3.75 A = 0.0040 B = 0.0000 Δ = 0.0040x = -3.19 A = 0.0000 B = 0.0020 Δ = -0.0020x = -2.63 A = 0.0060 B = 0.0140 Δ = -0.0080x = -2.07 A = 0.0060 B = 0.0060 Δ = 0.0000x = -1.51 A = 0.0280 B = 0.0160 Δ = 0.0120x = -0.96 A = 0.0340 B = 0.0240 Δ = 0.0100x = -0.40 A = 0.0440 B = 0.0480 Δ = -0.0040x = 0.16 A = 0.0720 B = 0.0580 Δ = 0.0140x = 0.72 A = 0.0680 B = 0.0980 Δ = -0.0300x = 1.27 A = 0.0740 B = 0.0980 Δ = -0.0240x = 1.83 A = 0.1340 B = 0.0960 Δ = 0.0380x = 2.39 A = 0.1180 B = 0.1160 Δ = 0.0020x = 2.95 A = 0.0960 B = 0.1360 Δ = -0.0400x = 3.51 A = 0.0900 B = 0.1140 Δ = -0.0240x = 4.06 A = 0.0620 B = 0.0580 Δ = 0.0040x = 4.62 A = 0.0640 B = 0.0340 Δ = 0.0300x = 5.18 A = 0.0360 B = 0.0340 Δ = 0.0020x = 5.74 A = 0.0200 B = 0.0220 Δ = -0.0020x = 6.29 A = 0.0200 B = 0.0100 Δ = 0.0100x = 6.85 A = 0.0080 B = 0.0060 Δ = 0.0020x = 7.41 A = 0.0120 B = 0.0040 Δ = 0.0080x = 7.97 A = 0.0020 B = 0.0020 Δ = 0.0000x = 8.53 A = 0.0020 B = 0.0020 Δ = 0.0000x = 9.08 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[3]
reference stan24 bins · 12.8 … 23.2
00.060.060.120.12152017.8 · 0.11018.3 · 0.116x = 12.8 A = 0.0040 B = 0.0000 Δ = 0.0040x = 13.3 A = 0.0020 B = 0.0060 Δ = -0.0040x = 13.8 A = 0.0040 B = 0.0120 Δ = -0.0080x = 14.2 A = 0.0180 B = 0.0060 Δ = 0.0120x = 14.7 A = 0.0320 B = 0.0200 Δ = 0.0120x = 15.1 A = 0.0280 B = 0.0320 Δ = -0.0040x = 15.6 A = 0.0540 B = 0.0560 Δ = -0.0020x = 16 A = 0.0540 B = 0.0740 Δ = -0.0200x = 16.4 A = 0.0700 B = 0.0720 Δ = -0.0020x = 16.9 A = 0.0900 B = 0.0820 Δ = 0.0080x = 17.4 A = 0.0940 B = 0.0980 Δ = -0.0040x = 17.8 A = 0.1100 B = 0.0680 Δ = 0.0420x = 18.3 A = 0.0820 B = 0.1160 Δ = -0.0340x = 18.7 A = 0.0820 B = 0.0880 Δ = -0.0060x = 19.2 A = 0.0840 B = 0.0920 Δ = -0.0080x = 19.6 A = 0.0600 B = 0.0620 Δ = -0.0020x = 20.1 A = 0.0340 B = 0.0500 Δ = -0.0160x = 20.5 A = 0.0400 B = 0.0240 Δ = 0.0160x = 21.0 A = 0.0240 B = 0.0140 Δ = 0.0100x = 21.4 A = 0.0160 B = 0.0200 Δ = -0.0040x = 21.9 A = 0.0100 B = 0.0020 Δ = 0.0080x = 22.3 A = 0.0060 B = 0.0040 Δ = 0.0020x = 22.8 A = 0.0000 B = 0.0020 Δ = -0.0020x = 23.2 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[4]
reference stan24 bins · -23.6 … 0.10
00.060.060.120.12-20-100-12.2 · 0.118-10.2 · 0.108x = -23.6 A = 0.0000 B = 0.0020 Δ = -0.0020x = -22.6 A = 0.0020 B = 0.0040 Δ = -0.0020x = -21.5 A = 0.0040 B = 0.0080 Δ = -0.0040x = -20.5 A = 0.0100 B = 0.0100 Δ = 0.0000x = -19.5 A = 0.0200 B = 0.0100 Δ = 0.0100x = -18.4 A = 0.0320 B = 0.0320 Δ = 0.0000x = -17.4 A = 0.0320 B = 0.0400 Δ = -0.0080x = -16.4 A = 0.0520 B = 0.0740 Δ = -0.0220x = -15.3 A = 0.0880 B = 0.0540 Δ = 0.0340x = -14.3 A = 0.0960 B = 0.0960 Δ = 0.0000x = -13.3 A = 0.0780 B = 0.1000 Δ = -0.0220x = -12.2 A = 0.1180 B = 0.1060 Δ = 0.0120x = -11.2 A = 0.1080 B = 0.1040 Δ = 0.0040x = -10.2 A = 0.0860 B = 0.1080 Δ = -0.0220x = -9.10 A = 0.0800 B = 0.0860 Δ = -0.0060x = -8.10 A = 0.0640 B = 0.0320 Δ = 0.0320x = -7.10 A = 0.0420 B = 0.0440 Δ = -0.0020x = -6 A = 0.0240 B = 0.0260 Δ = -0.0020x = -5 A = 0.0160 B = 0.0220 Δ = -0.0060x = -4 A = 0.0260 B = 0.0100 Δ = 0.0160x = -2.90 A = 0.0100 B = 0.0140 Δ = -0.0040x = -1.90 A = 0.0080 B = 0.0120 Δ = -0.0040x = -0.90 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.10 A = 0.0040 B = 0.0000 Δ = 0.0040
sigma
reference stan24 bins · 16.2 … 20.1
00.060.060.120.12182017.8 · 0.12417.6 · 0.106x = 16.2 A = 0.0000 B = 0.0020 Δ = -0.0020x = 16.4 A = 0.0000 B = 0.0080 Δ = -0.0080x = 16.6 A = 0.0040 B = 0.0080 Δ = -0.0040x = 16.8 A = 0.0080 B = 0.0120 Δ = -0.0040x = 16.9 A = 0.0220 B = 0.0120 Δ = 0.0100x = 17.1 A = 0.0260 B = 0.0580 Δ = -0.0320x = 17.3 A = 0.0580 B = 0.0540 Δ = 0.0040x = 17.4 A = 0.0560 B = 0.0720 Δ = -0.0160x = 17.6 A = 0.1140 B = 0.1060 Δ = 0.0080x = 17.8 A = 0.1240 B = 0.1000 Δ = 0.0240x = 17.9 A = 0.0840 B = 0.1000 Δ = -0.0160x = 18.1 A = 0.1220 B = 0.1020 Δ = 0.0200x = 18.3 A = 0.0920 B = 0.0740 Δ = 0.0180x = 18.4 A = 0.0720 B = 0.0980 Δ = -0.0260x = 18.6 A = 0.0720 B = 0.0580 Δ = 0.0140x = 18.8 A = 0.0440 B = 0.0480 Δ = -0.0040x = 19.0 A = 0.0340 B = 0.0320 Δ = 0.0020x = 19.1 A = 0.0340 B = 0.0160 Δ = 0.0180x = 19.3 A = 0.0060 B = 0.0160 Δ = -0.0100x = 19.5 A = 0.0140 B = 0.0100 Δ = 0.0040x = 19.6 A = 0.0080 B = 0.0080 Δ = 0.0000x = 19.8 A = 0.0040 B = 0.0040 Δ = 0.0000x = 20.0 A = 0.0020 B = 0.0000 Δ = 0.0020x = 20.1 A = 0.0000 B = 0.0020 Δ = -0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.1480 ≤ tol 0.8464 · floors 0.2620/0.2591
posteriordb-kidiq_with_mom_work / kidscore_mom_work
answer record(beta[1], beta[2], beta[3], beta[4], sigma) stan pass 0.1269
00 statement source: posteriordb/kidiq_with_mom_work-kidscore_mom_work
given

For each of N = 434 children the data provide the child's cognitive test score and the mother's employment status, encoded as an integer category with four levels. The regression has four coefficients, one for each employment status category, each with a flat (improper uniform) prior over the reals. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each child's test score is normally distributed with a mean determined by the mother's employment status category and a common standard deviation sigma across all children. Specifically, the mean is given by the coefficient corresponding to the child's mother's employment status category.

query

The marginal posterior distribution of each of the five parameters: beta[1], beta[2], beta[3], and beta[4] (the four employment-status-specific mean parameters), and sigma (the error standard deviation).

answer spec record(beta[1], beta[2], beta[3], beta[4], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.127
stan
1data {
2 int<lower=0> N;
3 vector[N] kid_score;
4 array[N] int mom_work;
5}
6transformed data {
7 vector[N] work2;
8 vector[N] work3;
9 vector[N] work4;
10 for (i in 1 : N) {
11 work2[i] = mom_work[i] == 2;
12 work3[i] = mom_work[i] == 3;
13 work4[i] = mom_work[i] == 4;
14 }
15}
16parameters {
17 vector[4] beta;
18 real<lower=0> sigma;
19}
20model {
21 kid_score ~ normal(beta[1] + beta[2] * work2 + beta[3] * work3
22 + beta[4] * work4, sigma);
23}
24
25//@ DATA { N: 434, kid_score: [434 values], mom_work: [434 values] } // values supplied at runtime
26//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","sigma"]
27//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
28
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], sigma)
beta[1]
reference stan24 bins · 74.5 … 88.9
00.060.060.110.118082.6 · 0.11281.4 · 0.104x = 74.5 A = 0.0040 B = 0.0000 Δ = 0.0040x = 75.2 A = 0.0020 B = 0.0020 Δ = 0.0000x = 75.8 A = 0.0020 B = 0.0100 Δ = -0.0080x = 76.4 A = 0.0040 B = 0.0040 Δ = 0.0000x = 77.0 A = 0.0120 B = 0.0100 Δ = 0.0020x = 77.7 A = 0.0180 B = 0.0140 Δ = 0.0040x = 78.3 A = 0.0280 B = 0.0320 Δ = -0.0040x = 78.9 A = 0.0400 B = 0.0500 Δ = -0.0100x = 79.5 A = 0.0780 B = 0.0780 Δ = 0.0000x = 80.2 A = 0.0760 B = 0.0760 Δ = 0.0000x = 80.8 A = 0.1100 B = 0.1020 Δ = 0.0080x = 81.4 A = 0.0920 B = 0.1040 Δ = -0.0120x = 82.0 A = 0.0960 B = 0.0880 Δ = 0.0080x = 82.6 A = 0.1120 B = 0.1020 Δ = 0.0100x = 83.3 A = 0.0940 B = 0.0760 Δ = 0.0180x = 83.9 A = 0.0800 B = 0.0680 Δ = 0.0120x = 84.5 A = 0.0480 B = 0.0840 Δ = -0.0360x = 85.1 A = 0.0320 B = 0.0420 Δ = -0.0100x = 85.8 A = 0.0240 B = 0.0220 Δ = 0.0020x = 86.4 A = 0.0260 B = 0.0180 Δ = 0.0080x = 87 A = 0.0080 B = 0.0020 Δ = 0.0060x = 87.6 A = 0.0100 B = 0.0060 Δ = 0.0040x = 88.3 A = 0.0040 B = 0.0060 Δ = -0.0020x = 88.9 A = 0.0000 B = 0.0040 Δ = -0.0040
beta[2]
reference stan24 bins · -5.61 … 12.8
00.060.060.120.120103.20 · 0.1123.20 · 0.118x = -5.61 A = 0.0000 B = 0.0020 Δ = -0.0020x = -4.81 A = 0.0020 B = 0.0000 Δ = 0.0020x = -4.01 A = 0.0060 B = 0.0040 Δ = 0.0020x = -3.21 A = 0.0080 B = 0.0060 Δ = 0.0020x = -2.41 A = 0.0100 B = 0.0140 Δ = -0.0040x = -1.61 A = 0.0180 B = 0.0220 Δ = -0.0040x = -0.80 A = 0.0260 B = 0.0300 Δ = -0.0040x = 0 A = 0.0420 B = 0.0340 Δ = 0.0080x = 0.80 A = 0.0740 B = 0.0740 Δ = 0.0000x = 1.60 A = 0.0760 B = 0.0700 Δ = 0.0060x = 2.40 A = 0.0900 B = 0.0800 Δ = 0.0100x = 3.20 A = 0.1120 B = 0.1180 Δ = -0.0060x = 4 A = 0.1000 B = 0.1000 Δ = 0.0000x = 4.81 A = 0.1060 B = 0.0900 Δ = 0.0160x = 5.61 A = 0.0840 B = 0.0780 Δ = 0.0060x = 6.41 A = 0.0540 B = 0.0840 Δ = -0.0300x = 7.21 A = 0.0740 B = 0.0640 Δ = 0.0100x = 8.01 A = 0.0340 B = 0.0360 Δ = -0.0020x = 8.81 A = 0.0240 B = 0.0320 Δ = -0.0080x = 9.61 A = 0.0260 B = 0.0260 Δ = 0.0000x = 10.4 A = 0.0120 B = 0.0200 Δ = -0.0080x = 11.2 A = 0.0100 B = 0.0120 Δ = -0.0020x = 12.0 A = 0.0080 B = 0.0040 Δ = 0.0040x = 12.8 A = 0.0040 B = 0.0000 Δ = 0.0040
beta[3]
reference stan24 bins · 1.27 … 23.8
00.070.070.140.14102012.0 · 0.13812.0 · 0.118x = 1.27 A = 0.0020 B = 0.0020 Δ = 0.0000x = 2.25 A = 0.0000 B = 0.0040 Δ = -0.0040x = 3.23 A = 0.0080 B = 0.0100 Δ = -0.0020x = 4.20 A = 0.0080 B = 0.0180 Δ = -0.0100x = 5.18 A = 0.0300 B = 0.0180 Δ = 0.0120x = 6.16 A = 0.0300 B = 0.0560 Δ = -0.0260x = 7.14 A = 0.0520 B = 0.0320 Δ = 0.0200x = 8.12 A = 0.0860 B = 0.0680 Δ = 0.0180x = 9.10 A = 0.0900 B = 0.0940 Δ = -0.0040x = 10.1 A = 0.0940 B = 0.0840 Δ = 0.0100x = 11.1 A = 0.0880 B = 0.1120 Δ = -0.0240x = 12.0 A = 0.1380 B = 0.1180 Δ = 0.0200x = 13.0 A = 0.0900 B = 0.0880 Δ = 0.0020x = 14.0 A = 0.0780 B = 0.0880 Δ = -0.0100x = 15.0 A = 0.0700 B = 0.0720 Δ = -0.0020x = 15.9 A = 0.0500 B = 0.0540 Δ = -0.0040x = 16.9 A = 0.0360 B = 0.0220 Δ = 0.0140x = 17.9 A = 0.0220 B = 0.0160 Δ = 0.0060x = 18.9 A = 0.0120 B = 0.0160 Δ = -0.0040x = 19.9 A = 0.0080 B = 0.0060 Δ = 0.0020x = 20.8 A = 0.0040 B = 0.0040 Δ = 0.0000x = 21.8 A = 0.0040 B = 0.0080 Δ = -0.0040x = 22.8 A = 0.0000 B = 0.0080 Δ = -0.0080x = 23.8 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[4]
reference stan24 bins · -4.32 … 14.7
00.070.070.140.140106.44 · 0.1443.96 · 0.122x = -4.32 A = 0.0000 B = 0.0020 Δ = -0.0020x = -3.49 A = 0.0000 B = 0.0020 Δ = -0.0020x = -2.67 A = 0.0020 B = 0.0040 Δ = -0.0020x = -1.84 A = 0.0060 B = 0.0000 Δ = 0.0060x = -1.01 A = 0.0120 B = 0.0080 Δ = 0.0040x = -0.18 A = 0.0300 B = 0.0140 Δ = 0.0160x = 0.65 A = 0.0240 B = 0.0280 Δ = -0.0040x = 1.48 A = 0.0360 B = 0.0540 Δ = -0.0180x = 2.30 A = 0.0560 B = 0.0660 Δ = -0.0100x = 3.13 A = 0.0740 B = 0.0800 Δ = -0.0060x = 3.96 A = 0.1120 B = 0.1220 Δ = -0.0100x = 4.79 A = 0.0960 B = 0.1180 Δ = -0.0220x = 5.62 A = 0.1160 B = 0.1060 Δ = 0.0100x = 6.44 A = 0.1440 B = 0.1060 Δ = 0.0380x = 7.27 A = 0.0840 B = 0.0980 Δ = -0.0140x = 8.10 A = 0.0960 B = 0.0780 Δ = 0.0180x = 8.93 A = 0.0480 B = 0.0460 Δ = 0.0020x = 9.76 A = 0.0380 B = 0.0220 Δ = 0.0160x = 10.6 A = 0.0120 B = 0.0220 Δ = -0.0100x = 11.4 A = 0.0060 B = 0.0120 Δ = -0.0060x = 12.2 A = 0.0060 B = 0.0040 Δ = 0.0020x = 13.1 A = 0.0020 B = 0.0060 Δ = -0.0040x = 13.9 A = 0.0000 B = 0.0000 Δ = 0.0000x = 14.7 A = 0.0000 B = 0.0020 Δ = -0.0020
sigma
reference stan24 bins · 18.3 … 22.6
00.080.080.160.16202220.4 · 0.10020.4 · 0.162x = 18.3 A = 0.0000 B = 0.0020 Δ = -0.0020x = 18.5 A = 0.0040 B = 0.0020 Δ = 0.0020x = 18.7 A = 0.0060 B = 0.0100 Δ = -0.0040x = 18.9 A = 0.0120 B = 0.0120 Δ = 0.0000x = 19.1 A = 0.0320 B = 0.0200 Δ = 0.0120x = 19.3 A = 0.0400 B = 0.0280 Δ = 0.0120x = 19.4 A = 0.0460 B = 0.0500 Δ = -0.0040x = 19.6 A = 0.0900 B = 0.0460 Δ = 0.0440x = 19.8 A = 0.0920 B = 0.0740 Δ = 0.0180x = 20 A = 0.0820 B = 0.0820 Δ = -0.0000x = 20.2 A = 0.0960 B = 0.1040 Δ = -0.0080x = 20.4 A = 0.1000 B = 0.1620 Δ = -0.0620x = 20.6 A = 0.0820 B = 0.1040 Δ = -0.0220x = 20.7 A = 0.0740 B = 0.1020 Δ = -0.0280x = 20.9 A = 0.0520 B = 0.0760 Δ = -0.0240x = 21.1 A = 0.0500 B = 0.0400 Δ = 0.0100x = 21.3 A = 0.0520 B = 0.0280 Δ = 0.0240x = 21.5 A = 0.0340 B = 0.0200 Δ = 0.0140x = 21.7 A = 0.0260 B = 0.0160 Δ = 0.0100x = 21.8 A = 0.0140 B = 0.0060 Δ = 0.0080x = 22.0 A = 0.0040 B = 0.0060 Δ = -0.0020x = 22.2 A = 0.0040 B = 0.0060 Δ = -0.0020x = 22.4 A = 0.0080 B = 0.0020 Δ = 0.0060x = 22.6 A = 0.0000 B = 0.0020 Δ = -0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.1269 ≤ tol 0.4941 · floors 0.2195/0.2470
posteriordb-kilpisjarvi_mod / kilpisjarvi
answer record(alpha, beta, sigma) stan pass 1.4862
00 statement source: posteriordb/kilpisjarvi_mod-kilpisjarvi
given

The data comprise N observations, each consisting of a predictor value x and a response value y. Additionally, the data supply four hyperparameters that specify the prior distributions: pmualpha and psalpha are the mean and standard deviation of the prior for the intercept alpha; pmubeta and psbeta are the mean and standard deviation of the prior for the slope beta. The intercept alpha has a Normal(pmualpha, psalpha) prior. The slope beta has a Normal(pmubeta, psbeta) prior. The error standard deviation sigma, constrained positive, has an improper flat (uniform) prior over the positive reals.

model

Each observation's response value y is Normal-distributed with a mean equal to the intercept alpha plus the slope beta times that observation's predictor value x, and a common standard deviation sigma across all observations.

query

The marginal posterior distribution of each of the three parameters: alpha (the intercept), beta (the slope), and sigma (the error standard deviation).

answer spec record(alpha, beta, sigma)
{
  "kind": "record",
  "fields": {
    "alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "beta": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization1.486
stan
1// Gaussian linear model with adjustable priors
2data {
3 int<lower=0> N; // number of data points
4 vector[N] x; //
5 vector[N] y; //
6 real xpred; // input location for prediction
7 real pmualpha; // prior mean for alpha
8 real psalpha; // prior std for alpha
9 real pmubeta; // prior mean for beta
10 real psbeta; // prior std for beta
11}
12parameters {
13 real alpha;
14 real beta;
15 real<lower=0> sigma;
16}
17model {
18 alpha ~ normal(pmualpha, psalpha);
19 beta ~ normal(pmubeta, psbeta);
20 y ~ normal(alpha + beta * x, sigma);
21}
22
23//@ DATA { N: 62, x: [62 values], y: [62 values], xpred: 2016, pmualpha: 9.31290322580645, psalpha: 100, pmubeta: 0, psbeta: 0.0333333333333333 } // values supplied at runtime
24//@ PARAMS ["alpha","beta","sigma"]
25//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
26
02answer overlay — reference vs stanrecord(alpha, beta, sigma)
alpha
reference stan24 bins · -144 … 28.1
00.060.060.110.11-1000-54.4 · 0.110-61.9 · 0.106x = -144 A = 0.0020 B = 0.0020 Δ = 0.0000x = -137 A = 0.0040 B = 0.0060 Δ = -0.0020x = -129 A = 0.0100 B = 0.0020 Δ = 0.0080x = -122 A = 0.0040 B = 0.0200 Δ = -0.0160x = -114 A = 0.0120 B = 0.0200 Δ = -0.0080x = -107 A = 0.0280 B = 0.0400 Δ = -0.0120x = -99.3 A = 0.0400 B = 0.0500 Δ = -0.0100x = -91.8 A = 0.0480 B = 0.0860 Δ = -0.0380x = -84.4 A = 0.0660 B = 0.0600 Δ = 0.0060x = -76.9 A = 0.0880 B = 0.0680 Δ = 0.0200x = -69.4 A = 0.0920 B = 0.0940 Δ = -0.0020x = -61.9 A = 0.0960 B = 0.1060 Δ = -0.0100x = -54.4 A = 0.1100 B = 0.0880 Δ = 0.0220x = -46.9 A = 0.0960 B = 0.0760 Δ = 0.0200x = -39.4 A = 0.0880 B = 0.0780 Δ = 0.0100x = -31.9 A = 0.0560 B = 0.0620 Δ = -0.0060x = -24.4 A = 0.0420 B = 0.0480 Δ = -0.0060x = -16.9 A = 0.0440 B = 0.0480 Δ = -0.0040x = -9.40 A = 0.0360 B = 0.0200 Δ = 0.0160x = -1.90 A = 0.0220 B = 0.0120 Δ = 0.0100x = 5.60 A = 0.0120 B = 0.0080 Δ = 0.0040x = 13.1 A = 0.0020 B = 0.0040 Δ = -0.0020x = 20.6 A = 0.0000 B = 0.0020 Δ = -0.0020x = 28.1 A = 0.0020 B = 0.0000 Δ = 0.0020
beta
reference stan24 bins · -0.01 … 0.04
00.060.060.110.1100.020.02 · 0.1140.02 · 0.106x = -0.01 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.00 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.00 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.00 A = 0.0080 B = 0.0060 Δ = 0.0020x = 0.00 A = 0.0260 B = 0.0120 Δ = 0.0140x = 0.00 A = 0.0340 B = 0.0220 Δ = 0.0120x = 0.01 A = 0.0460 B = 0.0480 Δ = -0.0020x = 0.01 A = 0.0420 B = 0.0500 Δ = -0.0080x = 0.01 A = 0.0640 B = 0.0640 Δ = 0.0000x = 0.01 A = 0.1100 B = 0.0960 Δ = 0.0140x = 0.01 A = 0.0980 B = 0.0680 Δ = 0.0300x = 0.02 A = 0.0480 B = 0.0600 Δ = -0.0120x = 0.02 A = 0.1140 B = 0.1020 Δ = 0.0120x = 0.02 A = 0.1000 B = 0.1060 Δ = -0.0060x = 0.02 A = 0.0920 B = 0.0660 Δ = 0.0260x = 0.02 A = 0.0680 B = 0.0700 Δ = -0.0020x = 0.03 A = 0.0520 B = 0.0840 Δ = -0.0320x = 0.03 A = 0.0380 B = 0.0560 Δ = -0.0180x = 0.03 A = 0.0260 B = 0.0400 Δ = -0.0140x = 0.03 A = 0.0120 B = 0.0200 Δ = -0.0080x = 0.03 A = 0.0060 B = 0.0140 Δ = -0.0080x = 0.04 A = 0.0100 B = 0.0040 Δ = 0.0060x = 0.04 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.04 A = 0.0020 B = 0.0000 Δ = 0.0020
sigma
reference stan24 bins · 0.90 … 1.57
00.070.070.140.1411.501.10 · 0.1421.10 · 0.122x = 0.90 A = 0.0100 B = 0.0020 Δ = 0.0080x = 0.93 A = 0.0180 B = 0.0160 Δ = 0.0020x = 0.96 A = 0.0200 B = 0.0220 Δ = -0.0020x = 0.99 A = 0.0420 B = 0.0660 Δ = -0.0240x = 1.01 A = 0.0800 B = 0.0600 Δ = 0.0200x = 1.04 A = 0.1040 B = 0.0660 Δ = 0.0380x = 1.07 A = 0.1080 B = 0.1000 Δ = 0.0080x = 1.10 A = 0.1420 B = 0.1220 Δ = 0.0200x = 1.13 A = 0.0920 B = 0.0920 Δ = -0.0000x = 1.16 A = 0.1180 B = 0.0880 Δ = 0.0300x = 1.19 A = 0.0820 B = 0.0800 Δ = 0.0020x = 1.22 A = 0.0560 B = 0.0680 Δ = -0.0120x = 1.25 A = 0.0380 B = 0.0620 Δ = -0.0240x = 1.28 A = 0.0320 B = 0.0400 Δ = -0.0080x = 1.31 A = 0.0220 B = 0.0380 Δ = -0.0160x = 1.34 A = 0.0160 B = 0.0260 Δ = -0.0100x = 1.37 A = 0.0120 B = 0.0160 Δ = -0.0040x = 1.40 A = 0.0040 B = 0.0060 Δ = -0.0020x = 1.43 A = 0.0020 B = 0.0060 Δ = -0.0040x = 1.46 A = 0.0000 B = 0.0100 Δ = -0.0100x = 1.49 A = 0.0000 B = 0.0080 Δ = -0.0080x = 1.51 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.54 A = 0.0000 B = 0.0060 Δ = -0.0060x = 1.57 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=1.4862 ≤ tol 5.6980 · floors 2.8490/1.9225
posteriordb-low_dim_gauss_mix / low_dim_gauss_mix
answer record(mu[1], mu[2], sigma[1], sigma[2], theta) stan pass 0.0015
00 statement source: posteriordb/low_dim_gauss_mix-low_dim_gauss_mix
given

For each of N observations the data provide a single real value y. The model infers a two-component Gaussian mixture in which the two component means are ordered (mu[1] is less than or equal to mu[2]), and each component has its own positive standard deviation. The means mu[1] and mu[2], with the ordering constraint, have a Normal(0, 2) prior. Each standard deviation sigma[1] and sigma[2] has an independent Normal(0, 2) prior, constrained positive. The mixing weight theta, the probability of component 1, has a Beta(5, 5) prior and is constrained to lie in [0, 1].

model

A two-component Gaussian mixture model generates the observed data. Each observation is generated from one of two components: with probability theta it is drawn from component 1 (a Normal distribution with mean mu[1] and standard deviation sigma[1]), and with probability 1 - theta it is drawn from component 2 (a Normal distribution with mean mu[2] and standard deviation sigma[2]). The two component means satisfy an ordering: mu[1] is less than or equal to mu[2]. All observations are independent draws from this mixture distribution.

query

The marginal posterior distributions of the five parameters: mu[1] and mu[2] (the ordered component means), sigma[1] and sigma[2] (the component standard deviations), and theta (the mixing weight for component 1).

answer spec record(mu[1], mu[2], sigma[1], sigma[2], theta)
{
  "kind": "record",
  "fields": {
    "mu[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "mu[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.001
stan
1data {
2 int<lower=0> N;
3 vector[N] y;
4}
5parameters {
6 ordered[2] mu;
7 array[2] real<lower=0> sigma;
8 real<lower=0, upper=1> theta;
9}
10model {
11 sigma ~ normal(0, 2);
12 mu ~ normal(0, 2);
13 theta ~ beta(5, 5);
14 for (n in 1 : N) {
15 target += log_mix(theta, normal_lpdf(y[n] | mu[1], sigma[1]),
16 normal_lpdf(y[n] | mu[2], sigma[2]));
17 }
18}
19
20//@ DATA { N: 1000, y: [1000 values] } // values supplied at runtime
21//@ PARAMS ["mu[1]","mu[2]","sigma[1]","sigma[2]","theta"]
22//@ SAMPLING {"chains":8,"iter_warmup":6000,"iter_sampling":3000,"adapt_delta":0.8}
23
02answer overlay — reference vs stanrecord(mu[1], mu[2], sigma[1], sigma[2], theta)
mu[1]
reference stan24 bins · -2.86 … -2.60
00.060.060.130.13-2.80-2.70-2.60-2.72 · 0.126-2.74 · 0.104x = -2.86 A = 0.0020 B = 0.0060 Δ = -0.0040x = -2.85 A = 0.0000 B = 0.0100 Δ = -0.0100x = -2.83 A = 0.0040 B = 0.0060 Δ = -0.0020x = -2.82 A = 0.0080 B = 0.0120 Δ = -0.0040x = -2.81 A = 0.0160 B = 0.0400 Δ = -0.0240x = -2.80 A = 0.0300 B = 0.0240 Δ = 0.0060x = -2.79 A = 0.0600 B = 0.0500 Δ = 0.0100x = -2.78 A = 0.0920 B = 0.0640 Δ = 0.0280x = -2.77 A = 0.0820 B = 0.0720 Δ = 0.0100x = -2.76 A = 0.0880 B = 0.0940 Δ = -0.0060x = -2.74 A = 0.0940 B = 0.1040 Δ = -0.0100x = -2.73 A = 0.0900 B = 0.0820 Δ = 0.0080x = -2.72 A = 0.1260 B = 0.0900 Δ = 0.0360x = -2.71 A = 0.0980 B = 0.0860 Δ = 0.0120x = -2.70 A = 0.0660 B = 0.0700 Δ = -0.0040x = -2.69 A = 0.0480 B = 0.0620 Δ = -0.0140x = -2.68 A = 0.0360 B = 0.0460 Δ = -0.0100x = -2.67 A = 0.0320 B = 0.0220 Δ = 0.0100x = -2.65 A = 0.0100 B = 0.0300 Δ = -0.0200x = -2.64 A = 0.0120 B = 0.0120 Δ = 0.0000x = -2.63 A = 0.0020 B = 0.0060 Δ = -0.0040x = -2.62 A = 0.0020 B = 0.0060 Δ = -0.0040x = -2.61 A = 0.0020 B = 0.0020 Δ = 0.0000x = -2.60 A = 0.0000 B = 0.0040 Δ = -0.0040
mu[2]
reference stan24 bins · 2.68 … 3.04
00.060.060.120.122.8032.90 · 0.1182.90 · 0.114x = 2.68 A = 0.0000 B = 0.0020 Δ = -0.0020x = 2.70 A = 0.0020 B = 0.0000 Δ = 0.0020x = 2.71 A = 0.0000 B = 0.0040 Δ = -0.0040x = 2.73 A = 0.0040 B = 0.0000 Δ = 0.0040x = 2.74 A = 0.0020 B = 0.0080 Δ = -0.0060x = 2.76 A = 0.0140 B = 0.0120 Δ = 0.0020x = 2.77 A = 0.0300 B = 0.0100 Δ = 0.0200x = 2.79 A = 0.0360 B = 0.0380 Δ = -0.0020x = 2.81 A = 0.0340 B = 0.0500 Δ = -0.0160x = 2.82 A = 0.0860 B = 0.0660 Δ = 0.0200x = 2.84 A = 0.1080 B = 0.1080 Δ = 0.0000x = 2.85 A = 0.1100 B = 0.0980 Δ = 0.0120x = 2.87 A = 0.1100 B = 0.1080 Δ = 0.0020x = 2.88 A = 0.1140 B = 0.1100 Δ = 0.0040x = 2.90 A = 0.1180 B = 0.1140 Δ = 0.0040x = 2.91 A = 0.0920 B = 0.0720 Δ = 0.0200x = 2.93 A = 0.0580 B = 0.0680 Δ = -0.0100x = 2.94 A = 0.0400 B = 0.0440 Δ = -0.0040x = 2.96 A = 0.0220 B = 0.0320 Δ = -0.0100x = 2.98 A = 0.0080 B = 0.0200 Δ = -0.0120x = 2.99 A = 0.0060 B = 0.0180 Δ = -0.0120x = 3.01 A = 0.0040 B = 0.0120 Δ = -0.0080x = 3.02 A = 0.0020 B = 0.0020 Δ = 0.0000x = 3.04 A = 0.0000 B = 0.0040 Δ = -0.0040
sigma[1]
reference stan24 bins · 0.94 … 1.13
00.060.060.120.1211.101.01 · 0.1181.03 · 0.102x = 0.94 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.95 A = 0.0000 B = 0.0080 Δ = -0.0080x = 0.96 A = 0.0100 B = 0.0020 Δ = 0.0080x = 0.97 A = 0.0140 B = 0.0120 Δ = 0.0020x = 0.97 A = 0.0120 B = 0.0340 Δ = -0.0220x = 0.98 A = 0.0480 B = 0.0480 Δ = 0.0000x = 0.99 A = 0.0380 B = 0.0520 Δ = -0.0140x = 1.00 A = 0.0800 B = 0.0560 Δ = 0.0240x = 1.01 A = 0.1180 B = 0.0920 Δ = 0.0260x = 1.02 A = 0.0940 B = 0.0980 Δ = -0.0040x = 1.02 A = 0.1000 B = 0.0920 Δ = 0.0080x = 1.03 A = 0.0980 B = 0.1020 Δ = -0.0040x = 1.04 A = 0.1020 B = 0.0920 Δ = 0.0100x = 1.05 A = 0.0800 B = 0.0740 Δ = 0.0060x = 1.06 A = 0.0740 B = 0.0840 Δ = -0.0100x = 1.07 A = 0.0500 B = 0.0480 Δ = 0.0020x = 1.07 A = 0.0340 B = 0.0340 Δ = 0.0000x = 1.08 A = 0.0200 B = 0.0240 Δ = -0.0040x = 1.09 A = 0.0100 B = 0.0280 Δ = -0.0180x = 1.10 A = 0.0060 B = 0.0080 Δ = -0.0020x = 1.11 A = 0.0020 B = 0.0020 Δ = 0.0000x = 1.12 A = 0.0080 B = 0.0040 Δ = 0.0040x = 1.12 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.13 A = 0.0000 B = 0.0040 Δ = -0.0040
sigma[2]
reference stan24 bins · 0.92 … 1.16
00.060.060.110.1111.101.00 · 0.1121.03 · 0.100x = 0.92 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.93 A = 0.0040 B = 0.0100 Δ = -0.0060x = 0.94 A = 0.0140 B = 0.0160 Δ = -0.0020x = 0.95 A = 0.0220 B = 0.0300 Δ = -0.0080x = 0.96 A = 0.0320 B = 0.0380 Δ = -0.0060x = 0.97 A = 0.0380 B = 0.0540 Δ = -0.0160x = 0.98 A = 0.0700 B = 0.0700 Δ = 0.0000x = 0.99 A = 0.0960 B = 0.0700 Δ = 0.0260x = 1.00 A = 0.1120 B = 0.0960 Δ = 0.0160x = 1.01 A = 0.0920 B = 0.0920 Δ = -0.0000x = 1.02 A = 0.0920 B = 0.0840 Δ = 0.0080x = 1.03 A = 0.0960 B = 0.1000 Δ = -0.0040x = 1.05 A = 0.0800 B = 0.0800 Δ = 0.0000x = 1.06 A = 0.0680 B = 0.0600 Δ = 0.0080x = 1.07 A = 0.0600 B = 0.0620 Δ = -0.0020x = 1.08 A = 0.0420 B = 0.0420 Δ = 0.0000x = 1.09 A = 0.0360 B = 0.0380 Δ = -0.0020x = 1.10 A = 0.0160 B = 0.0220 Δ = -0.0060x = 1.11 A = 0.0020 B = 0.0120 Δ = -0.0100x = 1.12 A = 0.0100 B = 0.0080 Δ = 0.0020x = 1.13 A = 0.0060 B = 0.0040 Δ = 0.0020x = 1.14 A = 0.0060 B = 0.0020 Δ = 0.0040x = 1.15 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.16 A = 0.0020 B = 0.0040 Δ = -0.0020
theta
reference stan24 bins · 0.57 … 0.66
00.060.060.120.120.600.650.62 · 0.1100.62 · 0.118x = 0.57 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.58 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.58 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.59 A = 0.0080 B = 0.0040 Δ = 0.0040x = 0.59 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.59 A = 0.0220 B = 0.0320 Δ = -0.0100x = 0.60 A = 0.0420 B = 0.0340 Δ = 0.0080x = 0.60 A = 0.0280 B = 0.0260 Δ = 0.0020x = 0.60 A = 0.0660 B = 0.0520 Δ = 0.0140x = 0.61 A = 0.0720 B = 0.0740 Δ = -0.0020x = 0.61 A = 0.1020 B = 0.0800 Δ = 0.0220x = 0.62 A = 0.1000 B = 0.0940 Δ = 0.0060x = 0.62 A = 0.1100 B = 0.1180 Δ = -0.0080x = 0.62 A = 0.0920 B = 0.1100 Δ = -0.0180x = 0.63 A = 0.0760 B = 0.0760 Δ = 0.0000x = 0.63 A = 0.0540 B = 0.0540 Δ = 0.0000x = 0.64 A = 0.0640 B = 0.0860 Δ = -0.0220x = 0.64 A = 0.0480 B = 0.0500 Δ = -0.0020x = 0.64 A = 0.0420 B = 0.0420 Δ = 0.0000x = 0.65 A = 0.0260 B = 0.0280 Δ = -0.0020x = 0.65 A = 0.0120 B = 0.0160 Δ = -0.0040x = 0.66 A = 0.0180 B = 0.0080 Δ = 0.0100x = 0.66 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.66 A = 0.0040 B = 0.0000 Δ = 0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0015 ≤ tol 0.0069 · floors 0.0008/0.0034
posteriordb-lsat_data / lsat_model
answer record(alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], theta[1], theta[2], theta[3], theta[4], theta[5], theta[6], theta[7], theta[8], theta[9], theta[10], theta[11], theta[12], theta[13], theta[14], theta[15], theta[16], theta[17], theta[18], theta[19], theta[20], theta[21], theta[22], theta[23], theta[24], theta[25], theta[26], theta[27], theta[28], theta[29], theta[30], theta[31], theta[32], theta[33], theta[34], theta[35], theta[36], theta[37], theta[38], theta[39], theta[40], theta[41], theta[42], theta[43], theta[44], theta[45], theta[46], theta[47], theta[48], theta[49], theta[50], theta[51], theta[52], theta[53], theta[54], theta[55], theta[56], theta[57], theta[58], theta[59], theta[60], theta[61], theta[62], theta[63], theta[64], theta[65], theta[66], theta[67], theta[68], theta[69], theta[70], theta[71], theta[72], theta[73], theta[74], theta[75], theta[76], theta[77], theta[78], theta[79], theta[80], theta[81], theta[82], theta[83], theta[84], theta[85], theta[86], theta[87], theta[88], theta[89], theta[90], theta[91], theta[92], theta[93], theta[94], theta[95], theta[96], theta[97], theta[98], theta[99], theta[100], theta[101], theta[102], theta[103], theta[104], theta[105], theta[106], theta[107], theta[108], theta[109], theta[110], theta[111], theta[112], theta[113], theta[114], theta[115], theta[116], theta[117], theta[118], theta[119], theta[120], theta[121], theta[122], theta[123], theta[124], theta[125], theta[126], theta[127], theta[128], theta[129], theta[130], theta[131], theta[132], theta[133], theta[134], theta[135], theta[136], theta[137], theta[138], theta[139], theta[140], theta[141], theta[142], theta[143], theta[144], theta[145], theta[146], theta[147], theta[148], theta[149], theta[150], theta[151], theta[152], theta[153], theta[154], theta[155], theta[156], theta[157], theta[158], theta[159], theta[160], theta[161], theta[162], theta[163], theta[164], theta[165], theta[166], theta[167], theta[168], theta[169], theta[170], theta[171], theta[172], theta[173], theta[174], theta[175], theta[176], theta[177], theta[178], theta[179], theta[180], theta[181], theta[182], theta[183], theta[184], theta[185], theta[186], theta[187], theta[188], theta[189], theta[190], theta[191], theta[192], theta[193], theta[194], theta[195], theta[196], theta[197], theta[198], theta[199], theta[200], theta[201], theta[202], theta[203], theta[204], theta[205], theta[206], theta[207], theta[208], theta[209], theta[210], theta[211], theta[212], theta[213], theta[214], theta[215], theta[216], theta[217], theta[218], theta[219], theta[220], theta[221], theta[222], theta[223], theta[224], theta[225], theta[226], theta[227], theta[228], theta[229], theta[230], theta[231], theta[232], theta[233], theta[234], theta[235], theta[236], theta[237], theta[238], theta[239], theta[240], theta[241], theta[242], theta[243], theta[244], theta[245], theta[246], theta[247], theta[248], theta[249], theta[250], theta[251], theta[252], theta[253], theta[254], theta[255], theta[256], theta[257], theta[258], theta[259], theta[260], theta[261], theta[262], theta[263], theta[264], theta[265], theta[266], theta[267], theta[268], theta[269], theta[270], theta[271], theta[272], theta[273], theta[274], theta[275], theta[276], theta[277], theta[278], theta[279], theta[280], theta[281], theta[282], theta[283], theta[284], theta[285], theta[286], theta[287], theta[288], theta[289], theta[290], theta[291], theta[292], theta[293], theta[294], theta[295], theta[296], theta[297], theta[298], theta[299], theta[300], theta[301], theta[302], theta[303], theta[304], theta[305], theta[306], theta[307], theta[308], theta[309], theta[310], theta[311], theta[312], theta[313], theta[314], theta[315], theta[316], theta[317], theta[318], theta[319], theta[320], theta[321], theta[322], theta[323], theta[324], theta[325], theta[326], theta[327], theta[328], theta[329], theta[330], theta[331], theta[332], theta[333], theta[334], theta[335], theta[336], theta[337], theta[338], theta[339], theta[340], theta[341], theta[342], theta[343], theta[344], theta[345], theta[346], theta[347], theta[348], theta[349], theta[350], theta[351], theta[352], theta[353], theta[354], theta[355], theta[356], theta[357], theta[358], theta[359], theta[360], theta[361], theta[362], theta[363], theta[364], theta[365], theta[366], theta[367], theta[368], theta[369], theta[370], theta[371], theta[372], theta[373], theta[374], theta[375], theta[376], theta[377], theta[378], theta[379], theta[380], theta[381], theta[382], theta[383], theta[384], theta[385], theta[386], theta[387], theta[388], theta[389], theta[390], theta[391], theta[392], theta[393], theta[394], theta[395], theta[396], theta[397], theta[398], theta[399], theta[400], theta[401], theta[402], theta[403], theta[404], theta[405], theta[406], theta[407], theta[408], theta[409], theta[410], theta[411], theta[412], theta[413], theta[414], theta[415], theta[416], theta[417], theta[418], theta[419], theta[420], theta[421], theta[422], theta[423], theta[424], theta[425], theta[426], theta[427], theta[428], theta[429], theta[430], theta[431], theta[432], theta[433], theta[434], theta[435], theta[436], theta[437], theta[438], theta[439], theta[440], theta[441], theta[442], theta[443], theta[444], theta[445], theta[446], theta[447], theta[448], theta[449], theta[450], theta[451], theta[452], theta[453], theta[454], theta[455], theta[456], theta[457], theta[458], theta[459], theta[460], theta[461], theta[462], theta[463], theta[464], theta[465], theta[466], theta[467], theta[468], theta[469], theta[470], theta[471], theta[472], theta[473], theta[474], theta[475], theta[476], theta[477], theta[478], theta[479], theta[480], theta[481], theta[482], theta[483], theta[484], theta[485], theta[486], theta[487], theta[488], theta[489], theta[490], theta[491], theta[492], theta[493], theta[494], theta[495], theta[496], theta[497], theta[498], theta[499], theta[500], theta[501], theta[502], theta[503], theta[504], theta[505], theta[506], theta[507], theta[508], theta[509], theta[510], theta[511], theta[512], theta[513], theta[514], theta[515], theta[516], theta[517], theta[518], theta[519], theta[520], theta[521], theta[522], theta[523], theta[524], theta[525], theta[526], theta[527], theta[528], theta[529], theta[530], theta[531], theta[532], theta[533], theta[534], theta[535], theta[536], theta[537], theta[538], theta[539], theta[540], theta[541], theta[542], theta[543], theta[544], theta[545], theta[546], theta[547], theta[548], theta[549], theta[550], theta[551], theta[552], theta[553], theta[554], theta[555], theta[556], theta[557], theta[558], theta[559], theta[560], theta[561], theta[562], theta[563], theta[564], theta[565], theta[566], theta[567], theta[568], theta[569], theta[570], theta[571], theta[572], theta[573], theta[574], theta[575], theta[576], theta[577], theta[578], theta[579], theta[580], theta[581], theta[582], theta[583], theta[584], theta[585], theta[586], theta[587], theta[588], theta[589], theta[590], theta[591], theta[592], theta[593], theta[594], theta[595], theta[596], theta[597], theta[598], theta[599], theta[600], theta[601], theta[602], theta[603], theta[604], theta[605], theta[606], theta[607], theta[608], theta[609], theta[610], theta[611], theta[612], theta[613], theta[614], theta[615], theta[616], theta[617], theta[618], theta[619], theta[620], theta[621], theta[622], theta[623], theta[624], theta[625], theta[626], theta[627], theta[628], theta[629], theta[630], theta[631], theta[632], theta[633], theta[634], theta[635], theta[636], theta[637], theta[638], theta[639], theta[640], theta[641], theta[642], theta[643], theta[644], theta[645], theta[646], theta[647], theta[648], theta[649], theta[650], theta[651], theta[652], theta[653], theta[654], theta[655], theta[656], theta[657], theta[658], theta[659], theta[660], theta[661], theta[662], theta[663], theta[664], theta[665], theta[666], theta[667], theta[668], theta[669], theta[670], theta[671], theta[672], theta[673], theta[674], theta[675], theta[676], theta[677], theta[678], theta[679], theta[680], theta[681], theta[682], theta[683], theta[684], theta[685], theta[686], theta[687], theta[688], theta[689], theta[690], theta[691], theta[692], theta[693], theta[694], theta[695], theta[696], theta[697], theta[698], theta[699], theta[700], theta[701], theta[702], theta[703], theta[704], theta[705], theta[706], theta[707], theta[708], theta[709], theta[710], theta[711], theta[712], theta[713], theta[714], theta[715], theta[716], theta[717], theta[718], theta[719], theta[720], theta[721], theta[722], theta[723], theta[724], theta[725], theta[726], theta[727], theta[728], theta[729], theta[730], theta[731], theta[732], theta[733], theta[734], theta[735], theta[736], theta[737], theta[738], theta[739], theta[740], theta[741], theta[742], theta[743], theta[744], theta[745], theta[746], theta[747], theta[748], theta[749], theta[750], theta[751], theta[752], theta[753], theta[754], theta[755], theta[756], theta[757], theta[758], theta[759], theta[760], theta[761], theta[762], theta[763], theta[764], theta[765], theta[766], theta[767], theta[768], theta[769], theta[770], theta[771], theta[772], theta[773], theta[774], theta[775], theta[776], theta[777], theta[778], theta[779], theta[780], theta[781], theta[782], theta[783], theta[784], theta[785], theta[786], theta[787], theta[788], theta[789], theta[790], theta[791], theta[792], theta[793], theta[794], theta[795], theta[796], theta[797], theta[798], theta[799], theta[800], theta[801], theta[802], theta[803], theta[804], theta[805], theta[806], theta[807], theta[808], theta[809], theta[810], theta[811], theta[812], theta[813], theta[814], theta[815], theta[816], theta[817], theta[818], theta[819], theta[820], theta[821], theta[822], theta[823], theta[824], theta[825], theta[826], theta[827], theta[828], theta[829], theta[830], theta[831], theta[832], theta[833], theta[834], theta[835], theta[836], theta[837], theta[838], theta[839], theta[840], theta[841], theta[842], theta[843], theta[844], theta[845], theta[846], theta[847], theta[848], theta[849], theta[850], theta[851], theta[852], theta[853], theta[854], theta[855], theta[856], theta[857], theta[858], theta[859], theta[860], theta[861], theta[862], theta[863], theta[864], theta[865], theta[866], theta[867], theta[868], theta[869], theta[870], theta[871], theta[872], theta[873], theta[874], theta[875], theta[876], theta[877], theta[878], theta[879], theta[880], theta[881], theta[882], theta[883], theta[884], theta[885], theta[886], theta[887], theta[888], theta[889], theta[890], theta[891], theta[892], theta[893], theta[894], theta[895], theta[896], theta[897], theta[898], theta[899], theta[900], theta[901], theta[902], theta[903], theta[904], theta[905], theta[906], theta[907], theta[908], theta[909], theta[910], theta[911], theta[912], theta[913], theta[914], theta[915], theta[916], theta[917], theta[918], theta[919], theta[920], theta[921], theta[922], theta[923], theta[924], theta[925], theta[926], theta[927], theta[928], theta[929], theta[930], theta[931], theta[932], theta[933], theta[934], theta[935], theta[936], theta[937], theta[938], theta[939], theta[940], theta[941], theta[942], theta[943], theta[944], theta[945], theta[946], theta[947], theta[948], theta[949], theta[950], theta[951], theta[952], theta[953], theta[954], theta[955], theta[956], theta[957], theta[958], theta[959], theta[960], theta[961], theta[962], theta[963], theta[964], theta[965], theta[966], theta[967], theta[968], theta[969], theta[970], theta[971], theta[972], theta[973], theta[974], theta[975], theta[976], theta[977], theta[978], theta[979], theta[980], theta[981], theta[982], theta[983], theta[984], theta[985], theta[986], theta[987], theta[988], theta[989], theta[990], theta[991], theta[992], theta[993], theta[994], theta[995], theta[996], theta[997], theta[998], theta[999], theta[1000], beta, mean_alpha, a[1], a[2], a[3], a[4], a[5]) stan pass 0.0688
00 statement source: posteriordb/lsat_data-lsat_model
given

Responses from N = 1000 students to T = 5 LSAT questions are provided. The data are encoded as R = 32 response patterns (all possible binary vectors of length 5), each with a cumulative count indicating how many of the 1000 students exhibit that pattern; the full individual response matrix is reconstructed from these pattern counts. Each question k (k = 1..5) has a difficulty parameter alpha_k with a Normal(mean 0, sd 100) prior. Each student j (j = 1..1000) has an ability parameter theta_j with a Normal(mean 0, sd 1) prior. The common discrimination parameter beta has a Normal(mean 0, sd 100) prior.

model

Each student j has a latent ability theta_j. Each question k has a difficulty alpha_k. The probability that student j answers question k correctly is inv_logit(beta * theta_j - alpha_k). The observed binary response for student j on question k is Bernoulli with that probability, independently across students and questions.

query

The marginal posterior distribution of each parameter given the data: the five question difficulty parameters alpha_1, ..., alpha_5, the 1000 student ability parameters theta_1, ..., theta_1000, the common discrimination parameter beta, the posterior mean difficulty mean_alpha (= mean of alpha_1..alpha_5), and the five mean-centered difficulty parameters a_1, ..., a_5 (where a_k = alpha_k - mean_alpha).

answer spec record(alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], theta[1], theta[2], theta[3], theta[4], theta[5], theta[6], theta[7], theta[8], theta[9], theta[10], theta[11], theta[12], theta[13], theta[14], theta[15], theta[16], theta[17], theta[18], theta[19], theta[20], theta[21], theta[22], theta[23], theta[24], theta[25], theta[26], theta[27], theta[28], theta[29], theta[30], theta[31], theta[32], theta[33], theta[34], theta[35], theta[36], theta[37], theta[38], theta[39], theta[40], theta[41], theta[42], theta[43], theta[44], theta[45], theta[46], theta[47], theta[48], theta[49], theta[50], theta[51], theta[52], theta[53], theta[54], theta[55], theta[56], theta[57], theta[58], theta[59], theta[60], theta[61], theta[62], theta[63], theta[64], theta[65], theta[66], theta[67], theta[68], theta[69], theta[70], theta[71], theta[72], theta[73], theta[74], theta[75], theta[76], theta[77], theta[78], theta[79], theta[80], theta[81], theta[82], theta[83], theta[84], theta[85], theta[86], theta[87], theta[88], theta[89], theta[90], theta[91], theta[92], theta[93], theta[94], theta[95], theta[96], theta[97], theta[98], theta[99], theta[100], theta[101], theta[102], theta[103], theta[104], theta[105], theta[106], theta[107], theta[108], theta[109], theta[110], theta[111], theta[112], theta[113], theta[114], theta[115], theta[116], theta[117], theta[118], theta[119], theta[120], theta[121], theta[122], theta[123], theta[124], theta[125], theta[126], theta[127], theta[128], theta[129], theta[130], theta[131], theta[132], theta[133], theta[134], theta[135], theta[136], theta[137], theta[138], theta[139], theta[140], theta[141], theta[142], theta[143], theta[144], theta[145], theta[146], theta[147], theta[148], theta[149], theta[150], theta[151], theta[152], theta[153], theta[154], theta[155], theta[156], theta[157], theta[158], theta[159], theta[160], theta[161], theta[162], theta[163], theta[164], theta[165], theta[166], theta[167], theta[168], theta[169], theta[170], theta[171], theta[172], theta[173], theta[174], theta[175], theta[176], theta[177], theta[178], theta[179], theta[180], theta[181], theta[182], theta[183], theta[184], theta[185], theta[186], theta[187], theta[188], theta[189], theta[190], theta[191], theta[192], theta[193], theta[194], theta[195], theta[196], theta[197], theta[198], theta[199], theta[200], theta[201], theta[202], theta[203], theta[204], theta[205], theta[206], theta[207], theta[208], theta[209], theta[210], theta[211], theta[212], theta[213], theta[214], theta[215], theta[216], theta[217], theta[218], theta[219], theta[220], theta[221], theta[222], theta[223], theta[224], theta[225], theta[226], theta[227], theta[228], theta[229], theta[230], theta[231], theta[232], theta[233], theta[234], theta[235], theta[236], theta[237], theta[238], theta[239], theta[240], theta[241], theta[242], theta[243], theta[244], theta[245], theta[246], theta[247], theta[248], theta[249], theta[250], theta[251], theta[252], theta[253], theta[254], theta[255], theta[256], theta[257], theta[258], theta[259], theta[260], theta[261], theta[262], theta[263], theta[264], theta[265], theta[266], theta[267], theta[268], theta[269], theta[270], theta[271], theta[272], theta[273], theta[274], theta[275], theta[276], theta[277], theta[278], theta[279], theta[280], theta[281], theta[282], theta[283], theta[284], theta[285], theta[286], theta[287], theta[288], theta[289], theta[290], theta[291], theta[292], theta[293], theta[294], theta[295], theta[296], theta[297], theta[298], theta[299], theta[300], theta[301], theta[302], theta[303], theta[304], theta[305], theta[306], theta[307], theta[308], theta[309], theta[310], theta[311], theta[312], theta[313], theta[314], theta[315], theta[316], theta[317], theta[318], theta[319], theta[320], theta[321], theta[322], theta[323], theta[324], theta[325], theta[326], theta[327], theta[328], theta[329], theta[330], theta[331], theta[332], theta[333], theta[334], theta[335], theta[336], theta[337], theta[338], theta[339], theta[340], theta[341], theta[342], theta[343], theta[344], theta[345], theta[346], theta[347], theta[348], theta[349], theta[350], theta[351], theta[352], theta[353], theta[354], theta[355], theta[356], theta[357], theta[358], theta[359], theta[360], theta[361], theta[362], theta[363], theta[364], theta[365], theta[366], theta[367], theta[368], theta[369], theta[370], theta[371], theta[372], theta[373], theta[374], theta[375], theta[376], theta[377], theta[378], theta[379], theta[380], theta[381], theta[382], theta[383], theta[384], theta[385], theta[386], theta[387], theta[388], theta[389], theta[390], theta[391], theta[392], theta[393], theta[394], theta[395], theta[396], theta[397], theta[398], theta[399], theta[400], theta[401], theta[402], theta[403], theta[404], theta[405], theta[406], theta[407], theta[408], theta[409], theta[410], theta[411], theta[412], theta[413], theta[414], theta[415], theta[416], theta[417], theta[418], theta[419], theta[420], theta[421], theta[422], theta[423], theta[424], theta[425], theta[426], theta[427], theta[428], theta[429], theta[430], theta[431], theta[432], theta[433], theta[434], theta[435], theta[436], theta[437], theta[438], theta[439], theta[440], theta[441], theta[442], theta[443], theta[444], theta[445], theta[446], theta[447], theta[448], theta[449], theta[450], theta[451], theta[452], theta[453], theta[454], theta[455], theta[456], theta[457], theta[458], theta[459], theta[460], theta[461], theta[462], theta[463], theta[464], theta[465], theta[466], theta[467], theta[468], theta[469], theta[470], theta[471], theta[472], theta[473], theta[474], theta[475], theta[476], theta[477], theta[478], theta[479], theta[480], theta[481], theta[482], theta[483], theta[484], theta[485], theta[486], theta[487], theta[488], theta[489], theta[490], theta[491], theta[492], theta[493], theta[494], theta[495], theta[496], theta[497], theta[498], theta[499], theta[500], theta[501], theta[502], theta[503], theta[504], theta[505], theta[506], theta[507], theta[508], theta[509], theta[510], theta[511], theta[512], theta[513], theta[514], theta[515], theta[516], theta[517], theta[518], theta[519], theta[520], theta[521], theta[522], theta[523], theta[524], theta[525], theta[526], theta[527], theta[528], theta[529], theta[530], theta[531], theta[532], theta[533], theta[534], theta[535], theta[536], theta[537], theta[538], theta[539], theta[540], theta[541], theta[542], theta[543], theta[544], theta[545], theta[546], theta[547], theta[548], theta[549], theta[550], theta[551], theta[552], theta[553], theta[554], theta[555], theta[556], theta[557], theta[558], theta[559], theta[560], theta[561], theta[562], theta[563], theta[564], theta[565], theta[566], theta[567], theta[568], theta[569], theta[570], theta[571], theta[572], theta[573], theta[574], theta[575], theta[576], theta[577], theta[578], theta[579], theta[580], theta[581], theta[582], theta[583], theta[584], theta[585], theta[586], theta[587], theta[588], theta[589], theta[590], theta[591], theta[592], theta[593], theta[594], theta[595], theta[596], theta[597], theta[598], theta[599], theta[600], theta[601], theta[602], theta[603], theta[604], theta[605], theta[606], theta[607], theta[608], theta[609], theta[610], theta[611], theta[612], theta[613], theta[614], theta[615], theta[616], theta[617], theta[618], theta[619], theta[620], theta[621], theta[622], theta[623], theta[624], theta[625], theta[626], theta[627], theta[628], theta[629], theta[630], theta[631], theta[632], theta[633], theta[634], theta[635], theta[636], theta[637], theta[638], theta[639], theta[640], theta[641], theta[642], theta[643], theta[644], theta[645], theta[646], theta[647], theta[648], theta[649], theta[650], theta[651], theta[652], theta[653], theta[654], theta[655], theta[656], theta[657], theta[658], theta[659], theta[660], theta[661], theta[662], theta[663], theta[664], theta[665], theta[666], theta[667], theta[668], theta[669], theta[670], theta[671], theta[672], theta[673], theta[674], theta[675], theta[676], theta[677], theta[678], theta[679], theta[680], theta[681], theta[682], theta[683], theta[684], theta[685], theta[686], theta[687], theta[688], theta[689], theta[690], theta[691], theta[692], theta[693], theta[694], theta[695], theta[696], theta[697], theta[698], theta[699], theta[700], theta[701], theta[702], theta[703], theta[704], theta[705], theta[706], theta[707], theta[708], theta[709], theta[710], theta[711], theta[712], theta[713], theta[714], theta[715], theta[716], theta[717], theta[718], theta[719], theta[720], theta[721], theta[722], theta[723], theta[724], theta[725], theta[726], theta[727], theta[728], theta[729], theta[730], theta[731], theta[732], theta[733], theta[734], theta[735], theta[736], theta[737], theta[738], theta[739], theta[740], theta[741], theta[742], theta[743], theta[744], theta[745], theta[746], theta[747], theta[748], theta[749], theta[750], theta[751], theta[752], theta[753], theta[754], theta[755], theta[756], theta[757], theta[758], theta[759], theta[760], theta[761], theta[762], theta[763], theta[764], theta[765], theta[766], theta[767], theta[768], theta[769], theta[770], theta[771], theta[772], theta[773], theta[774], theta[775], theta[776], theta[777], theta[778], theta[779], theta[780], theta[781], theta[782], theta[783], theta[784], theta[785], theta[786], theta[787], theta[788], theta[789], theta[790], theta[791], theta[792], theta[793], theta[794], theta[795], theta[796], theta[797], theta[798], theta[799], theta[800], theta[801], theta[802], theta[803], theta[804], theta[805], theta[806], theta[807], theta[808], theta[809], theta[810], theta[811], theta[812], theta[813], theta[814], theta[815], theta[816], theta[817], theta[818], theta[819], theta[820], theta[821], theta[822], theta[823], theta[824], theta[825], theta[826], theta[827], theta[828], theta[829], theta[830], theta[831], theta[832], theta[833], theta[834], theta[835], theta[836], theta[837], theta[838], theta[839], theta[840], theta[841], theta[842], theta[843], theta[844], theta[845], theta[846], theta[847], theta[848], theta[849], theta[850], theta[851], theta[852], theta[853], theta[854], theta[855], theta[856], theta[857], theta[858], theta[859], theta[860], theta[861], theta[862], theta[863], theta[864], theta[865], theta[866], theta[867], theta[868], theta[869], theta[870], theta[871], theta[872], theta[873], theta[874], theta[875], theta[876], theta[877], theta[878], theta[879], theta[880], theta[881], theta[882], theta[883], theta[884], theta[885], theta[886], theta[887], theta[888], theta[889], theta[890], theta[891], theta[892], theta[893], theta[894], theta[895], theta[896], theta[897], theta[898], theta[899], theta[900], theta[901], theta[902], theta[903], theta[904], theta[905], theta[906], theta[907], theta[908], theta[909], theta[910], theta[911], theta[912], theta[913], theta[914], theta[915], theta[916], theta[917], theta[918], theta[919], theta[920], theta[921], theta[922], theta[923], theta[924], theta[925], theta[926], theta[927], theta[928], theta[929], theta[930], theta[931], theta[932], theta[933], theta[934], theta[935], theta[936], theta[937], theta[938], theta[939], theta[940], theta[941], theta[942], theta[943], theta[944], theta[945], theta[946], theta[947], theta[948], theta[949], theta[950], theta[951], theta[952], theta[953], theta[954], theta[955], theta[956], theta[957], theta[958], theta[959], theta[960], theta[961], theta[962], theta[963], theta[964], theta[965], theta[966], theta[967], theta[968], theta[969], theta[970], theta[971], theta[972], theta[973], theta[974], theta[975], theta[976], theta[977], theta[978], theta[979], theta[980], theta[981], theta[982], theta[983], theta[984], theta[985], theta[986], theta[987], theta[988], theta[989], theta[990], theta[991], theta[992], theta[993], theta[994], theta[995], theta[996], theta[997], theta[998], theta[999], theta[1000], beta, mean_alpha, a[1], a[2], a[3], a[4], a[5])
{
  "kind": "record",
  "fields": {
    "alpha[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[40]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[41]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[42]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[43]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[44]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[45]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[46]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[47]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[48]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[49]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[50]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[51]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[52]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[53]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[54]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[55]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[56]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[57]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[58]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[59]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[60]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[61]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[62]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[63]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[64]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[65]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[66]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[67]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[68]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[69]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[70]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[71]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[72]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[73]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[74]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[75]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[76]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[77]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[78]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[79]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[80]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[81]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[82]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[83]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[84]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[85]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[86]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[87]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[88]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[89]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[90]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[91]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[92]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[93]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[94]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[95]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[96]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[97]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[98]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[99]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[100]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[101]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[102]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[103]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[104]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[105]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[106]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[107]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[108]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[109]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[110]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[111]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[112]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[113]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[114]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[115]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[116]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[117]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[118]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[119]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[120]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[121]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[122]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[123]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[124]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[125]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[126]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[127]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[128]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[129]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[130]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[131]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[132]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[133]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[134]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[135]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[136]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[137]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[138]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[139]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[140]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[141]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[142]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[143]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[144]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[145]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[146]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[147]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[148]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[149]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[150]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[151]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[152]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[153]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[154]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[155]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[156]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[157]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[158]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[159]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[160]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[161]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[162]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[163]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[164]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[165]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[166]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[167]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[168]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[169]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[170]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[171]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[172]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[173]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[174]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[175]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[176]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[177]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[178]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[179]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[180]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[181]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[182]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[183]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[184]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[185]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[186]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[187]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[188]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[189]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[190]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[191]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[192]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[193]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[194]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[195]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[196]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[197]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[198]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[199]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[200]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[201]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[202]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[203]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[204]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[205]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[206]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[207]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[208]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[209]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[210]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[211]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[212]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[213]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[214]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[215]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[216]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[217]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[218]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[219]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[220]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[221]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[222]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[223]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[224]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[225]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[226]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[227]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[228]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[229]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[230]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[231]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[232]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[233]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[234]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[235]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[236]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[237]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[238]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[239]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[240]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[241]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[242]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[243]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[244]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[245]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[246]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[247]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[248]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[249]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[250]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[251]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[252]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[253]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[254]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[255]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[256]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[257]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[258]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[259]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[260]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[261]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[262]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[263]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[264]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[265]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[266]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[267]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[268]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[269]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[270]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[271]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[272]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[273]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[274]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[275]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[276]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[277]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[278]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[279]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[280]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[281]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[282]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[283]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[284]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[285]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[286]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[287]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[288]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[289]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[290]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[291]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[292]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[293]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[294]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[295]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[296]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[297]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[298]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[299]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[300]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[301]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[302]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[303]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[304]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[305]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[306]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[307]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[308]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[309]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[310]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[311]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[312]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[313]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[314]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[315]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[316]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[317]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[318]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[319]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[320]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[321]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[322]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[323]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[324]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[325]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[326]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[327]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[328]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[329]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[330]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[331]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[332]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[333]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[334]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[335]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[336]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[337]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[338]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[339]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[340]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[341]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[342]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[343]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[344]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[345]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[346]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[347]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[348]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[349]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[350]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[351]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[352]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[353]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[354]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[355]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[356]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[357]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[358]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[359]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[360]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[361]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[362]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[363]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[364]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[365]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[366]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[367]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[368]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[369]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[370]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[371]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[372]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[373]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[374]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[375]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[376]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[377]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[378]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[379]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[380]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[381]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[382]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[383]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[384]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[385]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[386]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[387]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[388]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[389]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[390]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[391]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[392]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[393]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[394]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[395]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[396]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[397]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[398]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[399]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[400]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[401]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[402]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[403]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[404]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[405]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[406]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[407]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[408]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[409]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[410]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[411]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[412]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[413]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[414]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[415]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[416]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[417]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[418]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[419]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[420]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[421]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[422]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[423]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[424]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[425]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[426]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[427]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[428]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[429]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[430]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[431]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[432]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[433]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[434]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[435]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[436]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[437]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[438]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[439]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[440]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[441]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[442]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[443]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[444]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[445]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[446]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[447]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[448]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[449]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[450]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[451]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[452]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[453]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[454]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[455]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[456]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[457]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[458]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[459]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[460]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[461]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[462]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[463]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[464]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[465]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[466]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[467]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[468]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[469]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[470]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[471]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[472]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[473]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[474]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[475]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[476]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[477]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[478]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[479]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[480]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[481]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[482]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[483]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[484]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[485]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[486]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[487]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[488]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[489]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[490]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[491]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[492]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[493]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[494]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[495]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[496]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[497]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[498]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[499]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[500]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[501]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[502]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[503]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[504]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[505]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[506]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[507]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[508]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[509]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[510]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[511]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[512]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[513]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[514]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[515]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[516]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[517]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[518]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[519]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[520]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[521]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[522]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[523]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[524]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[525]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[526]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[527]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[528]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[529]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[530]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[531]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[532]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[533]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[534]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[535]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[536]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[537]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[538]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[539]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[540]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[541]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[542]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[543]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[544]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[545]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[546]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[547]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[548]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[549]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[550]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[551]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[552]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[553]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[554]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[555]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[556]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[557]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[558]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[559]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[560]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[561]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[562]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[563]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[564]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[565]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[566]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[567]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[568]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[569]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[570]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[571]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[572]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[573]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[574]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[575]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[576]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[577]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[578]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[579]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[580]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[581]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[582]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[583]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[584]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[585]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[586]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[587]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[588]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[589]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[590]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[591]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[592]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[593]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[594]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[595]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[596]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[597]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[598]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[599]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[600]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[601]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[602]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[603]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[604]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[605]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[606]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[607]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[608]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[609]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[610]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[611]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[612]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[613]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[614]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[615]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[616]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[617]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[618]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[619]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[620]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[621]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[622]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[623]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[624]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[625]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[626]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[627]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[628]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[629]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[630]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[631]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[632]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[633]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[634]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[635]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[636]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[637]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[638]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[639]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[640]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[641]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[642]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[643]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[644]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[645]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[646]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[647]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[648]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[649]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[650]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[651]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[652]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[653]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[654]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[655]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[656]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[657]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[658]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[659]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[660]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[661]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[662]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[663]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[664]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[665]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[666]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[667]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[668]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[669]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[670]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[671]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[672]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[673]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[674]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[675]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[676]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[677]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[678]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[679]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[680]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[681]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[682]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[683]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[684]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[685]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[686]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[687]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[688]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[689]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[690]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[691]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[692]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[693]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[694]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[695]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[696]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[697]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[698]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[699]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[700]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[701]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[702]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[703]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[704]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[705]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[706]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[707]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[708]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[709]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[710]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[711]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[712]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[713]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[714]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[715]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[716]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[717]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[718]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[719]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[720]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[721]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[722]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[723]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[724]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[725]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[726]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[727]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[728]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[729]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[730]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[731]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[732]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[733]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[734]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[735]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[736]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[737]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[738]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[739]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[740]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[741]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[742]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[743]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[744]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[745]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[746]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[747]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[748]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[749]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[750]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[751]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[752]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[753]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[754]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[755]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[756]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[757]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[758]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[759]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[760]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[761]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[762]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[763]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[764]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[765]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[766]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[767]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[768]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[769]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[770]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[771]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[772]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[773]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[774]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[775]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[776]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[777]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[778]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[779]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[780]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[781]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[782]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[783]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[784]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[785]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[786]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[787]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[788]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[789]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[790]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[791]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[792]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[793]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[794]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[795]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[796]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[797]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[798]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[799]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[800]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[801]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[802]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[803]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[804]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[805]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[806]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[807]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[808]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[809]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[810]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[811]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[812]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[813]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[814]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[815]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[816]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[817]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[818]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[819]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[820]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[821]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[822]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[823]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[824]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[825]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[826]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[827]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[828]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[829]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[830]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[831]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[832]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[833]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[834]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[835]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[836]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[837]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[838]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[839]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[840]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[841]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[842]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[843]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[844]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[845]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[846]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[847]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[848]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[849]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[850]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[851]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[852]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[853]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[854]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[855]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[856]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[857]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[858]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[859]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[860]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[861]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[862]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[863]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[864]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[865]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[866]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[867]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[868]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[869]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[870]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[871]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[872]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[873]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[874]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[875]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[876]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[877]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[878]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[879]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[880]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[881]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[882]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[883]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[884]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[885]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[886]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[887]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[888]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[889]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[890]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[891]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[892]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[893]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[894]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[895]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[896]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[897]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[898]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[899]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[900]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[901]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[902]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[903]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[904]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[905]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[906]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[907]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[908]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[909]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[910]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[911]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[912]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[913]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[914]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[915]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[916]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[917]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[918]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[919]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[920]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[921]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[922]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[923]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[924]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[925]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[926]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[927]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[928]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[929]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[930]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[931]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[932]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[933]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[934]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[935]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[936]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[937]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[938]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[939]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[940]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[941]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[942]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[943]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[944]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[945]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[946]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[947]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[948]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[949]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[950]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[951]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[952]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[953]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[954]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[955]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[956]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[957]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[958]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[959]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[960]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[961]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[962]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[963]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[964]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[965]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[966]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[967]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[968]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[969]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[970]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[971]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[972]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[973]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[974]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[975]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[976]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[977]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[978]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[979]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[980]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[981]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[982]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[983]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[984]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[985]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[986]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[987]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[988]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[989]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[990]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[991]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[992]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[993]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[994]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[995]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[996]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[997]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[998]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[999]": {
      "kind": "dist",
      "domain": "real"
    },
    "theta[1000]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta": {
      "kind": "dist",
      "domain": "real"
    },
    "mean_alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "a[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "a[5]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.069
stan
1data {
2 int<lower=0> N; // 1000, number of students
3 int<lower=0> R; // 32, number of patterns of results: 2^T
4 int<lower=0> T; // 5, number of questions
5 array[R] int<lower=0> culm;
6 array[R, T] int<lower=0> response;
7}
8transformed data {
9 array[T, N] int r;
10 vector[N] ones;
11
12 for (j in 1 : culm[1]) {
13 for (k in 1 : T) {
14 r[k, j] = response[1, k];
15 }
16 }
17 for (i in 2 : R) {
18 for (j in (culm[i - 1] + 1) : culm[i]) {
19 for (k in 1 : T) {
20 r[k, j] = response[i, k];
21 }
22 }
23 }
24 for (i in 1 : N) {
25 ones[i] = 1.0;
26 }
27}
28parameters {
29 array[T] real alpha;
30 vector[N] theta;
31 real<lower=0> beta;
32}
33model {
34 alpha ~ normal(0, 100.);
35 theta ~ normal(0, 1);
36 beta ~ normal(0.0, 100.);
37 for (k in 1 : T) {
38 r[k] ~ bernoulli_logit(beta * theta - alpha[k] * ones);
39 }
40}
41generated quantities {
42 real mean_alpha;
43 array[T] real a;
44 mean_alpha = mean(alpha);
45 for (t in 1 : T) {
46 a[t] = alpha[t] - mean_alpha;
47 }
48}
49
50//@ DATA { response: [32×5 matrix], culm: [32 values], N: 1000, R: 32, T: 5 } // values supplied at runtime
51//@ PARAMS ["alpha[1]","alpha[2]","alpha[3]","alpha[4]","alpha[5]","theta[1]","theta[2]","theta[3]","theta[4]","theta[5]","theta[6]","theta[7]","theta[8]","theta[9]","theta[10]","theta[11]","theta[12]","theta[13]","theta[14]","theta[15]","theta[16]","theta[17]","theta[18]","theta[19]","theta[20]","theta[21]","theta[22]","theta[23]","theta[24]","theta[25]","theta[26]","theta[27]","theta[28]","theta[29]","theta[30]","theta[31]","theta[32]","theta[33]","theta[34]","theta[35]","theta[36]","theta[37]","theta[38]","theta[39]","theta[40]","theta[41]","theta[42]","theta[43]","theta[44]","theta[45]","theta[46]","theta[47]","theta[48]","theta[49]","theta[50]","theta[51]","theta[52]","theta[53]","theta[54]","theta[55]","theta[56]","theta[57]","theta[58]","theta[59]","theta[60]","theta[61]","theta[62]","theta[63]","theta[64]","theta[65]","theta[66]","theta[67]","theta[68]","theta[69]","theta[70]","theta[71]","theta[72]","theta[73]","theta[74]","theta[75]","theta[76]","theta[77]","theta[78]","theta[79]","theta[80]","theta[81]","theta[82]","theta[83]","theta[84]","theta[85]","theta[86]","theta[87]","theta[88]","theta[89]","theta[90]","theta[91]","theta[92]","theta[93]","theta[94]","theta[95]","theta[96]","theta[97]","theta[98]","theta[99]","theta[100]","theta[101]","theta[102]","theta[103]","theta[104]","theta[105]","theta[106]","theta[107]","theta[108]","theta[109]","theta[110]","theta[111]","theta[112]","theta[113]","theta[114]","theta[115]","theta[116]","theta[117]","theta[118]","theta[119]","theta[120]","theta[121]","theta[122]","theta[123]","theta[124]","theta[125]","theta[126]","theta[127]","theta[128]","theta[129]","theta[130]","theta[131]","theta[132]","theta[133]","theta[134]","theta[135]","theta[136]","theta[137]","theta[138]","theta[139]","theta[140]","theta[141]","theta[142]","theta[143]","theta[144]","theta[145]","theta[146]","theta[147]","theta[148]","theta[149]","theta[150]","theta[151]","theta[152]","theta[153]","theta[154]","theta[155]","theta[156]","theta[157]","theta[158]","theta[159]","theta[160]","theta[161]","theta[162]","theta[163]","theta[164]","theta[165]","theta[166]","theta[167]","theta[168]","theta[169]","theta[170]","theta[171]","theta[172]","theta[173]","theta[174]","theta[175]","theta[176]","theta[177]","theta[178]","theta[179]","theta[180]","theta[181]","theta[182]","theta[183]","theta[184]","theta[185]","theta[186]","theta[187]","theta[188]","theta[189]","theta[190]","theta[191]","theta[192]","theta[193]","theta[194]","theta[195]","theta[196]","theta[197]","theta[198]","theta[199]","theta[200]","theta[201]","theta[202]","theta[203]","theta[204]","theta[205]","theta[206]","theta[207]","theta[208]","theta[209]","theta[210]","theta[211]","theta[212]","theta[213]","theta[214]","theta[215]","theta[216]","theta[217]","theta[218]","theta[219]","theta[220]","theta[221]","theta[222]","theta[223]","theta[224]","theta[225]","theta[226]","theta[227]","theta[228]","theta[229]","theta[230]","theta[231]","theta[232]","theta[233]","theta[234]","theta[235]","theta[236]","theta[237]","theta[238]","theta[239]","theta[240]","theta[241]","theta[242]","theta[243]","theta[244]","theta[245]","theta[246]","theta[247]","theta[248]","theta[249]","theta[250]","theta[251]","theta[252]","theta[253]","theta[254]","theta[255]","theta[256]","theta[257]","theta[258]","theta[259]","theta[260]","theta[261]","theta[262]","theta[263]","theta[264]","theta[265]","theta[266]","theta[267]","theta[268]","theta[269]","theta[270]","theta[271]","theta[272]","theta[273]","theta[274]","theta[275]","theta[276]","theta[277]","theta[278]","theta[279]","theta[280]","theta[281]","theta[282]","theta[283]","theta[284]","theta[285]","theta[286]","theta[287]","theta[288]","theta[289]","theta[290]","theta[291]","theta[292]","theta[293]","theta[294]","theta[295]","theta[296]","theta[297]","theta[298]","theta[299]","theta[300]","theta[301]","theta[302]","theta[303]","theta[304]","theta[305]","theta[306]","theta[307]","theta[308]","theta[309]","theta[310]","theta[311]","theta[312]","theta[313]","theta[314]","theta[315]","theta[316]","theta[317]","theta[318]","theta[319]","theta[320]","theta[321]","theta[322]","theta[323]","theta[324]","theta[325]","theta[326]","theta[327]","theta[328]","theta[329]","theta[330]","theta[331]","theta[332]","theta[333]","theta[334]","theta[335]","theta[336]","theta[337]","theta[338]","theta[339]","theta[340]","theta[341]","theta[342]","theta[343]","theta[344]","theta[345]","theta[346]","theta[347]","theta[348]","theta[349]","theta[350]","theta[351]","theta[352]","theta[353]","theta[354]","theta[355]","theta[356]","theta[357]","theta[358]","theta[359]","theta[360]","theta[361]","theta[362]","theta[363]","theta[364]","theta[365]","theta[366]","theta[367]","theta[368]","theta[369]","theta[370]","theta[371]","theta[372]","theta[373]","theta[374]","theta[375]","theta[376]","theta[377]","theta[378]","theta[379]","theta[380]","theta[381]","theta[382]","theta[383]","theta[384]","theta[385]","theta[386]","theta[387]","theta[388]","theta[389]","theta[390]","theta[391]","theta[392]","theta[393]","theta[394]","theta[395]","theta[396]","theta[397]","theta[398]","theta[399]","theta[400]","theta[401]","theta[402]","theta[403]","theta[404]","theta[405]","theta[406]","theta[407]","theta[408]","theta[409]","theta[410]","theta[411]","theta[412]","theta[413]","theta[414]","theta[415]","theta[416]","theta[417]","theta[418]","theta[419]","theta[420]","theta[421]","theta[422]","theta[423]","theta[424]","theta[425]","theta[426]","theta[427]","theta[428]","theta[429]","theta[430]","theta[431]","theta[432]","theta[433]","theta[434]","theta[435]","theta[436]","theta[437]","theta[438]","theta[439]","theta[440]","theta[441]","theta[442]","theta[443]","theta[444]","theta[445]","theta[446]","theta[447]","theta[448]","theta[449]","theta[450]","theta[451]","theta[452]","theta[453]","theta[454]","theta[455]","theta[456]","theta[457]","theta[458]","theta[459]","theta[460]","theta[461]","theta[462]","theta[463]","theta[464]","theta[465]","theta[466]","theta[467]","theta[468]","theta[469]","theta[470]","theta[471]","theta[472]","theta[473]","theta[474]","theta[475]","theta[476]","theta[477]","theta[478]","theta[479]","theta[480]","theta[481]","theta[482]","theta[483]","theta[484]","theta[485]","theta[486]","theta[487]","theta[488]","theta[489]","theta[490]","theta[491]","theta[492]","theta[493]","theta[494]","theta[495]","theta[496]","theta[497]","theta[498]","theta[499]","theta[500]","theta[501]","theta[502]","theta[503]","theta[504]","theta[505]","theta[506]","theta[507]","theta[508]","theta[509]","theta[510]","theta[511]","theta[512]","theta[513]","theta[514]","theta[515]","theta[516]","theta[517]","theta[518]","theta[519]","theta[520]","theta[521]","theta[522]","theta[523]","theta[524]","theta[525]","theta[526]","theta[527]","theta[528]","theta[529]","theta[530]","theta[531]","theta[532]","theta[533]","theta[534]","theta[535]","theta[536]","theta[537]","theta[538]","theta[539]","theta[540]","theta[541]","theta[542]","theta[543]","theta[544]","theta[545]","theta[546]","theta[547]","theta[548]","theta[549]","theta[550]","theta[551]","theta[552]","theta[553]","theta[554]","theta[555]","theta[556]","theta[557]","theta[558]","theta[559]","theta[560]","theta[561]","theta[562]","theta[563]","theta[564]","theta[565]","theta[566]","theta[567]","theta[568]","theta[569]","theta[570]","theta[571]","theta[572]","theta[573]","theta[574]","theta[575]","theta[576]","theta[577]","theta[578]","theta[579]","theta[580]","theta[581]","theta[582]","theta[583]","theta[584]","theta[585]","theta[586]","theta[587]","theta[588]","theta[589]","theta[590]","theta[591]","theta[592]","theta[593]","theta[594]","theta[595]","theta[596]","theta[597]","theta[598]","theta[599]","theta[600]","theta[601]","theta[602]","theta[603]","theta[604]","theta[605]","theta[606]","theta[607]","theta[608]","theta[609]","theta[610]","theta[611]","theta[612]","theta[613]","theta[614]","theta[615]","theta[616]","theta[617]","theta[618]","theta[619]","theta[620]","theta[621]","theta[622]","theta[623]","theta[624]","theta[625]","theta[626]","theta[627]","theta[628]","theta[629]","theta[630]","theta[631]","theta[632]","theta[633]","theta[634]","theta[635]","theta[636]","theta[637]","theta[638]","theta[639]","theta[640]","theta[641]","theta[642]","theta[643]","theta[644]","theta[645]","theta[646]","theta[647]","theta[648]","theta[649]","theta[650]","theta[651]","theta[652]","theta[653]","theta[654]","theta[655]","theta[656]","theta[657]","theta[658]","theta[659]","theta[660]","theta[661]","theta[662]","theta[663]","theta[664]","theta[665]","theta[666]","theta[667]","theta[668]","theta[669]","theta[670]","theta[671]","theta[672]","theta[673]","theta[674]","theta[675]","theta[676]","theta[677]","theta[678]","theta[679]","theta[680]","theta[681]","theta[682]","theta[683]","theta[684]","theta[685]","theta[686]","theta[687]","theta[688]","theta[689]","theta[690]","theta[691]","theta[692]","theta[693]","theta[694]","theta[695]","theta[696]","theta[697]","theta[698]","theta[699]","theta[700]","theta[701]","theta[702]","theta[703]","theta[704]","theta[705]","theta[706]","theta[707]","theta[708]","theta[709]","theta[710]","theta[711]","theta[712]","theta[713]","theta[714]","theta[715]","theta[716]","theta[717]","theta[718]","theta[719]","theta[720]","theta[721]","theta[722]","theta[723]","theta[724]","theta[725]","theta[726]","theta[727]","theta[728]","theta[729]","theta[730]","theta[731]","theta[732]","theta[733]","theta[734]","theta[735]","theta[736]","theta[737]","theta[738]","theta[739]","theta[740]","theta[741]","theta[742]","theta[743]","theta[744]","theta[745]","theta[746]","theta[747]","theta[748]","theta[749]","theta[750]","theta[751]","theta[752]","theta[753]","theta[754]","theta[755]","theta[756]","theta[757]","theta[758]","theta[759]","theta[760]","theta[761]","theta[762]","theta[763]","theta[764]","theta[765]","theta[766]","theta[767]","theta[768]","theta[769]","theta[770]","theta[771]","theta[772]","theta[773]","theta[774]","theta[775]","theta[776]","theta[777]","theta[778]","theta[779]","theta[780]","theta[781]","theta[782]","theta[783]","theta[784]","theta[785]","theta[786]","theta[787]","theta[788]","theta[789]","theta[790]","theta[791]","theta[792]","theta[793]","theta[794]","theta[795]","theta[796]","theta[797]","theta[798]","theta[799]","theta[800]","theta[801]","theta[802]","theta[803]","theta[804]","theta[805]","theta[806]","theta[807]","theta[808]","theta[809]","theta[810]","theta[811]","theta[812]","theta[813]","theta[814]","theta[815]","theta[816]","theta[817]","theta[818]","theta[819]","theta[820]","theta[821]","theta[822]","theta[823]","theta[824]","theta[825]","theta[826]","theta[827]","theta[828]","theta[829]","theta[830]","theta[831]","theta[832]","theta[833]","theta[834]","theta[835]","theta[836]","theta[837]","theta[838]","theta[839]","theta[840]","theta[841]","theta[842]","theta[843]","theta[844]","theta[845]","theta[846]","theta[847]","theta[848]","theta[849]","theta[850]","theta[851]","theta[852]","theta[853]","theta[854]","theta[855]","theta[856]","theta[857]","theta[858]","theta[859]","theta[860]","theta[861]","theta[862]","theta[863]","theta[864]","theta[865]","theta[866]","theta[867]","theta[868]","theta[869]","theta[870]","theta[871]","theta[872]","theta[873]","theta[874]","theta[875]","theta[876]","theta[877]","theta[878]","theta[879]","theta[880]","theta[881]","theta[882]","theta[883]","theta[884]","theta[885]","theta[886]","theta[887]","theta[888]","theta[889]","theta[890]","theta[891]","theta[892]","theta[893]","theta[894]","theta[895]","theta[896]","theta[897]","theta[898]","theta[899]","theta[900]","theta[901]","theta[902]","theta[903]","theta[904]","theta[905]","theta[906]","theta[907]","theta[908]","theta[909]","theta[910]","theta[911]","theta[912]","theta[913]","theta[914]","theta[915]","theta[916]","theta[917]","theta[918]","theta[919]","theta[920]","theta[921]","theta[922]","theta[923]","theta[924]","theta[925]","theta[926]","theta[927]","theta[928]","theta[929]","theta[930]","theta[931]","theta[932]","theta[933]","theta[934]","theta[935]","theta[936]","theta[937]","theta[938]","theta[939]","theta[940]","theta[941]","theta[942]","theta[943]","theta[944]","theta[945]","theta[946]","theta[947]","theta[948]","theta[949]","theta[950]","theta[951]","theta[952]","theta[953]","theta[954]","theta[955]","theta[956]","theta[957]","theta[958]","theta[959]","theta[960]","theta[961]","theta[962]","theta[963]","theta[964]","theta[965]","theta[966]","theta[967]","theta[968]","theta[969]","theta[970]","theta[971]","theta[972]","theta[973]","theta[974]","theta[975]","theta[976]","theta[977]","theta[978]","theta[979]","theta[980]","theta[981]","theta[982]","theta[983]","theta[984]","theta[985]","theta[986]","theta[987]","theta[988]","theta[989]","theta[990]","theta[991]","theta[992]","theta[993]","theta[994]","theta[995]","theta[996]","theta[997]","theta[998]","theta[999]","theta[1000]","beta","mean_alpha","a[1]","a[2]","a[3]","a[4]","a[5]"]
52//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
53
02answer overlay — reference vs stanrecord(alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], theta[1], theta[2], theta[3], theta[4], theta[5], theta[6], theta[7], theta[8], theta[9], theta[10], theta[11], theta[12], theta[13], theta[14], theta[15], theta[16], theta[17], theta[18], theta[19], theta[20], theta[21], theta[22], theta[23], theta[24], theta[25], theta[26], theta[27], theta[28], theta[29], theta[30], theta[31], theta[32], theta[33], theta[34], theta[35], theta[36], theta[37], theta[38], theta[39], theta[40], theta[41], theta[42], theta[43], theta[44], theta[45], theta[46], theta[47], theta[48], theta[49], theta[50], theta[51], theta[52], theta[53], theta[54], theta[55], theta[56], theta[57], theta[58], theta[59], theta[60], theta[61], theta[62], theta[63], theta[64], theta[65], theta[66], theta[67], theta[68], theta[69], theta[70], theta[71], theta[72], theta[73], theta[74], theta[75], theta[76], theta[77], theta[78], theta[79], theta[80], theta[81], theta[82], theta[83], theta[84], theta[85], theta[86], theta[87], theta[88], theta[89], theta[90], theta[91], theta[92], theta[93], theta[94], theta[95], theta[96], theta[97], theta[98], theta[99], theta[100], theta[101], theta[102], theta[103], theta[104], theta[105], theta[106], theta[107], theta[108], theta[109], theta[110], theta[111], theta[112], theta[113], theta[114], theta[115], theta[116], theta[117], theta[118], theta[119], theta[120], theta[121], theta[122], theta[123], theta[124], theta[125], theta[126], theta[127], theta[128], theta[129], theta[130], theta[131], theta[132], theta[133], theta[134], theta[135], theta[136], theta[137], theta[138], theta[139], theta[140], theta[141], theta[142], theta[143], theta[144], theta[145], theta[146], theta[147], theta[148], theta[149], theta[150], theta[151], theta[152], theta[153], theta[154], theta[155], theta[156], theta[157], theta[158], theta[159], theta[160], theta[161], theta[162], theta[163], theta[164], theta[165], theta[166], theta[167], theta[168], theta[169], theta[170], theta[171], theta[172], theta[173], theta[174], theta[175], theta[176], theta[177], theta[178], theta[179], theta[180], theta[181], theta[182], theta[183], theta[184], theta[185], theta[186], theta[187], theta[188], theta[189], theta[190], theta[191], theta[192], theta[193], theta[194], theta[195], theta[196], theta[197], theta[198], theta[199], theta[200], theta[201], theta[202], theta[203], theta[204], theta[205], theta[206], theta[207], theta[208], theta[209], theta[210], theta[211], theta[212], theta[213], theta[214], theta[215], theta[216], theta[217], theta[218], theta[219], theta[220], theta[221], theta[222], theta[223], theta[224], theta[225], theta[226], theta[227], theta[228], theta[229], theta[230], theta[231], theta[232], theta[233], theta[234], theta[235], theta[236], theta[237], theta[238], theta[239], theta[240], theta[241], theta[242], theta[243], theta[244], theta[245], theta[246], theta[247], theta[248], theta[249], theta[250], theta[251], theta[252], theta[253], theta[254], theta[255], theta[256], theta[257], theta[258], theta[259], theta[260], theta[261], theta[262], theta[263], theta[264], theta[265], theta[266], theta[267], theta[268], theta[269], theta[270], theta[271], theta[272], theta[273], theta[274], theta[275], theta[276], theta[277], theta[278], theta[279], theta[280], theta[281], theta[282], theta[283], theta[284], theta[285], theta[286], theta[287], theta[288], theta[289], theta[290], theta[291], theta[292], theta[293], theta[294], theta[295], theta[296], theta[297], theta[298], theta[299], theta[300], theta[301], theta[302], theta[303], theta[304], theta[305], theta[306], theta[307], theta[308], theta[309], theta[310], theta[311], theta[312], theta[313], theta[314], theta[315], theta[316], theta[317], theta[318], theta[319], theta[320], theta[321], theta[322], theta[323], theta[324], theta[325], theta[326], theta[327], theta[328], theta[329], theta[330], theta[331], theta[332], theta[333], theta[334], theta[335], theta[336], theta[337], theta[338], theta[339], theta[340], theta[341], theta[342], theta[343], theta[344], theta[345], theta[346], theta[347], theta[348], theta[349], theta[350], theta[351], theta[352], theta[353], theta[354], theta[355], theta[356], theta[357], theta[358], theta[359], theta[360], theta[361], theta[362], theta[363], theta[364], theta[365], theta[366], theta[367], theta[368], theta[369], theta[370], theta[371], theta[372], theta[373], theta[374], theta[375], theta[376], theta[377], theta[378], theta[379], theta[380], theta[381], theta[382], theta[383], theta[384], theta[385], theta[386], theta[387], theta[388], theta[389], theta[390], theta[391], theta[392], theta[393], theta[394], theta[395], theta[396], theta[397], theta[398], theta[399], theta[400], theta[401], theta[402], theta[403], theta[404], theta[405], theta[406], theta[407], theta[408], theta[409], theta[410], theta[411], theta[412], theta[413], theta[414], theta[415], theta[416], theta[417], theta[418], theta[419], theta[420], theta[421], theta[422], theta[423], theta[424], theta[425], theta[426], theta[427], theta[428], theta[429], theta[430], theta[431], theta[432], theta[433], theta[434], theta[435], theta[436], theta[437], theta[438], theta[439], theta[440], theta[441], theta[442], theta[443], theta[444], theta[445], theta[446], theta[447], theta[448], theta[449], theta[450], theta[451], theta[452], theta[453], theta[454], theta[455], theta[456], theta[457], theta[458], theta[459], theta[460], theta[461], theta[462], theta[463], theta[464], theta[465], theta[466], theta[467], theta[468], theta[469], theta[470], theta[471], theta[472], theta[473], theta[474], theta[475], theta[476], theta[477], theta[478], theta[479], theta[480], theta[481], theta[482], theta[483], theta[484], theta[485], theta[486], theta[487], theta[488], theta[489], theta[490], theta[491], theta[492], theta[493], theta[494], theta[495], theta[496], theta[497], theta[498], theta[499], theta[500], theta[501], theta[502], theta[503], theta[504], theta[505], theta[506], theta[507], theta[508], theta[509], theta[510], theta[511], theta[512], theta[513], theta[514], theta[515], theta[516], theta[517], theta[518], theta[519], theta[520], theta[521], theta[522], theta[523], theta[524], theta[525], theta[526], theta[527], theta[528], theta[529], theta[530], theta[531], theta[532], theta[533], theta[534], theta[535], theta[536], theta[537], theta[538], theta[539], theta[540], theta[541], theta[542], theta[543], theta[544], theta[545], theta[546], theta[547], theta[548], theta[549], theta[550], theta[551], theta[552], theta[553], theta[554], theta[555], theta[556], theta[557], theta[558], theta[559], theta[560], theta[561], theta[562], theta[563], theta[564], theta[565], theta[566], theta[567], theta[568], theta[569], theta[570], theta[571], theta[572], theta[573], theta[574], theta[575], theta[576], theta[577], theta[578], theta[579], theta[580], theta[581], theta[582], theta[583], theta[584], theta[585], theta[586], theta[587], theta[588], theta[589], theta[590], theta[591], theta[592], theta[593], theta[594], theta[595], theta[596], theta[597], theta[598], theta[599], theta[600], theta[601], theta[602], theta[603], theta[604], theta[605], theta[606], theta[607], theta[608], theta[609], theta[610], theta[611], theta[612], theta[613], theta[614], theta[615], theta[616], theta[617], theta[618], theta[619], theta[620], theta[621], theta[622], theta[623], theta[624], theta[625], theta[626], theta[627], theta[628], theta[629], theta[630], theta[631], theta[632], theta[633], theta[634], theta[635], theta[636], theta[637], theta[638], theta[639], theta[640], theta[641], theta[642], theta[643], theta[644], theta[645], theta[646], theta[647], theta[648], theta[649], theta[650], theta[651], theta[652], theta[653], theta[654], theta[655], theta[656], theta[657], theta[658], theta[659], theta[660], theta[661], theta[662], theta[663], theta[664], theta[665], theta[666], theta[667], theta[668], theta[669], theta[670], theta[671], theta[672], theta[673], theta[674], theta[675], theta[676], theta[677], theta[678], theta[679], theta[680], theta[681], theta[682], theta[683], theta[684], theta[685], theta[686], theta[687], theta[688], theta[689], theta[690], theta[691], theta[692], theta[693], theta[694], theta[695], theta[696], theta[697], theta[698], theta[699], theta[700], theta[701], theta[702], theta[703], theta[704], theta[705], theta[706], theta[707], theta[708], theta[709], theta[710], theta[711], theta[712], theta[713], theta[714], theta[715], theta[716], theta[717], theta[718], theta[719], theta[720], theta[721], theta[722], theta[723], theta[724], theta[725], theta[726], theta[727], theta[728], theta[729], theta[730], theta[731], theta[732], theta[733], theta[734], theta[735], theta[736], theta[737], theta[738], theta[739], theta[740], theta[741], theta[742], theta[743], theta[744], theta[745], theta[746], theta[747], theta[748], theta[749], theta[750], theta[751], theta[752], theta[753], theta[754], theta[755], theta[756], theta[757], theta[758], theta[759], theta[760], theta[761], theta[762], theta[763], theta[764], theta[765], theta[766], theta[767], theta[768], theta[769], theta[770], theta[771], theta[772], theta[773], theta[774], theta[775], theta[776], theta[777], theta[778], theta[779], theta[780], theta[781], theta[782], theta[783], theta[784], theta[785], theta[786], theta[787], theta[788], theta[789], theta[790], theta[791], theta[792], theta[793], theta[794], theta[795], theta[796], theta[797], theta[798], theta[799], theta[800], theta[801], theta[802], theta[803], theta[804], theta[805], theta[806], theta[807], theta[808], theta[809], theta[810], theta[811], theta[812], theta[813], theta[814], theta[815], theta[816], theta[817], theta[818], theta[819], theta[820], theta[821], theta[822], theta[823], theta[824], theta[825], theta[826], theta[827], theta[828], theta[829], theta[830], theta[831], theta[832], theta[833], theta[834], theta[835], theta[836], theta[837], theta[838], theta[839], theta[840], theta[841], theta[842], theta[843], theta[844], theta[845], theta[846], theta[847], theta[848], theta[849], theta[850], theta[851], theta[852], theta[853], theta[854], theta[855], theta[856], theta[857], theta[858], theta[859], theta[860], theta[861], theta[862], theta[863], theta[864], theta[865], theta[866], theta[867], theta[868], theta[869], theta[870], theta[871], theta[872], theta[873], theta[874], theta[875], theta[876], theta[877], theta[878], theta[879], theta[880], theta[881], theta[882], theta[883], theta[884], theta[885], theta[886], theta[887], theta[888], theta[889], theta[890], theta[891], theta[892], theta[893], theta[894], theta[895], theta[896], theta[897], theta[898], theta[899], theta[900], theta[901], theta[902], theta[903], theta[904], theta[905], theta[906], theta[907], theta[908], theta[909], theta[910], theta[911], theta[912], theta[913], theta[914], theta[915], theta[916], theta[917], theta[918], theta[919], theta[920], theta[921], theta[922], theta[923], theta[924], theta[925], theta[926], theta[927], theta[928], theta[929], theta[930], theta[931], theta[932], theta[933], theta[934], theta[935], theta[936], theta[937], theta[938], theta[939], theta[940], theta[941], theta[942], theta[943], theta[944], theta[945], theta[946], theta[947], theta[948], theta[949], theta[950], theta[951], theta[952], theta[953], theta[954], theta[955], theta[956], theta[957], theta[958], theta[959], theta[960], theta[961], theta[962], theta[963], theta[964], theta[965], theta[966], theta[967], theta[968], theta[969], theta[970], theta[971], theta[972], theta[973], theta[974], theta[975], theta[976], theta[977], theta[978], theta[979], theta[980], theta[981], theta[982], theta[983], theta[984], theta[985], theta[986], theta[987], theta[988], theta[989], theta[990], theta[991], theta[992], theta[993], theta[994], theta[995], theta[996], theta[997], theta[998], theta[999], theta[1000], beta, mean_alpha, a[1], a[2], a[3], a[4], a[5])
parameterreference mean±sdstan mean±sd
alpha[1]-2.74 ± 0.137
alpha[2]-1.00 ± 0.073
alpha[3]-0.239 ± 0.075
alpha[4]-1.31 ± 0.083
alpha[5]-2.10 ± 0.107
theta[1]-1.91 ± 0.761
theta[2]-1.92 ± 0.794
theta[3]-1.90 ± 0.812
theta[4]-1.44 ± 0.835
theta[5]-1.32 ± 0.771
theta[6]-1.38 ± 0.810
theta[7]-1.44 ± 0.819
theta[8]-1.36 ± 0.832
theta[9]-1.41 ± 0.780
theta[10]-1.42 ± 0.819
theta[11]-1.47 ± 0.798
theta[12]-0.881 ± 0.790
theta[13]-0.907 ± 0.804
theta[14]-0.868 ± 0.767
theta[15]-0.883 ± 0.852
theta[16]-0.898 ± 0.862
theta[17]-0.987 ± 0.837
theta[18]-0.931 ± 0.833
theta[19]-0.907 ± 0.875
theta[20]-0.989 ± 0.837
theta[21]-0.895 ± 0.791
theta[22]-0.941 ± 0.827
theta[23]-1.37 ± 0.844
theta[24]-0.955 ± 0.802
theta[25]-0.965 ± 0.822
theta[26]-0.959 ± 0.851
theta[27]-0.955 ± 0.785
theta[28]-0.446 ± 0.826
theta[29]-0.453 ± 0.806
theta[30]-0.395 ± 0.815
theta[31]-0.463 ± 0.783
theta[32]-1.39 ± 0.809
theta[33]-0.939 ± 0.792
theta[34]-0.963 ± 0.807
theta[35]-0.962 ± 0.802
theta[36]-0.898 ± 0.838
theta[37]-0.971 ± 0.797
theta[38]-0.960 ± 0.828
theta[39]-0.998 ± 0.821
theta[40]-0.894 ± 0.781
theta[41]-0.438 ± 0.788
theta[42]-0.444 ± 0.834
theta[43]-0.441 ± 0.840
theta[44]-0.411 ± 0.821
theta[45]-0.476 ± 0.844
theta[46]-0.420 ± 0.770
theta[47]-0.464 ± 0.833
theta[48]-0.446 ± 0.853
theta[49]-0.457 ± 0.789
theta[50]-0.423 ± 0.875
theta[51]-0.408 ± 0.789
theta[52]-0.499 ± 0.823
theta[53]-0.452 ± 0.792
theta[54]-0.390 ± 0.793
theta[55]-0.474 ± 0.792
theta[56]-0.397 ± 0.879
theta[57]-0.470 ± 0.827
theta[58]-0.445 ± 0.825
theta[59]-0.425 ± 0.756
theta[60]-0.482 ± 0.850
theta[61]-0.429 ± 0.786
theta[62]0.089 ± 0.887
theta[63]0.047 ± 0.862
theta[64]0.041 ± 0.864
theta[65]0.092 ± 0.830
theta[66]0.106 ± 0.856
theta[67]0.121 ± 0.806
theta[68]0.051 ± 0.830
theta[69]0.060 ± 0.824
theta[70]0.007 ± 0.863
theta[71]0.129 ± 0.856
theta[72]0.046 ± 0.821
theta[73]0.061 ± 0.847
theta[74]0.024 ± 0.833
theta[75]0.067 ± 0.825
theta[76]0.109 ± 0.851
theta[77]-1.41 ± 0.823
theta[78]-1.45 ± 0.812
theta[79]-1.38 ± 0.787
theta[80]-1.49 ± 0.793
theta[81]-1.40 ± 0.813
theta[82]-1.40 ± 0.821
theta[83]-1.38 ± 0.787
theta[84]-1.45 ± 0.755
theta[85]-1.45 ± 0.803
theta[86]-1.40 ± 0.763
theta[87]-0.895 ± 0.797
theta[88]-0.897 ± 0.811
theta[89]-1.00 ± 0.777
theta[90]-0.960 ± 0.808
theta[91]-0.926 ± 0.830
theta[92]-0.954 ± 0.818
theta[93]-0.874 ± 0.806
theta[94]-0.954 ± 0.825
theta[95]-0.989 ± 0.826
theta[96]-0.917 ± 0.793
theta[97]-0.825 ± 0.846
theta[98]-0.860 ± 0.795
theta[99]-0.966 ± 0.828
theta[100]-0.988 ± 0.818
theta[101]-0.845 ± 0.840
theta[102]-0.909 ± 0.788
theta[103]-0.918 ± 0.803
theta[104]-0.896 ± 0.802
theta[105]-0.920 ± 0.785
theta[106]-0.883 ± 0.825
theta[107]-0.938 ± 0.764
theta[108]-1.00 ± 0.812
theta[109]-0.965 ± 0.778
theta[110]-0.955 ± 0.829
theta[111]-0.928 ± 0.829
theta[112]-0.845 ± 0.845
theta[113]-0.904 ± 0.761
theta[114]-0.963 ± 0.828
theta[115]-0.945 ± 0.757
theta[116]-0.873 ± 0.818
theta[117]-0.938 ± 0.831
theta[118]-0.884 ± 0.789
theta[119]-0.810 ± 0.843
theta[120]-0.877 ± 0.851
theta[121]-0.919 ± 0.804
theta[122]-0.859 ± 0.800
theta[123]-0.971 ± 0.817
theta[124]-0.948 ± 0.794
theta[125]-0.893 ± 0.832
theta[126]-0.949 ± 0.810
theta[127]-0.900 ± 0.833
theta[128]-0.903 ± 0.786
theta[129]-0.959 ± 0.812
theta[130]-0.404 ± 0.858
theta[131]-0.448 ± 0.833
theta[132]-0.527 ± 0.805
theta[133]-0.418 ± 0.835
theta[134]-0.494 ± 0.830
theta[135]-0.401 ± 0.823
theta[136]-0.430 ± 0.841
theta[137]-0.489 ± 0.838
theta[138]-0.476 ± 0.825
theta[139]-0.460 ± 0.860
theta[140]-0.438 ± 0.812
theta[141]-0.463 ± 0.803
theta[142]-0.405 ± 0.835
theta[143]-0.464 ± 0.852
theta[144]-0.421 ± 0.864
theta[145]-0.512 ± 0.835
theta[146]-0.423 ± 0.834
theta[147]-0.449 ± 0.855
theta[148]-0.478 ± 0.778
theta[149]-0.473 ± 0.860
theta[150]-0.444 ± 0.854
theta[151]-0.463 ± 0.810
theta[152]-0.411 ± 0.852
theta[153]-0.472 ± 0.859
theta[154]-0.436 ± 0.834
theta[155]-0.448 ± 0.804
theta[156]-0.429 ± 0.866
theta[157]-0.506 ± 0.871
theta[158]-0.419 ± 0.828
theta[159]-0.490 ± 0.861
theta[160]-0.408 ± 0.793
theta[161]-0.405 ± 0.829
theta[162]-0.447 ± 0.865
theta[163]-0.454 ± 0.815
theta[164]-0.496 ± 0.860
theta[165]-0.427 ± 0.803
theta[166]-0.423 ± 0.813
theta[167]-0.452 ± 0.802
theta[168]-0.427 ± 0.835
theta[169]-0.461 ± 0.814
theta[170]-0.472 ± 0.802
theta[171]-0.416 ± 0.837
theta[172]-0.430 ± 0.831
theta[173]-0.506 ± 0.759
theta[174]-0.489 ± 0.832
theta[175]-0.433 ± 0.818
theta[176]-0.451 ± 0.794
theta[177]-0.363 ± 0.800
theta[178]-0.522 ± 0.818
theta[179]-0.435 ± 0.800
theta[180]-0.403 ± 0.816
theta[181]-0.498 ± 0.793
theta[182]-0.477 ± 0.796
theta[183]-0.406 ± 0.807
theta[184]-0.504 ± 0.748
theta[185]-0.400 ± 0.812
theta[186]-0.362 ± 0.811
theta[187]-0.471 ± 0.808
theta[188]-0.466 ± 0.896
theta[189]-0.482 ± 0.829
theta[190]-0.420 ± 0.846
theta[191]-0.448 ± 0.840
theta[192]-0.441 ± 0.867
theta[193]-0.454 ± 0.807
theta[194]-0.493 ± 0.829
theta[195]-0.474 ± 0.798
theta[196]-0.462 ± 0.868
theta[197]-0.433 ± 0.846
theta[198]-0.454 ± 0.818
theta[199]-0.371 ± 0.831
theta[200]-0.507 ± 0.847
theta[201]-0.394 ± 0.773
theta[202]-0.375 ± 0.845
theta[203]-0.420 ± 0.829
theta[204]-0.429 ± 0.816
theta[205]-0.401 ± 0.802
theta[206]-0.398 ± 0.790
theta[207]-0.411 ± 0.821
theta[208]-0.380 ± 0.849
theta[209]-0.401 ± 0.796
theta[210]-0.344 ± 0.870
theta[211]-0.848 ± 0.827
theta[212]-0.944 ± 0.823
theta[213]-0.910 ± 0.817
theta[214]-0.480 ± 0.790
theta[215]-0.479 ± 0.865
theta[216]-0.483 ± 0.823
theta[217]-0.452 ± 0.878
theta[218]-0.437 ± 0.838
theta[219]-0.417 ± 0.818
theta[220]-0.455 ± 0.785
theta[221]-0.458 ± 0.839
theta[222]-0.441 ± 0.785
theta[223]-0.371 ± 0.803
theta[224]-0.409 ± 0.873
theta[225]-0.456 ± 0.818
theta[226]-0.412 ± 0.803
theta[227]-0.412 ± 0.817
theta[228]-0.451 ± 0.844
theta[229]-0.415 ± 0.844
theta[230]-0.458 ± 0.857
theta[231]-0.471 ± 0.834
theta[232]-0.447 ± 0.854
theta[233]-0.482 ± 0.828
theta[234]-0.451 ± 0.800
theta[235]-0.458 ± 0.832
theta[236]-0.440 ± 0.840
theta[237]-0.462 ± 0.810
theta[238]-0.420 ± 0.810
theta[239]-0.440 ± 0.810
theta[240]-0.442 ± 0.808
theta[241]-0.479 ± 0.854
theta[242]-0.408 ± 0.803
theta[243]-0.422 ± 0.811
theta[244]-0.416 ± 0.825
theta[245]-0.446 ± 0.854
theta[246]-0.423 ± 0.804
theta[247]-0.453 ± 0.810
theta[248]-0.418 ± 0.829
theta[249]-0.453 ± 0.785
theta[250]-0.430 ± 0.789
theta[251]-0.464 ± 0.794
theta[252]-0.496 ± 0.831
theta[253]-0.484 ± 0.770
theta[254]-0.399 ± 0.840
theta[255]-0.446 ± 0.814
theta[256]-0.480 ± 0.805
theta[257]0.088 ± 0.805
theta[258]0.086 ± 0.832
theta[259]0.072 ± 0.862
theta[260]0.101 ± 0.852
theta[261]0.057 ± 0.866
theta[262]0.058 ± 0.873
theta[263]0.114 ± 0.833
theta[264]0.087 ± 0.867
theta[265]0.067 ± 0.842
theta[266]0.083 ± 0.873
theta[267]0.119 ± 0.810
theta[268]0.064 ± 0.799
theta[269]0.087 ± 0.849
theta[270]0.017 ± 0.810
theta[271]0.018 ± 0.885
theta[272]0.107 ± 0.836
theta[273]0.098 ± 0.794
theta[274]0.123 ± 0.874
theta[275]0.093 ± 0.825
theta[276]0.126 ± 0.859
theta[277]0.114 ± 0.846
theta[278]0.081 ± 0.833
theta[279]0.011 ± 0.837
theta[280]0.078 ± 0.856
theta[281]0.156 ± 0.843
theta[282]0.119 ± 0.829
theta[283]0.091 ± 0.854
theta[284]0.110 ± 0.816
theta[285]0.116 ± 0.902
theta[286]0.060 ± 0.838
theta[287]0.107 ± 0.837
theta[288]0.114 ± 0.861
theta[289]0.126 ± 0.800
theta[290]0.166 ± 0.815
theta[291]0.092 ± 0.884
theta[292]0.064 ± 0.837
theta[293]0.062 ± 0.847
theta[294]0.041 ± 0.829
theta[295]0.079 ± 0.873
theta[296]0.048 ± 0.839
theta[297]0.013 ± 0.807
theta[298]0.082 ± 0.810
theta[299]0.094 ± 0.862
theta[300]0.067 ± 0.822
theta[301]0.131 ± 0.824
theta[302]0.088 ± 0.792
theta[303]0.087 ± 0.829
theta[304]0.060 ± 0.869
theta[305]0.020 ± 0.923
theta[306]0.116 ± 0.810
theta[307]0.055 ± 0.777
theta[308]0.102 ± 0.897
theta[309]0.090 ± 0.848
theta[310]0.171 ± 0.872
theta[311]0.078 ± 0.825
theta[312]0.067 ± 0.819
theta[313]0.064 ± 0.848
theta[314]0.096 ± 0.866
theta[315]0.022 ± 0.866
theta[316]0.119 ± 0.840
theta[317]0.075 ± 0.820
theta[318]0.093 ± 0.818
theta[319]0.128 ± 0.868
theta[320]0.058 ± 0.870
theta[321]0.056 ± 0.885
theta[322]0.094 ± 0.863
theta[323]0.051 ± 0.900
theta[324]0.091 ± 0.831
theta[325]0.042 ± 0.854
theta[326]0.105 ± 0.838
theta[327]0.120 ± 0.861
theta[328]0.069 ± 0.821
theta[329]0.062 ± 0.830
theta[330]0.126 ± 0.895
theta[331]0.064 ± 0.828
theta[332]0.130 ± 0.842
theta[333]0.065 ± 0.844
theta[334]0.100 ± 0.851
theta[335]0.130 ± 0.804
theta[336]0.062 ± 0.902
theta[337]-0.955 ± 0.796
theta[338]-0.907 ± 0.817
theta[339]-0.922 ± 0.833
theta[340]-0.942 ± 0.846
theta[341]-0.967 ± 0.795
theta[342]-0.977 ± 0.834
theta[343]-0.917 ± 0.810
theta[344]-0.924 ± 0.831
theta[345]-0.953 ± 0.822
theta[346]-0.845 ± 0.796
theta[347]-0.981 ± 0.819
theta[348]-0.937 ± 0.777
theta[349]-0.940 ± 0.778
theta[350]-0.946 ± 0.823
theta[351]-0.920 ± 0.797
theta[352]-0.958 ± 0.766
theta[353]-0.429 ± 0.869
theta[354]-0.403 ± 0.843
theta[355]-0.440 ± 0.852
theta[356]-0.414 ± 0.795
theta[357]-0.398 ± 0.817
theta[358]-0.447 ± 0.832
theta[359]-0.434 ± 0.799
theta[360]-0.414 ± 0.858
theta[361]-0.459 ± 0.846
theta[362]-0.373 ± 0.851
theta[363]-0.435 ± 0.819
theta[364]-0.416 ± 0.817
theta[365]-0.443 ± 0.834
theta[366]-0.388 ± 0.841
theta[367]-0.457 ± 0.805
theta[368]-0.450 ± 0.835
theta[369]-0.466 ± 0.796
theta[370]-0.451 ± 0.860
theta[371]-0.449 ± 0.778
theta[372]-0.487 ± 0.794
theta[373]-0.435 ± 0.826
theta[374]-0.386 ± 0.860
theta[375]-0.412 ± 0.804
theta[376]-0.364 ± 0.816
theta[377]-0.499 ± 0.803
theta[378]-0.438 ± 0.796
theta[379]-0.405 ± 0.818
theta[380]-0.394 ± 0.825
theta[381]-0.494 ± 0.794
theta[382]-0.461 ± 0.832
theta[383]-0.381 ± 0.843
theta[384]-0.466 ± 0.769
theta[385]-0.469 ± 0.774
theta[386]-0.422 ± 0.800
theta[387]-0.457 ± 0.811
theta[388]-0.478 ± 0.832
theta[389]-0.439 ± 0.782
theta[390]-0.481 ± 0.836
theta[391]-0.430 ± 0.790
theta[392]-0.334 ± 0.807
theta[393]-0.484 ± 0.793
theta[394]-0.412 ± 0.841
theta[395]-0.413 ± 0.807
theta[396]-0.461 ± 0.828
theta[397]-0.452 ± 0.836
theta[398]-0.526 ± 0.799
theta[399]-0.490 ± 0.799
theta[400]-0.369 ± 0.853
theta[401]-0.494 ± 0.806
theta[402]-0.389 ± 0.793
theta[403]-0.478 ± 0.806
theta[404]-0.443 ± 0.807
theta[405]-0.379 ± 0.792
theta[406]-0.426 ± 0.838
theta[407]-0.385 ± 0.805
theta[408]-0.397 ± 0.788
theta[409]-0.400 ± 0.802
theta[410]-0.395 ± 0.831
theta[411]-0.396 ± 0.799
theta[412]-0.469 ± 0.852
theta[413]-0.435 ± 0.813
theta[414]-0.509 ± 0.782
theta[415]-0.495 ± 0.830
theta[416]-0.442 ± 0.858
theta[417]-0.491 ± 0.828
theta[418]-0.431 ± 0.799
theta[419]-0.400 ± 0.831
theta[420]-0.390 ± 0.792
theta[421]-0.460 ± 0.813
theta[422]-0.400 ± 0.811
theta[423]-0.460 ± 0.834
theta[424]-0.442 ± 0.840
theta[425]-0.461 ± 0.849
theta[426]-0.472 ± 0.818
theta[427]-0.447 ± 0.834
theta[428]-0.378 ± 0.800
theta[429]-0.445 ± 0.799
theta[430]0.024 ± 0.846
theta[431]0.088 ± 0.826
theta[432]0.109 ± 0.841
theta[433]0.063 ± 0.834
theta[434]0.037 ± 0.824
theta[435]0.119 ± 0.851
theta[436]0.097 ± 0.901
theta[437]0.021 ± 0.831
theta[438]0.052 ± 0.848
theta[439]0.057 ± 0.845
theta[440]0.153 ± 0.893
theta[441]0.140 ± 0.861
theta[442]0.143 ± 0.821
theta[443]0.051 ± 0.806
theta[444]0.087 ± 0.843
theta[445]0.085 ± 0.850
theta[446]0.060 ± 0.804
theta[447]0.091 ± 0.841
theta[448]0.084 ± 0.835
theta[449]0.067 ± 0.815
theta[450]0.066 ± 0.861
theta[451]0.092 ± 0.867
theta[452]0.136 ± 0.848
theta[453]0.143 ± 0.887
theta[454]0.073 ± 0.821
theta[455]0.131 ± 0.809
theta[456]0.097 ± 0.841
theta[457]0.076 ± 0.804
theta[458]0.113 ± 0.839
theta[459]-0.002 ± 0.850
theta[460]0.122 ± 0.837
theta[461]0.131 ± 0.877
theta[462]0.076 ± 0.890
theta[463]0.017 ± 0.817
theta[464]0.096 ± 0.837
theta[465]0.064 ± 0.846
theta[466]0.044 ± 0.824
theta[467]0.067 ± 0.853
theta[468]0.096 ± 0.805
theta[469]0.102 ± 0.814
theta[470]0.082 ± 0.899
theta[471]0.093 ± 0.859
theta[472]0.083 ± 0.808
theta[473]0.142 ± 0.811
theta[474]0.069 ± 0.788
theta[475]0.010 ± 0.829
theta[476]0.077 ± 0.810
theta[477]0.053 ± 0.891
theta[478]0.059 ± 0.840
theta[479]0.092 ± 0.848
theta[480]0.063 ± 0.823
theta[481]0.063 ± 0.867
theta[482]0.051 ± 0.837
theta[483]0.070 ± 0.849
theta[484]0.077 ± 0.826
theta[485]0.044 ± 0.864
theta[486]0.059 ± 0.795
theta[487]0.050 ± 0.797
theta[488]0.052 ± 0.828
theta[489]0.074 ± 0.854
theta[490]0.097 ± 0.835
theta[491]0.059 ± 0.848
theta[492]0.121 ± 0.806
theta[493]0.099 ± 0.845
theta[494]0.047 ± 0.839
theta[495]0.027 ± 0.859
theta[496]0.073 ± 0.850
theta[497]0.097 ± 0.844
theta[498]0.148 ± 0.828
theta[499]0.123 ± 0.845
theta[500]0.126 ± 0.823
theta[501]0.131 ± 0.880
theta[502]0.156 ± 0.875
theta[503]0.065 ± 0.850
theta[504]0.118 ± 0.861
theta[505]0.047 ± 0.818
theta[506]0.075 ± 0.848
theta[507]0.176 ± 0.805
theta[508]0.165 ± 0.915
theta[509]0.167 ± 0.833
theta[510]0.040 ± 0.859
theta[511]0.020 ± 0.867
theta[512]0.122 ± 0.832
theta[513]0.080 ± 0.827
theta[514]0.081 ± 0.823
theta[515]0.058 ± 0.845
theta[516]0.104 ± 0.835
theta[517]0.095 ± 0.831
theta[518]0.174 ± 0.817
theta[519]0.076 ± 0.840
theta[520]0.002 ± 0.867
theta[521]0.094 ± 0.840
theta[522]0.091 ± 0.850
theta[523]0.040 ± 0.863
theta[524]0.093 ± 0.808
theta[525]0.096 ± 0.828
theta[526]0.124 ± 0.871
theta[527]0.079 ± 0.826
theta[528]0.076 ± 0.872
theta[529]0.066 ± 0.852
theta[530]0.115 ± 0.870
theta[531]0.116 ± 0.891
theta[532]0.191 ± 0.842
theta[533]0.067 ± 0.838
theta[534]0.058 ± 0.847
theta[535]0.077 ± 0.842
theta[536]0.103 ± 0.819
theta[537]0.119 ± 0.877
theta[538]0.034 ± 0.817
theta[539]0.134 ± 0.846
theta[540]0.065 ± 0.835
theta[541]0.077 ± 0.772
theta[542]0.046 ± 0.837
theta[543]0.056 ± 0.847
theta[544]0.105 ± 0.868
theta[545]0.026 ± 0.869
theta[546]0.084 ± 0.862
theta[547]0.097 ± 0.852
theta[548]0.042 ± 0.851
theta[549]0.154 ± 0.820
theta[550]0.104 ± 0.862
theta[551]0.076 ± 0.868
theta[552]0.104 ± 0.896
theta[553]0.050 ± 0.788
theta[554]0.100 ± 0.876
theta[555]0.080 ± 0.829
theta[556]0.089 ± 0.817
theta[557]0.058 ± 0.829
theta[558]0.104 ± 0.849
theta[559]0.090 ± 0.890
theta[560]0.087 ± 0.819
theta[561]0.084 ± 0.837
theta[562]0.071 ± 0.859
theta[563]0.105 ± 0.850
theta[564]0.077 ± 0.837
theta[565]0.031 ± 0.870
theta[566]0.118 ± 0.858
theta[567]0.053 ± 0.846
theta[568]0.102 ± 0.839
theta[569]0.051 ± 0.807
theta[570]0.138 ± 0.835
theta[571]0.029 ± 0.839
theta[572]0.061 ± 0.852
theta[573]0.128 ± 0.819
theta[574]0.031 ± 0.827
theta[575]0.060 ± 0.868
theta[576]0.125 ± 0.790
theta[577]0.074 ± 0.851
theta[578]0.145 ± 0.811
theta[579]0.090 ± 0.813
theta[580]0.056 ± 0.790
theta[581]0.037 ± 0.857
theta[582]0.023 ± 0.818
theta[583]0.113 ± 0.789
theta[584]0.058 ± 0.842
theta[585]0.051 ± 0.838
theta[586]0.127 ± 0.844
theta[587]0.042 ± 0.807
theta[588]0.032 ± 0.856
theta[589]0.146 ± 0.846
theta[590]0.110 ± 0.850
theta[591]0.088 ± 0.877
theta[592]0.123 ± 0.817
theta[593]0.091 ± 0.868
theta[594]0.076 ± 0.788
theta[595]0.001 ± 0.834
theta[596]-0.009 ± 0.806
theta[597]0.139 ± 0.848
theta[598]0.047 ± 0.817
theta[599]0.027 ± 0.875
theta[600]0.147 ± 0.852
theta[601]0.044 ± 0.846
theta[602]0.105 ± 0.800
theta[603]-0.413 ± 0.834
theta[604]-0.373 ± 0.792
theta[605]-0.501 ± 0.800
theta[606]-0.483 ± 0.812
theta[607]-0.461 ± 0.827
theta[608]-0.392 ± 0.851
theta[609]-0.391 ± 0.776
theta[610]-0.510 ± 0.862
theta[611]-0.455 ± 0.838
theta[612]-0.418 ± 0.813
theta[613]-0.366 ± 0.808
theta[614]0.141 ± 0.848
theta[615]0.072 ± 0.847
theta[616]0.075 ± 0.809
theta[617]0.103 ± 0.814
theta[618]0.087 ± 0.866
theta[619]0.073 ± 0.881
theta[620]0.093 ± 0.843
theta[621]0.111 ± 0.849
theta[622]0.159 ± 0.885
theta[623]0.074 ± 0.846
theta[624]0.015 ± 0.784
theta[625]0.079 ± 0.844
theta[626]0.160 ± 0.825
theta[627]0.156 ± 0.825
theta[628]0.056 ± 0.824
theta[629]0.042 ± 0.813
theta[630]0.067 ± 0.822
theta[631]0.108 ± 0.856
theta[632]0.030 ± 0.772
theta[633]0.036 ± 0.830
theta[634]0.043 ± 0.846
theta[635]0.088 ± 0.871
theta[636]0.080 ± 0.834
theta[637]0.060 ± 0.844
theta[638]0.132 ± 0.775
theta[639]0.065 ± 0.854
theta[640]0.096 ± 0.831
theta[641]0.123 ± 0.873
theta[642]0.056 ± 0.799
theta[643]0.089 ± 0.885
theta[644]0.022 ± 0.785
theta[645]0.086 ± 0.866
theta[646]0.035 ± 0.832
theta[647]0.107 ± 0.805
theta[648]0.018 ± 0.884
theta[649]0.034 ± 0.773
theta[650]0.065 ± 0.845
theta[651]0.096 ± 0.862
theta[652]0.110 ± 0.824
theta[653]0.079 ± 0.835
theta[654]0.099 ± 0.826
theta[655]0.097 ± 0.814
theta[656]0.049 ± 0.842
theta[657]0.076 ± 0.842
theta[658]0.092 ± 0.846
theta[659]0.090 ± 0.814
theta[660]0.143 ± 0.832
theta[661]0.052 ± 0.874
theta[662]0.143 ± 0.847
theta[663]0.136 ± 0.850
theta[664]0.088 ± 0.809
theta[665]0.080 ± 0.818
theta[666]0.053 ± 0.837
theta[667]0.075 ± 0.858
theta[668]0.103 ± 0.859
theta[669]0.098 ± 0.787
theta[670]0.091 ± 0.876
theta[671]0.153 ± 0.856
theta[672]0.085 ± 0.827
theta[673]0.144 ± 0.849
theta[674]0.072 ± 0.894
theta[675]0.056 ± 0.848
theta[676]0.036 ± 0.813
theta[677]0.077 ± 0.833
theta[678]0.167 ± 0.828
theta[679]0.114 ± 0.854
theta[680]0.082 ± 0.805
theta[681]0.040 ± 0.847
theta[682]0.127 ± 0.842
theta[683]0.075 ± 0.838
theta[684]0.106 ± 0.830
theta[685]0.139 ± 0.879
theta[686]0.104 ± 0.833
theta[687]0.121 ± 0.874
theta[688]0.142 ± 0.778
theta[689]0.094 ± 0.833
theta[690]0.047 ± 0.818
theta[691]0.085 ± 0.832
theta[692]0.043 ± 0.818
theta[693]0.047 ± 0.848
theta[694]0.070 ± 0.823
theta[695]0.069 ± 0.840
theta[696]0.093 ± 0.854
theta[697]0.144 ± 0.788
theta[698]0.116 ± 0.765
theta[699]0.086 ± 0.816
theta[700]9.26e-4 ± 0.837
theta[701]0.041 ± 0.851
theta[702]0.136 ± 0.843
theta[703]0.642 ± 0.911
theta[704]0.596 ± 0.888
theta[705]0.660 ± 0.879
theta[706]0.659 ± 0.871
theta[707]0.639 ± 0.890
theta[708]0.660 ± 0.882
theta[709]0.647 ± 0.868
theta[710]0.618 ± 0.905
theta[711]0.601 ± 0.860
theta[712]0.549 ± 0.815
theta[713]0.596 ± 0.834
theta[714]0.632 ± 0.811
theta[715]0.693 ± 0.891
theta[716]0.624 ± 0.851
theta[717]0.730 ± 0.852
theta[718]0.588 ± 0.819
theta[719]0.621 ± 0.908
theta[720]0.609 ± 0.874
theta[721]0.645 ± 0.840
theta[722]0.613 ± 0.856
theta[723]0.583 ± 0.864
theta[724]0.636 ± 0.879
theta[725]0.637 ± 0.872
theta[726]0.630 ± 0.854
theta[727]0.612 ± 0.872
theta[728]0.567 ± 0.826
theta[729]0.650 ± 0.842
theta[730]0.620 ± 0.928
theta[731]0.672 ± 0.820
theta[732]0.635 ± 0.812
theta[733]0.519 ± 0.871
theta[734]0.621 ± 0.854
theta[735]0.703 ± 0.834
theta[736]0.590 ± 0.898
theta[737]0.618 ± 0.869
theta[738]0.710 ± 0.880
theta[739]0.655 ± 0.901
theta[740]0.598 ± 0.838
theta[741]0.662 ± 0.888
theta[742]0.518 ± 0.876
theta[743]0.596 ± 0.871
theta[744]0.716 ± 0.907
theta[745]0.644 ± 0.882
theta[746]0.629 ± 0.877
theta[747]0.634 ± 0.841
theta[748]0.647 ± 0.878
theta[749]0.638 ± 0.876
theta[750]0.714 ± 0.873
theta[751]0.581 ± 0.854
theta[752]0.601 ± 0.812
theta[753]0.623 ± 0.882
theta[754]0.590 ± 0.869
theta[755]0.613 ± 0.836
theta[756]0.728 ± 0.822
theta[757]0.639 ± 0.873
theta[758]0.598 ± 0.894
theta[759]0.642 ± 0.857
theta[760]0.686 ± 0.843
theta[761]0.602 ± 0.849
theta[762]0.597 ± 0.851
theta[763]0.655 ± 0.886
theta[764]0.687 ± 0.870
theta[765]0.606 ± 0.862
theta[766]0.630 ± 0.877
theta[767]0.627 ± 0.899
theta[768]0.609 ± 0.836
theta[769]0.649 ± 0.871
theta[770]0.691 ± 0.852
theta[771]0.586 ± 0.890
theta[772]0.568 ± 0.824
theta[773]0.625 ± 0.863
theta[774]0.625 ± 0.857
theta[775]0.573 ± 0.819
theta[776]0.696 ± 0.869
theta[777]0.627 ± 0.875
theta[778]0.672 ± 0.843
theta[779]0.578 ± 0.844
theta[780]0.587 ± 0.871
theta[781]0.608 ± 0.907
theta[782]0.627 ± 0.848
theta[783]0.614 ± 0.836
theta[784]0.623 ± 0.879
theta[785]0.610 ± 0.815
theta[786]0.624 ± 0.874
theta[787]0.644 ± 0.831
theta[788]0.636 ± 0.850
theta[789]0.638 ± 0.852
theta[790]0.584 ± 0.873
theta[791]0.620 ± 0.884
theta[792]0.609 ± 0.853
theta[793]0.708 ± 0.882
theta[794]0.596 ± 0.822
theta[795]0.645 ± 0.904
theta[796]0.697 ± 0.884
theta[797]0.601 ± 0.858
theta[798]0.599 ± 0.864
theta[799]0.646 ± 0.825
theta[800]0.659 ± 0.846
theta[801]0.615 ± 0.860
theta[802]0.562 ± 0.859
theta[803]0.652 ± 0.869
theta[804]0.635 ± 0.898
theta[805]0.607 ± 0.917
theta[806]0.631 ± 0.841
theta[807]0.628 ± 0.843
theta[808]0.645 ± 0.850
theta[809]0.581 ± 0.866
theta[810]0.687 ± 0.853
theta[811]0.593 ± 0.858
theta[812]0.674 ± 0.873
theta[813]0.635 ± 0.894
theta[814]0.592 ± 0.843
theta[815]0.644 ± 0.804
theta[816]0.642 ± 0.868
theta[817]0.614 ± 0.883
theta[818]0.634 ± 0.855
theta[819]0.642 ± 0.824
theta[820]0.603 ± 0.850
theta[821]0.594 ± 0.787
theta[822]0.553 ± 0.891
theta[823]0.659 ± 0.843
theta[824]0.646 ± 0.835
theta[825]0.650 ± 0.911
theta[826]0.640 ± 0.885
theta[827]0.646 ± 0.892
theta[828]0.714 ± 0.861
theta[829]0.682 ± 0.858
theta[830]0.628 ± 0.812
theta[831]0.647 ± 0.836
theta[832]0.629 ± 0.865
theta[833]0.676 ± 0.857
theta[834]0.699 ± 0.851
theta[835]0.658 ± 0.892
theta[836]0.630 ± 0.865
theta[837]0.609 ± 0.823
theta[838]0.672 ± 0.881
theta[839]0.576 ± 0.856
theta[840]0.630 ± 0.882
theta[841]0.638 ± 0.882
theta[842]0.651 ± 0.851
theta[843]0.666 ± 0.851
theta[844]0.642 ± 0.881
theta[845]0.598 ± 0.865
theta[846]0.565 ± 0.865
theta[847]0.609 ± 0.861
theta[848]0.686 ± 0.889
theta[849]0.655 ± 0.864
theta[850]0.639 ± 0.823
theta[851]0.613 ± 0.885
theta[852]0.638 ± 0.868
theta[853]0.622 ± 0.885
theta[854]0.604 ± 0.815
theta[855]0.546 ± 0.881
theta[856]0.607 ± 0.888
theta[857]0.635 ± 0.918
theta[858]0.630 ± 0.904
theta[859]0.616 ± 0.903
theta[860]0.633 ± 0.840
theta[861]0.599 ± 0.845
theta[862]0.610 ± 0.841
theta[863]0.612 ± 0.857
theta[864]0.680 ± 0.890
theta[865]0.630 ± 0.897
theta[866]0.650 ± 0.857
theta[867]0.637 ± 0.876
theta[868]0.582 ± 0.851
theta[869]0.602 ± 0.882
theta[870]0.604 ± 0.894
theta[871]0.677 ± 0.828
theta[872]0.631 ± 0.849
theta[873]0.701 ± 0.886
theta[874]0.591 ± 0.919
theta[875]0.667 ± 0.849
theta[876]0.604 ± 0.832
theta[877]0.675 ± 0.809
theta[878]0.585 ± 0.862
theta[879]0.606 ± 0.881
theta[880]0.634 ± 0.857
theta[881]0.630 ± 0.843
theta[882]0.609 ± 0.840
theta[883]0.613 ± 0.851
theta[884]0.562 ± 0.828
theta[885]0.673 ± 0.872
theta[886]0.582 ± 0.800
theta[887]0.606 ± 0.869
theta[888]0.726 ± 0.859
theta[889]0.642 ± 0.872
theta[890]0.624 ± 0.880
theta[891]0.607 ± 0.870
theta[892]0.632 ± 0.903
theta[893]0.619 ± 0.895
theta[894]0.645 ± 0.888
theta[895]0.656 ± 0.906
theta[896]0.674 ± 0.866
theta[897]0.616 ± 0.885
theta[898]0.640 ± 0.830
theta[899]0.612 ± 0.872
theta[900]0.572 ± 0.835
theta[901]0.611 ± 0.909
theta[902]0.578 ± 0.864
theta[903]0.565 ± 0.877
theta[904]0.597 ± 0.861
theta[905]0.597 ± 0.851
theta[906]0.644 ± 0.893
theta[907]0.596 ± 0.846
theta[908]0.624 ± 0.885
theta[909]0.634 ± 0.886
theta[910]0.607 ± 0.848
theta[911]0.642 ± 0.893
theta[912]0.654 ± 0.815
theta[913]0.648 ± 0.854
theta[914]0.725 ± 0.832
theta[915]0.649 ± 0.870
theta[916]0.727 ± 0.865
theta[917]0.551 ± 0.900
theta[918]0.649 ± 0.867
theta[919]0.588 ± 0.861
theta[920]0.660 ± 0.869
theta[921]0.575 ± 0.875
theta[922]0.635 ± 0.865
theta[923]0.599 ± 0.864
theta[924]0.593 ± 0.876
theta[925]0.617 ± 0.834
theta[926]0.668 ± 0.906
theta[927]0.636 ± 0.848
theta[928]0.622 ± 0.839
theta[929]0.643 ± 0.882
theta[930]0.702 ± 0.898
theta[931]0.641 ± 0.876
theta[932]0.706 ± 0.879
theta[933]0.670 ± 0.858
theta[934]0.653 ± 0.888
theta[935]0.632 ± 0.884
theta[936]0.637 ± 0.819
theta[937]0.676 ± 0.860
theta[938]0.607 ± 0.781
theta[939]0.631 ± 0.926
theta[940]0.693 ± 0.864
theta[941]0.566 ± 0.858
theta[942]0.628 ± 0.822
theta[943]0.617 ± 0.893
theta[944]0.633 ± 0.823
theta[945]0.593 ± 0.873
theta[946]0.604 ± 0.862
theta[947]0.686 ± 0.883
theta[948]0.616 ± 0.874
theta[949]0.631 ± 0.850
theta[950]0.561 ± 0.876
theta[951]0.532 ± 0.872
theta[952]0.602 ± 0.828
theta[953]0.660 ± 0.867
theta[954]0.597 ± 0.843
theta[955]0.636 ± 0.867
theta[956]0.612 ± 0.845
theta[957]0.584 ± 0.882
theta[958]0.649 ± 0.910
theta[959]0.642 ± 0.832
theta[960]0.627 ± 0.795
theta[961]0.628 ± 0.831
theta[962]0.571 ± 0.870
theta[963]0.672 ± 0.861
theta[964]0.622 ± 0.807
theta[965]0.659 ± 0.834
theta[966]0.598 ± 0.870
theta[967]0.648 ± 0.866
theta[968]0.641 ± 0.859
theta[969]0.600 ± 0.838
theta[970]0.629 ± 0.905
theta[971]0.622 ± 0.901
theta[972]0.688 ± 0.903
theta[973]0.639 ± 0.892
theta[974]0.650 ± 0.851
theta[975]0.663 ± 0.883
theta[976]0.680 ± 0.881
theta[977]0.568 ± 0.861
theta[978]0.646 ± 0.826
theta[979]0.657 ± 0.845
theta[980]0.618 ± 0.918
theta[981]0.665 ± 0.896
theta[982]0.595 ± 0.853
theta[983]0.596 ± 0.881
theta[984]0.616 ± 0.845
theta[985]0.602 ± 0.849
theta[986]0.662 ± 0.902
theta[987]0.651 ± 0.837
theta[988]0.637 ± 0.828
theta[989]0.544 ± 0.898
theta[990]0.631 ± 0.863
theta[991]0.704 ± 0.821
theta[992]0.681 ± 0.837
theta[993]0.608 ± 0.902
theta[994]0.605 ± 0.828
theta[995]0.681 ± 0.867
theta[996]0.572 ± 0.835
theta[997]0.654 ± 0.875
theta[998]0.631 ± 0.845
theta[999]0.624 ± 0.875
theta[1000]0.614 ± 0.834
beta0.759 ± 0.072
mean_alpha-1.48 ± 0.054
a[1]-1.26 ± 0.110
a[2]0.475 ± 0.067
a[3]1.24 ± 0.071
a[4]0.170 ± 0.071
a[5]-0.622 ± 0.083
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0688 ≤ tol 0.2659 · floors 0.0779/0.1023
posteriordb-mcycle_gp / accel_gp
answer record(Intercept, sdgp_1, lscale_1, zgp_1[1], zgp_1[2], zgp_1[3], zgp_1[4], zgp_1[5], zgp_1[6], zgp_1[7], zgp_1[8], zgp_1[9], zgp_1[10], zgp_1[11], zgp_1[12], zgp_1[13], zgp_1[14], zgp_1[15], zgp_1[16], zgp_1[17], zgp_1[18], zgp_1[19], zgp_1[20], zgp_1[21], zgp_1[22], zgp_1[23], zgp_1[24], zgp_1[25], zgp_1[26], zgp_1[27], zgp_1[28], zgp_1[29], zgp_1[30], zgp_1[31], zgp_1[32], zgp_1[33], zgp_1[34], zgp_1[35], zgp_1[36], zgp_1[37], zgp_1[38], zgp_1[39], zgp_1[40], Intercept_sigma, sdgp_sigma_1, lscale_sigma_1, zgp_sigma_1[1], zgp_sigma_1[2], zgp_sigma_1[3], zgp_sigma_1[4], zgp_sigma_1[5], zgp_sigma_1[6], zgp_sigma_1[7], zgp_sigma_1[8], zgp_sigma_1[9], zgp_sigma_1[10], zgp_sigma_1[11], zgp_sigma_1[12], zgp_sigma_1[13], zgp_sigma_1[14], zgp_sigma_1[15], zgp_sigma_1[16], zgp_sigma_1[17], zgp_sigma_1[18], zgp_sigma_1[19], zgp_sigma_1[20]) stan pass 0.6570
00 statement source: posteriordb/mcycle_gp-accel_gp
given

For N = 133 observations, the data provide acceleration measurements Y[1], ..., Y[N] at corresponding time locations. The model employs two latent Gaussian processes: one for the mean of acceleration and one for the log-standard deviation. Each GP is approximated via spectral methods using Laplacian eigenfunctions, with 40 basis functions for the mean GP and 20 basis functions for the variance GP. For each GP, the data supply the basis matrix and the corresponding eigenvalue information required for the spectral approximation. Priors: The intercept for the mean has a Student-t prior with degrees of freedom 3, location -13, and scale 36. The mean GP's marginal standard deviation (sdgp_1), constrained positive, has a Student-t(degrees of freedom 3, location 0, scale 36) prior truncated to the positive reals. The mean GP's length-scale (lscale_1), constrained positive, has an inverse-gamma(shape 1.124909, rate 0.0177) prior. The latent coefficients for the mean GP (zgp_1[1] through zgp_1[40]) each have a standard normal(0, 1) prior. The intercept for the log-variance has a Student-t prior with degrees of freedom 3, location 0, and scale 10. The variance GP's marginal standard deviation (sdgp_sigma_1), constrained positive, has a Student-t(degrees of freedom 3, location 0, scale 36) prior truncated to the positive reals. The variance GP's length-scale (lscale_sigma_1), constrained positive, has an inverse-gamma(shape 1.124909, rate 0.0177) prior. The latent coefficients for the variance GP (zgp_sigma_1[1] through zgp_sigma_1[20]) each have a standard normal(0, 1) prior.

model

Each observed acceleration Y[n] is generated from a normal distribution whose mean is the sum of an intercept and a latent smooth function derived from a Gaussian process with an exponential-quadratic covariance kernel, and whose standard deviation is the exponential of a second latent function (an intercept plus another Gaussian process). The two Gaussian processes share the same parametric structure, each defined by a marginal standard deviation parameter, a length-scale parameter controlling smoothness, and a vector of latent coefficients that combine learned basis functions (Laplacian eigenfunctions at the observation time locations) to produce smooth, flexible mean and variance functions.

query

The marginal posterior distributions of all 62 parameters: Intercept (the mean intercept), sdgp_1 (the mean GP marginal standard deviation), lscale_1 (the mean GP length-scale), zgp_1[1] through zgp_1[40] (the 40 latent coefficients for the mean GP), Intercept_sigma (the log-variance intercept), sdgp_sigma_1 (the variance GP marginal standard deviation), lscale_sigma_1 (the variance GP length-scale), and zgp_sigma_1[1] through zgp_sigma_1[20] (the 20 latent coefficients for the variance GP).

answer spec record(Intercept, sdgp_1, lscale_1, zgp_1[1], zgp_1[2], zgp_1[3], zgp_1[4], zgp_1[5], zgp_1[6], zgp_1[7], zgp_1[8], zgp_1[9], zgp_1[10], zgp_1[11], zgp_1[12], zgp_1[13], zgp_1[14], zgp_1[15], zgp_1[16], zgp_1[17], zgp_1[18], zgp_1[19], zgp_1[20], zgp_1[21], zgp_1[22], zgp_1[23], zgp_1[24], zgp_1[25], zgp_1[26], zgp_1[27], zgp_1[28], zgp_1[29], zgp_1[30], zgp_1[31], zgp_1[32], zgp_1[33], zgp_1[34], zgp_1[35], zgp_1[36], zgp_1[37], zgp_1[38], zgp_1[39], zgp_1[40], Intercept_sigma, sdgp_sigma_1, lscale_sigma_1, zgp_sigma_1[1], zgp_sigma_1[2], zgp_sigma_1[3], zgp_sigma_1[4], zgp_sigma_1[5], zgp_sigma_1[6], zgp_sigma_1[7], zgp_sigma_1[8], zgp_sigma_1[9], zgp_sigma_1[10], zgp_sigma_1[11], zgp_sigma_1[12], zgp_sigma_1[13], zgp_sigma_1[14], zgp_sigma_1[15], zgp_sigma_1[16], zgp_sigma_1[17], zgp_sigma_1[18], zgp_sigma_1[19], zgp_sigma_1[20])
{
  "kind": "record",
  "fields": {
    "Intercept": {
      "kind": "dist",
      "domain": "real"
    },
    "sdgp_1": {
      "kind": "dist",
      "domain": "real"
    },
    "lscale_1": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_1[40]": {
      "kind": "dist",
      "domain": "real"
    },
    "Intercept_sigma": {
      "kind": "dist",
      "domain": "real"
    },
    "sdgp_sigma_1": {
      "kind": "dist",
      "domain": "real"
    },
    "lscale_sigma_1": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "zgp_sigma_1[20]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.657
stan
1// generated with brms 2.10.0
2functions {
3 /* compute a latent Gaussian process
4 * Args:
5 * x: array of continuous predictor values
6 * sdgp: marginal SD parameter
7 * lscale: length-scale parameter
8 * zgp: vector of independent standard normal variables
9 * Returns:
10 * a vector to be added to the linear predictor
11 */
12 vector gp(array[] vector x, real sdgp, vector lscale, vector zgp) {
13 int Dls = rows(lscale);
14 int N = size(x);
15 matrix[N, N] cov;
16 if (Dls == 1) {
17 // one dimensional or isotropic GP
18 cov = gp_exp_quad_cov(x, sdgp, lscale[1]);
19 } else {
20 // multi-dimensional non-isotropic GP
21 cov = gp_exp_quad_cov(x[ : , 1], sdgp, lscale[1]);
22 for (d in 2 : Dls) {
23 cov = cov .* gp_exp_quad_cov(x[ : , d], 1, lscale[d]);
24 }
25 }
26 for (n in 1 : N) {
27 // deal with numerical non-positive-definiteness
28 cov[n, n] += 1e-12;
29 }
30 return cholesky_decompose(cov) * zgp;
31 }
32
33 /* Spectral density function of a Gaussian process
34 * Args:
35 * x: array of numeric values of dimension NB x D
36 * sdgp: marginal SD parameter
37 * lscale: vector of length-scale parameters
38 * Returns:
39 * numeric values of the function evaluated at 'x'
40 */
41 vector spd_cov_exp_quad(array[] vector x, real sdgp, vector lscale) {
42 int NB = dims(x)[1];
43 int D = dims(x)[2];
44 int Dls = rows(lscale);
45 vector[NB] out;
46 if (Dls == 1) {
47 // one dimensional or isotropic GP
48 real constant = square(sdgp) * (sqrt(2 * pi()) * lscale[1]) ^ D;
49 real neg_half_lscale2 = -0.5 * square(lscale[1]);
50 for (m in 1 : NB) {
51 out[m] = constant * exp(neg_half_lscale2 * dot_self(x[m]));
52 }
53 } else {
54 // multi-dimensional non-isotropic GP
55 real constant = square(sdgp) * sqrt(2 * pi()) ^ D * prod(lscale);
56 vector[Dls] neg_half_lscale2 = -0.5 * square(lscale);
57 for (m in 1 : NB) {
58 out[m] = constant * exp(dot_product(neg_half_lscale2, square(x[m])));
59 }
60 }
61 return out;
62 }
63 /* compute an approximate latent Gaussian process
64 * Args:
65 * X: Matrix of Laplacian eigen functions at the covariate values
66 * sdgp: marginal SD parameter
67 * lscale: vector of length-scale parameters
68 * zgp: vector of independent standard normal variables
69 * slambda: square root of the Laplacian eigen values
70 * Returns:
71 * a vector to be added to the linear predictor
72 */
73 vector gpa(matrix X, real sdgp, vector lscale, vector zgp,
74 array[] vector slambda) {
75 vector[cols(X)] diag_spd = sqrt(spd_cov_exp_quad(slambda, sdgp, lscale));
76 return X * (diag_spd .* zgp);
77 }
78}
79data {
80 int<lower=1> N; // number of observations
81 vector[N] Y; // response variable
82 // data related to GPs
83 // number of sub-GPs (equal to 1 unless 'by' was used)
84 int<lower=1> Kgp_1;
85 int<lower=1> Dgp_1; // GP dimension
86 // number of basis functions of an approximate GP
87 int<lower=1> NBgp_1;
88 // approximate GP basis matrices
89 matrix[N, NBgp_1] Xgp_1;
90 // approximate GP eigenvalues
91 array[NBgp_1] vector[Dgp_1] slambda_1;
92 // data related to GPs
93 // number of sub-GPs (equal to 1 unless 'by' was used)
94 int<lower=1> Kgp_sigma_1;
95 int<lower=1> Dgp_sigma_1; // GP dimension
96 // number of basis functions of an approximate GP
97 int<lower=1> NBgp_sigma_1;
98 // approximate GP basis matrices
99 matrix[N, NBgp_sigma_1] Xgp_sigma_1;
100 // approximate GP eigenvalues
101 array[NBgp_sigma_1] vector[Dgp_sigma_1] slambda_sigma_1;
102 int prior_only; // should the likelihood be ignored?
103}
104transformed data {
105
106}
107parameters {
108 // temporary intercept for centered predictors
109 real Intercept;
110 // GP standard deviation parameters
111 real<lower=0> sdgp_1;
112 // GP length-scale parameters
113 real<lower=0> lscale_1;
114 // latent variables of the GP
115 vector[NBgp_1] zgp_1;
116 // temporary intercept for centered predictors
117 real Intercept_sigma;
118 // GP standard deviation parameters
119 real<lower=0> sdgp_sigma_1;
120 // GP length-scale parameters
121 real<lower=0> lscale_sigma_1;
122 // latent variables of the GP
123 vector[NBgp_sigma_1] zgp_sigma_1;
124}
125transformed parameters {
126 // vector versions of real parameters
127 vector<lower=0>[Kgp_1] vsdgp_1;
128 array[Kgp_1] vector<lower=0>[1] vlscale_1;
129 vector<lower=0>[Kgp_sigma_1] vsdgp_sigma_1;
130 array[Kgp_sigma_1] vector<lower=0>[1] vlscale_sigma_1;
131 vsdgp_1[1] = sdgp_1;
132 vlscale_1[1, 1] = lscale_1;
133 vsdgp_sigma_1[1] = sdgp_sigma_1;
134 vlscale_sigma_1[1, 1] = lscale_sigma_1;
135}
136model {
137 // initialize linear predictor term
138 vector[N] mu = Intercept + rep_vector(0, N)
139 + gpa(Xgp_1, vsdgp_1[1], vlscale_1[1], zgp_1, slambda_1);
140 // initialize linear predictor term
141 vector[N] sigma = Intercept_sigma + rep_vector(0, N)
142 + gpa(Xgp_sigma_1, vsdgp_sigma_1[1], vlscale_sigma_1[1],
143 zgp_sigma_1, slambda_sigma_1);
144 for (n in 1 : N) {
145 // apply the inverse link function
146 sigma[n] = exp(sigma[n]);
147 }
148 // priors including all constants
149 target += student_t_lpdf(Intercept | 3, -13, 36);
150 target += student_t_lpdf(vsdgp_1 | 3, 0, 36)
151 - 1 * student_t_lccdf(0 | 3, 0, 36);
152 target += normal_lpdf(zgp_1 | 0, 1);
153 target += inv_gamma_lpdf(vlscale_1[1] | 1.124909, 0.0177);
154 target += student_t_lpdf(Intercept_sigma | 3, 0, 10);
155 target += student_t_lpdf(vsdgp_sigma_1 | 3, 0, 36)
156 - 1 * student_t_lccdf(0 | 3, 0, 36);
157 target += normal_lpdf(zgp_sigma_1 | 0, 1);
158 target += inv_gamma_lpdf(vlscale_sigma_1[1] | 1.124909, 0.0177);
159 // likelihood including all constants
160 if (!prior_only) {
161 target += normal_lpdf(Y | mu, sigma);
162 }
163}
164generated quantities {
165 // actual population-level intercept
166 real b_Intercept = Intercept;
167 // actual population-level intercept
168 real b_sigma_Intercept = Intercept_sigma;
169}
170
171//@ DATA { N: 133, Y: [133 values], Dgp_1: 1, NBgp_1: 40, Kgp_1: 1, Xgp_1: [133×40 matrix], slambda_1: [40×1 matrix], Dgp_sigma_1: 1, NBgp_sigma_1: 20, Kgp_sigma_1: 1, Xgp_sigma_1: [133×20 matrix], slambda_sigma_1: [20×1 matrix], prior_only: 0 } // values supplied at runtime
172//@ PARAMS ["Intercept","sdgp_1","lscale_1","zgp_1[1]","zgp_1[2]","zgp_1[3]","zgp_1[4]","zgp_1[5]","zgp_1[6]","zgp_1[7]","zgp_1[8]","zgp_1[9]","zgp_1[10]","zgp_1[11]","zgp_1[12]","zgp_1[13]","zgp_1[14]","zgp_1[15]","zgp_1[16]","zgp_1[17]","zgp_1[18]","zgp_1[19]","zgp_1[20]","zgp_1[21]","zgp_1[22]","zgp_1[23]","zgp_1[24]","zgp_1[25]","zgp_1[26]","zgp_1[27]","zgp_1[28]","zgp_1[29]","zgp_1[30]","zgp_1[31]","zgp_1[32]","zgp_1[33]","zgp_1[34]","zgp_1[35]","zgp_1[36]","zgp_1[37]","zgp_1[38]","zgp_1[39]","zgp_1[40]","Intercept_sigma","sdgp_sigma_1","lscale_sigma_1","zgp_sigma_1[1]","zgp_sigma_1[2]","zgp_sigma_1[3]","zgp_sigma_1[4]","zgp_sigma_1[5]","zgp_sigma_1[6]","zgp_sigma_1[7]","zgp_sigma_1[8]","zgp_sigma_1[9]","zgp_sigma_1[10]","zgp_sigma_1[11]","zgp_sigma_1[12]","zgp_sigma_1[13]","zgp_sigma_1[14]","zgp_sigma_1[15]","zgp_sigma_1[16]","zgp_sigma_1[17]","zgp_sigma_1[18]","zgp_sigma_1[19]","zgp_sigma_1[20]"]
173//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
174
02answer overlay — reference vs stanrecord(Intercept, sdgp_1, lscale_1, zgp_1[1], zgp_1[2], zgp_1[3], zgp_1[4], zgp_1[5], zgp_1[6], zgp_1[7], zgp_1[8], zgp_1[9], zgp_1[10], zgp_1[11], zgp_1[12], zgp_1[13], zgp_1[14], zgp_1[15], zgp_1[16], zgp_1[17], zgp_1[18], zgp_1[19], zgp_1[20], zgp_1[21], zgp_1[22], zgp_1[23], zgp_1[24], zgp_1[25], zgp_1[26], zgp_1[27], zgp_1[28], zgp_1[29], zgp_1[30], zgp_1[31], zgp_1[32], zgp_1[33], zgp_1[34], zgp_1[35], zgp_1[36], zgp_1[37], zgp_1[38], zgp_1[39], zgp_1[40], Intercept_sigma, sdgp_sigma_1, lscale_sigma_1, zgp_sigma_1[1], zgp_sigma_1[2], zgp_sigma_1[3], zgp_sigma_1[4], zgp_sigma_1[5], zgp_sigma_1[6], zgp_sigma_1[7], zgp_sigma_1[8], zgp_sigma_1[9], zgp_sigma_1[10], zgp_sigma_1[11], zgp_sigma_1[12], zgp_sigma_1[13], zgp_sigma_1[14], zgp_sigma_1[15], zgp_sigma_1[16], zgp_sigma_1[17], zgp_sigma_1[18], zgp_sigma_1[19], zgp_sigma_1[20])
parameterreference mean±sdstan mean±sd
Intercept-10.68 ± 15.99-11.37 ± 15.86
sdgp_143.62 ± 11.5842.95 ± 10.30
lscale_10.081 ± 0.0160.079 ± 0.016
zgp_1[1]0.019 ± 0.944-0.021 ± 0.953
zgp_1[2]-0.251 ± 0.858-0.288 ± 0.884
zgp_1[3]0.400 ± 0.8770.395 ± 0.937
zgp_1[4]0.382 ± 0.7520.382 ± 0.709
zgp_1[5]-0.783 ± 0.860-0.723 ± 0.729
zgp_1[6]-0.473 ± 0.841-0.453 ± 0.762
zgp_1[7]0.704 ± 0.8770.719 ± 0.763
zgp_1[8]0.670 ± 0.7710.662 ± 0.771
zgp_1[9]-0.453 ± 0.777-0.516 ± 0.769
zgp_1[10]-0.917 ± 0.793-0.933 ± 0.863
zgp_1[11]0.485 ± 0.7820.441 ± 0.851
zgp_1[12]1.01 ± 0.8680.993 ± 0.771
zgp_1[13]-0.570 ± 0.835-0.540 ± 0.809
zgp_1[14]-0.878 ± 0.829-0.879 ± 0.789
zgp_1[15]0.509 ± 0.8080.564 ± 0.826
zgp_1[16]0.754 ± 0.8010.791 ± 0.868
zgp_1[17]-0.366 ± 0.826-0.357 ± 0.772
zgp_1[18]-0.842 ± 0.875-0.793 ± 0.913
zgp_1[19]0.287 ± 0.7990.222 ± 0.812
zgp_1[20]1.06 ± 0.8001.05 ± 0.776
zgp_1[21]-0.098 ± 0.816-0.138 ± 0.739
zgp_1[22]-1.08 ± 0.829-1.05 ± 0.827
zgp_1[23]0.077 ± 0.7800.076 ± 0.805
zgp_1[24]0.839 ± 0.8300.831 ± 0.838
zgp_1[25]-0.016 ± 0.814-0.086 ± 0.824
zgp_1[26]-0.604 ± 0.875-0.598 ± 0.785
zgp_1[27]0.021 ± 0.8140.026 ± 0.838
zgp_1[28]0.366 ± 0.8670.385 ± 0.847
zgp_1[29]-0.017 ± 0.8233.26e-4 ± 0.894
zgp_1[30]-0.325 ± 0.858-0.231 ± 0.864
zgp_1[31]-0.196 ± 0.846-0.143 ± 0.920
zgp_1[32]0.207 ± 0.8360.102 ± 0.845
zgp_1[33]0.284 ± 0.8730.318 ± 0.884
zgp_1[34]0.036 ± 0.8490.030 ± 0.845
zgp_1[35]-0.646 ± 0.925-0.578 ± 0.867
zgp_1[36]-0.213 ± 0.848-0.148 ± 0.906
zgp_1[37]0.609 ± 0.8840.629 ± 0.812
zgp_1[38]0.288 ± 0.8820.250 ± 0.883
zgp_1[39]-0.479 ± 0.905-0.423 ± 0.878
zgp_1[40]-0.386 ± 0.920-0.416 ± 0.867
Intercept_sigma2.40 ± 0.6362.43 ± 0.555
sdgp_sigma_12.99 ± 1.572.84 ± 1.44
lscale_sigma_10.031 ± 0.0370.029 ± 0.032
zgp_sigma_1[1]0.080 ± 1.020.056 ± 0.940
zgp_sigma_1[2]-0.513 ± 0.881-0.479 ± 0.946
zgp_sigma_1[3]-0.322 ± 0.949-0.345 ± 0.969
zgp_sigma_1[4]0.825 ± 0.8000.874 ± 0.768
zgp_sigma_1[5]0.655 ± 0.8430.630 ± 0.859
zgp_sigma_1[6]-0.880 ± 0.875-0.865 ± 0.802
zgp_sigma_1[7]-0.756 ± 0.843-0.767 ± 0.835
zgp_sigma_1[8]0.430 ± 0.8310.493 ± 0.869
zgp_sigma_1[9]0.673 ± 0.8710.753 ± 0.832
zgp_sigma_1[10]0.064 ± 0.8550.084 ± 0.891
zgp_sigma_1[11]-0.501 ± 0.801-0.442 ± 0.764
zgp_sigma_1[12]-0.504 ± 0.795-0.498 ± 0.847
zgp_sigma_1[13]0.128 ± 0.8230.185 ± 0.869
zgp_sigma_1[14]0.573 ± 0.8410.536 ± 0.865
zgp_sigma_1[15]0.223 ± 0.8170.274 ± 0.757
zgp_sigma_1[16]-0.312 ± 0.768-0.339 ± 0.831
zgp_sigma_1[17]-0.684 ± 0.800-0.640 ± 0.762
zgp_sigma_1[18]0.064 ± 0.8140.013 ± 0.750
zgp_sigma_1[19]0.671 ± 0.5710.675 ± 0.620
zgp_sigma_1[20]0.407 ± 0.6280.339 ± 0.567
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.6570 ≤ tol 2.6900 · floors 0.7507/1.3450
posteriordb-mesquite / logmesquite
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], sigma) stan pass 0.0131
00 statement source: posteriordb/mesquite-logmesquite
given

For each of N = 46 mesquite trees, the data provide the tree's weight, two diameter measurements (diam1 and diam2), canopy height, total height, wood density, and a binary group indicator. All continuous measurements (weight, diam1, diam2, canopy height, total height, and density) are log-transformed before fitting. The model has seven regression coefficients (an intercept and six slopes), each with a flat (improper uniform) prior over the reals. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each tree's log-transformed weight is normally distributed around a linear predictor. The linear predictor is the sum of an intercept, plus a slope coefficient times each of six covariates: the log-transformed first diameter, log-transformed second diameter, log-transformed canopy height, log-transformed total height, log-transformed wood density, and the untransformed group indicator. The standard deviation of the normal distribution is sigma, common to all observations.

query

The marginal posterior distribution of each of the eight parameters: the intercept (reported as beta[1]), the slope on log-diameter 1 (reported as beta[2]), the slope on log-diameter 2 (reported as beta[3]), the slope on log-canopy height (reported as beta[4]), the slope on log-total height (reported as beta[5]), the slope on log-density (reported as beta[6]), the slope on group (reported as beta[7]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.013
stan
1data {
2 int<lower=0> N;
3 vector[N] weight;
4 vector[N] diam1;
5 vector[N] diam2;
6 vector[N] canopy_height;
7 vector[N] total_height;
8 vector[N] density;
9 vector[N] group;
10}
11transformed data {
12 // log transformations
13 vector[N] log_weight;
14 vector[N] log_diam1;
15 vector[N] log_diam2;
16 vector[N] log_canopy_height;
17 vector[N] log_total_height;
18 vector[N] log_density;
19 log_weight = log(weight);
20 log_diam1 = log(diam1);
21 log_diam2 = log(diam2);
22 log_canopy_height = log(canopy_height);
23 log_total_height = log(total_height);
24 log_density = log(density);
25}
26parameters {
27 vector[7] beta;
28 real<lower=0> sigma;
29}
30model {
31 log_weight ~ normal(beta[1] + beta[2] * log_diam1 + beta[3] * log_diam2
32 + beta[4] * log_canopy_height
33 + beta[5] * log_total_height + beta[6] * log_density
34 + beta[7] * group, sigma);
35}
36
37//@ DATA { N: 46, canopy_height: [46 values], density: [46 values], diam1: [46 values], diam2: [46 values], group: [46 values], total_height: [46 values], weight: [46 values] } // values supplied at runtime
38//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","sigma"]
39//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
40
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], sigma)
beta[1]
reference stan24 bins · 4.81 … 5.83
00.060.060.120.1255.505.39 · 0.1065.34 · 0.124x = 4.81 A = 0.0020 B = 0.0020 Δ = 0.0000x = 4.85 A = 0.0040 B = 0.0020 Δ = 0.0020x = 4.90 A = 0.0040 B = 0.0040 Δ = 0.0000x = 4.94 A = 0.0080 B = 0.0080 Δ = 0.0000x = 4.99 A = 0.0080 B = 0.0120 Δ = -0.0040x = 5.03 A = 0.0280 B = 0.0160 Δ = 0.0120x = 5.08 A = 0.0320 B = 0.0320 Δ = 0.0000x = 5.12 A = 0.0400 B = 0.0440 Δ = -0.0040x = 5.17 A = 0.0520 B = 0.0560 Δ = -0.0040x = 5.21 A = 0.0540 B = 0.0740 Δ = -0.0200x = 5.25 A = 0.1020 B = 0.0760 Δ = 0.0260x = 5.30 A = 0.0900 B = 0.0960 Δ = -0.0060x = 5.34 A = 0.0820 B = 0.1240 Δ = -0.0420x = 5.39 A = 0.1060 B = 0.1060 Δ = -0.0000x = 5.43 A = 0.0760 B = 0.0680 Δ = 0.0080x = 5.47 A = 0.0880 B = 0.0960 Δ = -0.0080x = 5.52 A = 0.0600 B = 0.0540 Δ = 0.0060x = 5.56 A = 0.0540 B = 0.0480 Δ = 0.0060x = 5.61 A = 0.0480 B = 0.0320 Δ = 0.0160x = 5.65 A = 0.0260 B = 0.0220 Δ = 0.0040x = 5.70 A = 0.0200 B = 0.0160 Δ = 0.0040x = 5.74 A = 0.0080 B = 0.0080 Δ = 0.0000x = 5.79 A = 0.0020 B = 0.0000 Δ = 0.0020x = 5.83 A = 0.0060 B = 0.0040 Δ = 0.0020
beta[2]
reference stan24 bins · -0.56 … 1.46
00.060.060.120.12010.32 · 0.1200.41 · 0.124x = -0.56 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.47 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.38 A = 0.0000 B = 0.0060 Δ = -0.0060x = -0.30 A = 0.0060 B = 0.0080 Δ = -0.0020x = -0.21 A = 0.0180 B = 0.0220 Δ = -0.0040x = -0.12 A = 0.0140 B = 0.0240 Δ = -0.0100x = -0.03 A = 0.0480 B = 0.0340 Δ = 0.0140x = 0.06 A = 0.0780 B = 0.0580 Δ = 0.0200x = 0.14 A = 0.0840 B = 0.0860 Δ = -0.0020x = 0.23 A = 0.1100 B = 0.0960 Δ = 0.0140x = 0.32 A = 0.1200 B = 0.1120 Δ = 0.0080x = 0.41 A = 0.1200 B = 0.1240 Δ = -0.0040x = 0.49 A = 0.1040 B = 0.1040 Δ = 0.0000x = 0.58 A = 0.1000 B = 0.0980 Δ = 0.0020x = 0.67 A = 0.0580 B = 0.0780 Δ = -0.0200x = 0.76 A = 0.0440 B = 0.0580 Δ = -0.0140x = 0.85 A = 0.0440 B = 0.0280 Δ = 0.0160x = 0.93 A = 0.0300 B = 0.0200 Δ = 0.0100x = 1.02 A = 0.0120 B = 0.0200 Δ = -0.0080x = 1.11 A = 0.0060 B = 0.0100 Δ = -0.0040x = 1.20 A = 0.0020 B = 0.0020 Δ = 0.0000x = 1.28 A = 0.0020 B = 0.0060 Δ = -0.0040x = 1.37 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.46 A = 0.0000 B = 0.0040 Δ = -0.0040
beta[3]
reference stan24 bins · 0.15 … 1.79
00.080.080.150.1511.15 · 0.1441.15 · 0.150x = 0.15 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.22 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.29 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.36 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.43 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.50 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.57 A = 0.0040 B = 0.0080 Δ = -0.0040x = 0.65 A = 0.0120 B = 0.0060 Δ = 0.0060x = 0.72 A = 0.0320 B = 0.0260 Δ = 0.0060x = 0.79 A = 0.0280 B = 0.0320 Δ = -0.0040x = 0.86 A = 0.0500 B = 0.0600 Δ = -0.0100x = 0.93 A = 0.0680 B = 0.0760 Δ = -0.0080x = 1.00 A = 0.1040 B = 0.0940 Δ = 0.0100x = 1.08 A = 0.1060 B = 0.1200 Δ = -0.0140x = 1.15 A = 0.1440 B = 0.1500 Δ = -0.0060x = 1.22 A = 0.1120 B = 0.1180 Δ = -0.0060x = 1.29 A = 0.1200 B = 0.1020 Δ = 0.0180x = 1.36 A = 0.0740 B = 0.0840 Δ = -0.0100x = 1.43 A = 0.0680 B = 0.0500 Δ = 0.0180x = 1.51 A = 0.0460 B = 0.0360 Δ = 0.0100x = 1.58 A = 0.0240 B = 0.0200 Δ = 0.0040x = 1.65 A = 0.0040 B = 0.0140 Δ = -0.0100x = 1.72 A = 0.0020 B = 0.0020 Δ = 0.0000x = 1.79 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[4]
reference stan24 bins · -0.43 … 1.58
00.060.060.120.12010.36 · 0.1240.36 · 0.122x = -0.43 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.34 A = 0.0100 B = 0.0100 Δ = 0.0000x = -0.25 A = 0.0200 B = 0.0040 Δ = 0.0160x = -0.17 A = 0.0120 B = 0.0260 Δ = -0.0140x = -0.08 A = 0.0520 B = 0.0460 Δ = 0.0060x = 0.01 A = 0.0540 B = 0.0480 Δ = 0.0060x = 0.10 A = 0.0940 B = 0.0860 Δ = 0.0080x = 0.18 A = 0.0760 B = 0.0960 Δ = -0.0200x = 0.27 A = 0.0980 B = 0.0980 Δ = 0.0000x = 0.36 A = 0.1240 B = 0.1220 Δ = 0.0020x = 0.45 A = 0.0880 B = 0.1160 Δ = -0.0280x = 0.53 A = 0.1020 B = 0.1180 Δ = -0.0160x = 0.62 A = 0.0800 B = 0.0920 Δ = -0.0120x = 0.71 A = 0.0680 B = 0.0620 Δ = 0.0060x = 0.79 A = 0.0460 B = 0.0340 Δ = 0.0120x = 0.88 A = 0.0340 B = 0.0180 Δ = 0.0160x = 0.97 A = 0.0200 B = 0.0120 Δ = 0.0080x = 1.05 A = 0.0180 B = 0.0060 Δ = 0.0120x = 1.14 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.23 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.32 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.40 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.49 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.58 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[5]
reference stan24 bins · -0.72 … 1.48
00.070.070.130.13010.52 · 0.1240.43 · 0.130x = -0.72 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.62 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.53 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.43 A = 0.0080 B = 0.0080 Δ = 0.0000x = -0.34 A = 0.0200 B = 0.0180 Δ = 0.0020x = -0.24 A = 0.0180 B = 0.0200 Δ = -0.0020x = -0.15 A = 0.0280 B = 0.0220 Δ = 0.0060x = -0.05 A = 0.0380 B = 0.0480 Δ = -0.0100x = 0.04 A = 0.0680 B = 0.0640 Δ = 0.0040x = 0.14 A = 0.0780 B = 0.0780 Δ = 0.0000x = 0.23 A = 0.1080 B = 0.1100 Δ = -0.0020x = 0.33 A = 0.0960 B = 0.1220 Δ = -0.0260x = 0.43 A = 0.1020 B = 0.1300 Δ = -0.0280x = 0.52 A = 0.1240 B = 0.1180 Δ = 0.0060x = 0.62 A = 0.1120 B = 0.0720 Δ = 0.0400x = 0.71 A = 0.0820 B = 0.0640 Δ = 0.0180x = 0.81 A = 0.0500 B = 0.0500 Δ = 0.0000x = 0.90 A = 0.0280 B = 0.0340 Δ = -0.0060x = 1.00 A = 0.0220 B = 0.0240 Δ = -0.0020x = 1.09 A = 0.0060 B = 0.0080 Δ = -0.0020x = 1.19 A = 0.0060 B = 0.0060 Δ = 0.0000x = 1.28 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.38 A = 0.0040 B = 0.0000 Δ = 0.0040x = 1.48 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[6]
reference stan24 bins · -0.33 … 0.48
00.070.070.130.1300.09 · 0.1320.16 · 0.104x = -0.33 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.29 A = 0.0000 B = 0.0040 Δ = -0.0040x = -0.26 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.23 A = 0.0020 B = 0.0120 Δ = -0.0100x = -0.19 A = 0.0040 B = 0.0060 Δ = -0.0020x = -0.15 A = 0.0160 B = 0.0140 Δ = 0.0020x = -0.12 A = 0.0140 B = 0.0260 Δ = -0.0120x = -0.09 A = 0.0400 B = 0.0460 Δ = -0.0060x = -0.05 A = 0.0660 B = 0.0460 Δ = 0.0200x = -0.01 A = 0.0500 B = 0.0720 Δ = -0.0220x = 0.02 A = 0.0860 B = 0.0900 Δ = -0.0040x = 0.06 A = 0.0960 B = 0.0920 Δ = 0.0040x = 0.09 A = 0.1320 B = 0.0900 Δ = 0.0420x = 0.13 A = 0.0840 B = 0.0860 Δ = -0.0020x = 0.16 A = 0.1000 B = 0.1040 Δ = -0.0040x = 0.20 A = 0.0920 B = 0.0900 Δ = 0.0020x = 0.23 A = 0.0920 B = 0.0680 Δ = 0.0240x = 0.27 A = 0.0460 B = 0.0640 Δ = -0.0180x = 0.30 A = 0.0300 B = 0.0300 Δ = 0.0000x = 0.34 A = 0.0280 B = 0.0280 Δ = 0.0000x = 0.37 A = 0.0120 B = 0.0140 Δ = -0.0020x = 0.41 A = 0.0020 B = 0.0080 Δ = -0.0060x = 0.44 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.48 A = 0.0020 B = 0.0040 Δ = -0.0020
beta[7]
reference stan24 bins · -1.18 … -0.17
00.070.070.140.14-1-0.50-0.57 · 0.136-0.57 · 0.138x = -1.18 A = 0.0020 B = 0.0000 Δ = 0.0020x = -1.13 A = 0.0000 B = 0.0000 Δ = 0.0000x = -1.09 A = 0.0000 B = 0.0000 Δ = 0.0000x = -1.05 A = 0.0000 B = 0.0020 Δ = -0.0020x = -1.00 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.96 A = 0.0060 B = 0.0000 Δ = 0.0060x = -0.92 A = 0.0100 B = 0.0060 Δ = 0.0040x = -0.87 A = 0.0160 B = 0.0120 Δ = 0.0040x = -0.83 A = 0.0200 B = 0.0260 Δ = -0.0060x = -0.79 A = 0.0520 B = 0.0380 Δ = 0.0140x = -0.74 A = 0.0760 B = 0.0560 Δ = 0.0200x = -0.70 A = 0.0800 B = 0.1040 Δ = -0.0240x = -0.65 A = 0.1020 B = 0.1120 Δ = -0.0100x = -0.61 A = 0.1160 B = 0.1120 Δ = 0.0040x = -0.57 A = 0.1360 B = 0.1380 Δ = -0.0020x = -0.52 A = 0.1120 B = 0.1020 Δ = 0.0100x = -0.48 A = 0.0900 B = 0.1160 Δ = -0.0260x = -0.44 A = 0.0880 B = 0.0620 Δ = 0.0260x = -0.39 A = 0.0320 B = 0.0440 Δ = -0.0120x = -0.35 A = 0.0260 B = 0.0420 Δ = -0.0160x = -0.31 A = 0.0160 B = 0.0080 Δ = 0.0080x = -0.26 A = 0.0120 B = 0.0120 Δ = 0.0000x = -0.22 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.17 A = 0.0020 B = 0.0060 Δ = -0.0040
sigma
reference stan24 bins · 0.25 … 0.48
00.060.060.120.120.300.400.34 · 0.1160.33 · 0.110x = 0.25 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.26 A = 0.0120 B = 0.0060 Δ = 0.0060x = 0.27 A = 0.0080 B = 0.0140 Δ = -0.0060x = 0.28 A = 0.0260 B = 0.0260 Δ = -0.0000x = 0.29 A = 0.0440 B = 0.0340 Δ = 0.0100x = 0.30 A = 0.0880 B = 0.0620 Δ = 0.0260x = 0.31 A = 0.0720 B = 0.0860 Δ = -0.0140x = 0.32 A = 0.0820 B = 0.1080 Δ = -0.0260x = 0.33 A = 0.0980 B = 0.1100 Δ = -0.0120x = 0.34 A = 0.1160 B = 0.0880 Δ = 0.0280x = 0.35 A = 0.0900 B = 0.1020 Δ = -0.0120x = 0.36 A = 0.0900 B = 0.0900 Δ = -0.0000x = 0.37 A = 0.0760 B = 0.0720 Δ = 0.0040x = 0.38 A = 0.0520 B = 0.0560 Δ = -0.0040x = 0.39 A = 0.0380 B = 0.0500 Δ = -0.0120x = 0.40 A = 0.0420 B = 0.0320 Δ = 0.0100x = 0.41 A = 0.0220 B = 0.0240 Δ = -0.0020x = 0.42 A = 0.0120 B = 0.0100 Δ = 0.0020x = 0.43 A = 0.0100 B = 0.0080 Δ = 0.0020x = 0.44 A = 0.0060 B = 0.0120 Δ = -0.0060x = 0.45 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.46 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.47 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.48 A = 0.0020 B = 0.0060 Δ = -0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0131 ≤ tol 0.0453 · floors 0.0203/0.0226
posteriordb-mesquite / logmesquite_logva
answer record(beta[1], beta[2], beta[3], beta[4], sigma) stan pass 0.0103
00 statement source: posteriordb/mesquite-logmesquite_logva
given

For each of N = 46 plants, the data provide the plant's dry weight in kilograms, two diameter measurements in meters (diam1 and diam2), canopy height in meters, and a binary group indicator (0 or 1). The model operates on log-transformed variables: log-weight is the natural logarithm of weight; log-canopy-volume is the logarithm of diam1 times diam2 times canopy-height; log-canopy-area is the logarithm of diam1 times diam2. The regression has four coefficients—an intercept, a slope on log-canopy-volume, a slope on log-canopy-area, and a slope on the group indicator—each with a flat (improper uniform) prior over the reals. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each plant's log-transformed weight is normally distributed with a mean equal to the intercept plus the slope coefficient on log-canopy-volume times the log-transformed canopy volume, plus the slope coefficient on log-canopy-area times the log-transformed canopy area, plus the slope coefficient on the group indicator times the group membership value, and a common standard deviation sigma across all plants.

query

The marginal posterior distributions of the five parameters: the intercept (reported as beta[1]), the slope on log-canopy-volume (reported as beta[2]), the slope on log-canopy-area (reported as beta[3]), the slope on the group indicator (reported as beta[4]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.010
stan
1data {
2 int<lower=0> N;
3 vector[N] weight;
4 vector[N] diam1;
5 vector[N] diam2;
6 vector[N] canopy_height;
7 vector[N] group;
8}
9transformed data {
10 vector[N] log_weight;
11 vector[N] log_canopy_volume;
12 vector[N] log_canopy_area;
13 log_weight = log(weight);
14 log_canopy_volume = log(diam1 .* diam2 .* canopy_height);
15 log_canopy_area = log(diam1 .* diam2);
16}
17parameters {
18 vector[4] beta;
19 real<lower=0> sigma;
20}
21model {
22 log_weight ~ normal(beta[1] + beta[2] * log_canopy_volume
23 + beta[3] * log_canopy_area + beta[4] * group, sigma);
24}
25
26//@ DATA { N: 46, canopy_height: [46 values], diam1: [46 values], diam2: [46 values], group: [46 values], weight: [46 values] } // values supplied at runtime
27//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","sigma"]
28//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
29
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], sigma)
beta[1]
reference stan24 bins · 4.89 … 5.56
00.080.080.150.1555.505.18 · 0.1385.24 · 0.150x = 4.89 A = 0.0020 B = 0.0020 Δ = 0.0000x = 4.92 A = 0.0000 B = 0.0000 Δ = 0.0000x = 4.95 A = 0.0020 B = 0.0020 Δ = 0.0000x = 4.97 A = 0.0020 B = 0.0120 Δ = -0.0100x = 5.00 A = 0.0080 B = 0.0120 Δ = -0.0040x = 5.03 A = 0.0100 B = 0.0120 Δ = -0.0020x = 5.06 A = 0.0260 B = 0.0260 Δ = 0.0000x = 5.09 A = 0.0480 B = 0.0360 Δ = 0.0120x = 5.12 A = 0.0740 B = 0.0520 Δ = 0.0220x = 5.15 A = 0.0600 B = 0.1060 Δ = -0.0460x = 5.18 A = 0.1380 B = 0.1080 Δ = 0.0300x = 5.21 A = 0.1100 B = 0.1300 Δ = -0.0200x = 5.24 A = 0.1220 B = 0.1500 Δ = -0.0280x = 5.27 A = 0.0960 B = 0.1120 Δ = -0.0160x = 5.30 A = 0.1220 B = 0.0780 Δ = 0.0440x = 5.33 A = 0.0680 B = 0.0640 Δ = 0.0040x = 5.36 A = 0.0320 B = 0.0440 Δ = -0.0120x = 5.38 A = 0.0400 B = 0.0140 Δ = 0.0260x = 5.41 A = 0.0220 B = 0.0120 Δ = 0.0100x = 5.44 A = 0.0100 B = 0.0120 Δ = -0.0020x = 5.47 A = 0.0040 B = 0.0060 Δ = -0.0020x = 5.50 A = 0.0020 B = 0.0020 Δ = 0.0000x = 5.53 A = 0.0020 B = 0.0040 Δ = -0.0020x = 5.56 A = 0.0000 B = 0.0040 Δ = -0.0040
beta[2]
reference stan24 bins · 0.10 … 1.46
00.070.070.140.140.5010.63 · 0.1220.57 · 0.142x = 0.10 A = 0.0080 B = 0.0060 Δ = 0.0020x = 0.16 A = 0.0140 B = 0.0040 Δ = 0.0100x = 0.22 A = 0.0180 B = 0.0180 Δ = 0.0000x = 0.28 A = 0.0260 B = 0.0300 Δ = -0.0040x = 0.34 A = 0.0420 B = 0.0520 Δ = -0.0100x = 0.40 A = 0.0560 B = 0.0760 Δ = -0.0200x = 0.45 A = 0.0860 B = 0.0700 Δ = 0.0160x = 0.51 A = 0.1100 B = 0.0960 Δ = 0.0140x = 0.57 A = 0.1060 B = 0.1420 Δ = -0.0360x = 0.63 A = 0.1220 B = 0.1080 Δ = 0.0140x = 0.69 A = 0.1000 B = 0.0980 Δ = 0.0020x = 0.75 A = 0.0880 B = 0.0980 Δ = -0.0100x = 0.81 A = 0.0660 B = 0.0740 Δ = -0.0080x = 0.87 A = 0.0580 B = 0.0440 Δ = 0.0140x = 0.93 A = 0.0360 B = 0.0320 Δ = 0.0040x = 0.99 A = 0.0180 B = 0.0180 Δ = 0.0000x = 1.05 A = 0.0240 B = 0.0100 Δ = 0.0140x = 1.11 A = 0.0060 B = 0.0120 Δ = -0.0060x = 1.17 A = 0.0100 B = 0.0060 Δ = 0.0040x = 1.22 A = 0.0040 B = 0.0000 Δ = 0.0040x = 1.28 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.34 A = 0.0020 B = 0.0020 Δ = 0.0000x = 1.40 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.46 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[3]
reference stan24 bins · -0.71 … 0.99
00.070.070.130.1300.25 · 0.1160.40 · 0.132x = -0.71 A = 0.0000 B = 0.0040 Δ = -0.0040x = -0.64 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.56 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.49 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.41 A = 0.0080 B = 0.0040 Δ = 0.0040x = -0.34 A = 0.0120 B = 0.0040 Δ = 0.0080x = -0.27 A = 0.0180 B = 0.0140 Δ = 0.0040x = -0.19 A = 0.0220 B = 0.0180 Δ = 0.0040x = -0.12 A = 0.0280 B = 0.0260 Δ = 0.0020x = -0.05 A = 0.0560 B = 0.0620 Δ = -0.0060x = 0.03 A = 0.0520 B = 0.0480 Δ = 0.0040x = 0.10 A = 0.0900 B = 0.0820 Δ = 0.0080x = 0.18 A = 0.1080 B = 0.0880 Δ = 0.0200x = 0.25 A = 0.1160 B = 0.1120 Δ = 0.0040x = 0.32 A = 0.1080 B = 0.1240 Δ = -0.0160x = 0.40 A = 0.1140 B = 0.1320 Δ = -0.0180x = 0.47 A = 0.0840 B = 0.0920 Δ = -0.0080x = 0.55 A = 0.0700 B = 0.0620 Δ = 0.0080x = 0.62 A = 0.0400 B = 0.0520 Δ = -0.0120x = 0.69 A = 0.0320 B = 0.0360 Δ = -0.0040x = 0.77 A = 0.0160 B = 0.0180 Δ = -0.0020x = 0.84 A = 0.0100 B = 0.0140 Δ = -0.0040x = 0.92 A = 0.0100 B = 0.0040 Δ = 0.0060x = 0.99 A = 0.0040 B = 0.0020 Δ = 0.0020
beta[4]
reference stan24 bins · -1.00 … -0.18
00.060.060.130.13-0.50-0.54 · 0.126-0.50 · 0.120x = -1.00 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.96 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.93 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.89 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.86 A = 0.0000 B = 0.0040 Δ = -0.0040x = -0.82 A = 0.0040 B = 0.0080 Δ = -0.0040x = -0.79 A = 0.0260 B = 0.0140 Δ = 0.0120x = -0.75 A = 0.0260 B = 0.0160 Δ = 0.0100x = -0.71 A = 0.0360 B = 0.0400 Δ = -0.0040x = -0.68 A = 0.0460 B = 0.0500 Δ = -0.0040x = -0.64 A = 0.0820 B = 0.0800 Δ = 0.0020x = -0.61 A = 0.0920 B = 0.1140 Δ = -0.0220x = -0.57 A = 0.1080 B = 0.1080 Δ = 0.0000x = -0.54 A = 0.1260 B = 0.0920 Δ = 0.0340x = -0.50 A = 0.0840 B = 0.1200 Δ = -0.0360x = -0.47 A = 0.1080 B = 0.0740 Δ = 0.0340x = -0.43 A = 0.0960 B = 0.0960 Δ = 0.0000x = -0.40 A = 0.0780 B = 0.0580 Δ = 0.0200x = -0.36 A = 0.0360 B = 0.0580 Δ = -0.0220x = -0.32 A = 0.0220 B = 0.0340 Δ = -0.0120x = -0.29 A = 0.0180 B = 0.0140 Δ = 0.0040x = -0.25 A = 0.0040 B = 0.0080 Δ = -0.0040x = -0.22 A = 0.0060 B = 0.0060 Δ = 0.0000x = -0.18 A = 0.0020 B = 0.0020 Δ = 0.0000
sigma
reference stan24 bins · 0.25 … 0.47
00.070.070.140.140.300.400.34 · 0.1440.34 · 0.110x = 0.25 A = 0.0000 B = 0.0080 Δ = -0.0080x = 0.26 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.27 A = 0.0040 B = 0.0120 Δ = -0.0080x = 0.28 A = 0.0340 B = 0.0220 Δ = 0.0120x = 0.29 A = 0.0280 B = 0.0220 Δ = 0.0060x = 0.30 A = 0.0380 B = 0.0660 Δ = -0.0280x = 0.31 A = 0.0520 B = 0.0600 Δ = -0.0080x = 0.32 A = 0.0960 B = 0.0960 Δ = 0.0000x = 0.33 A = 0.0900 B = 0.0740 Δ = 0.0160x = 0.34 A = 0.1440 B = 0.1100 Δ = 0.0340x = 0.34 A = 0.0800 B = 0.0760 Δ = 0.0040x = 0.35 A = 0.0920 B = 0.0760 Δ = 0.0160x = 0.36 A = 0.0840 B = 0.0900 Δ = -0.0060x = 0.37 A = 0.0500 B = 0.0700 Δ = -0.0200x = 0.38 A = 0.0480 B = 0.0580 Δ = -0.0100x = 0.39 A = 0.0340 B = 0.0480 Δ = -0.0140x = 0.40 A = 0.0360 B = 0.0400 Δ = -0.0040x = 0.41 A = 0.0260 B = 0.0200 Δ = 0.0060x = 0.42 A = 0.0200 B = 0.0260 Δ = -0.0060x = 0.43 A = 0.0160 B = 0.0100 Δ = 0.0060x = 0.44 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.45 A = 0.0080 B = 0.0100 Δ = -0.0020x = 0.46 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.47 A = 0.0080 B = 0.0040 Δ = 0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0103 ≤ tol 0.0395 · floors 0.0115/0.0184
posteriordb-mesquite / logmesquite_logvas
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], sigma) stan pass 0.0136
00 statement source: posteriordb/mesquite-logmesquite_logvas
given

For each of N observations, the data provide the tree's weight and seven predictor measurements: two canopy diameters (diam1 and diam2) perpendicular to each other, canopy height, total height, wood density, and a grouping indicator. All predictors are derived by log-transforming combinations of the raw measurements: log-canopy-volume is the log of the product diam1 times diam2 times canopy_height; log-canopy-area is the log of diam1 times diam2; log-canopy-shape is the log of diam1 divided by diam2; log-total-height is the log of total_height; log-density is the log of density; and group is used directly without transformation. The model operates on log-weight, the natural logarithm of the tree weight. The regression has seven coefficients—an intercept beta[1] and six slopes beta[2] through beta[7] corresponding to the six transformed predictors (log-canopy-volume, log-canopy-area, log-canopy-shape, log-total-height, log-density, and group)—each with a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each tree's log-weight is normally distributed with a mean equal to a linear combination of the seven predictors and a common standard deviation sigma across all observations. The linear predictor is the intercept beta[1] plus beta[2] times log-canopy-volume, plus beta[3] times log-canopy-area, plus beta[4] times log-canopy-shape, plus beta[5] times log-total-height, plus beta[6] times log-density, plus beta[7] times the group indicator. The log-weight is thus generated from a normal distribution with this computed mean and standard deviation sigma.

query

The marginal posterior distributions of the eight parameters: the intercept beta[1], the six slope coefficients beta[2], beta[3], beta[4], beta[5], beta[6], and beta[7] (corresponding to log-canopy-volume, log-canopy-area, log-canopy-shape, log-total-height, log-density, and group respectively), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.014
stan
1data {
2 int<lower=0> N;
3 vector[N] weight;
4 vector[N] diam1;
5 vector[N] diam2;
6 vector[N] canopy_height;
7 vector[N] total_height;
8 vector[N] density;
9 vector[N] group;
10}
11transformed data {
12 vector[N] log_weight;
13 vector[N] log_canopy_volume;
14 vector[N] log_canopy_area;
15 vector[N] log_canopy_shape;
16 vector[N] log_total_height;
17 vector[N] log_density;
18 log_weight = log(weight);
19 log_canopy_volume = log(diam1 .* diam2 .* canopy_height);
20 log_canopy_area = log(diam1 .* diam2);
21 log_canopy_shape = log(diam1 ./ diam2);
22 log_total_height = log(total_height);
23 log_density = log(density);
24}
25parameters {
26 vector[7] beta;
27 real<lower=0> sigma;
28}
29model {
30 log_weight ~ normal(beta[1] + beta[2] * log_canopy_volume
31 + beta[3] * log_canopy_area
32 + beta[4] * log_canopy_shape
33 + beta[5] * log_total_height + beta[6] * log_density
34 + beta[7] * group, sigma);
35}
36
37//@ DATA { N: 46, canopy_height: [46 values], density: [46 values], diam1: [46 values], diam2: [46 values], group: [46 values], total_height: [46 values], weight: [46 values] } // values supplied at runtime
38//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","sigma"]
39//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
40
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], sigma)
beta[1]
reference stan24 bins · 4.73 … 5.94
00.070.070.130.1355.505.31 · 0.1225.31 · 0.134x = 4.73 A = 0.0020 B = 0.0020 Δ = 0.0000x = 4.79 A = 0.0000 B = 0.0000 Δ = 0.0000x = 4.84 A = 0.0020 B = 0.0020 Δ = 0.0000x = 4.89 A = 0.0080 B = 0.0020 Δ = 0.0060x = 4.94 A = 0.0180 B = 0.0040 Δ = 0.0140x = 5.00 A = 0.0160 B = 0.0140 Δ = 0.0020x = 5.05 A = 0.0260 B = 0.0300 Δ = -0.0040x = 5.10 A = 0.0360 B = 0.0500 Δ = -0.0140x = 5.15 A = 0.0600 B = 0.0680 Δ = -0.0080x = 5.21 A = 0.0880 B = 0.0760 Δ = 0.0120x = 5.26 A = 0.0880 B = 0.0880 Δ = 0.0000x = 5.31 A = 0.1220 B = 0.1340 Δ = -0.0120x = 5.36 A = 0.1000 B = 0.1020 Δ = -0.0020x = 5.42 A = 0.1120 B = 0.0800 Δ = 0.0320x = 5.47 A = 0.0980 B = 0.1160 Δ = -0.0180x = 5.52 A = 0.0660 B = 0.0800 Δ = -0.0140x = 5.57 A = 0.0620 B = 0.0580 Δ = 0.0040x = 5.63 A = 0.0380 B = 0.0420 Δ = -0.0040x = 5.68 A = 0.0260 B = 0.0360 Δ = -0.0100x = 5.73 A = 0.0140 B = 0.0100 Δ = 0.0040x = 5.78 A = 0.0140 B = 0.0040 Δ = 0.0100x = 5.84 A = 0.0000 B = 0.0020 Δ = -0.0020x = 5.89 A = 0.0020 B = 0.0000 Δ = 0.0020x = 5.94 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[2]
reference stan24 bins · -0.60 … 1.25
00.060.060.130.13010.28 · 0.1260.36 · 0.116x = -0.60 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.52 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.44 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.36 A = 0.0100 B = 0.0020 Δ = 0.0080x = -0.28 A = 0.0060 B = 0.0020 Δ = 0.0040x = -0.20 A = 0.0180 B = 0.0080 Δ = 0.0100x = -0.12 A = 0.0240 B = 0.0180 Δ = 0.0060x = -0.04 A = 0.0460 B = 0.0440 Δ = 0.0020x = 0.04 A = 0.0620 B = 0.0620 Δ = 0.0000x = 0.12 A = 0.0600 B = 0.0920 Δ = -0.0320x = 0.20 A = 0.0920 B = 0.1060 Δ = -0.0140x = 0.28 A = 0.1260 B = 0.1080 Δ = 0.0180x = 0.36 A = 0.1220 B = 0.1160 Δ = 0.0060x = 0.44 A = 0.0760 B = 0.1140 Δ = -0.0380x = 0.52 A = 0.0680 B = 0.1120 Δ = -0.0440x = 0.60 A = 0.0780 B = 0.0720 Δ = 0.0060x = 0.69 A = 0.0700 B = 0.0460 Δ = 0.0240x = 0.77 A = 0.0520 B = 0.0400 Δ = 0.0120x = 0.85 A = 0.0260 B = 0.0280 Δ = -0.0020x = 0.93 A = 0.0300 B = 0.0140 Δ = 0.0160x = 1.01 A = 0.0180 B = 0.0040 Δ = 0.0140x = 1.09 A = 0.0060 B = 0.0040 Δ = 0.0020x = 1.17 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.25 A = 0.0040 B = 0.0040 Δ = 0.0000
beta[3]
reference stan24 bins · -0.53 … 1.37
00.070.070.140.14010.46 · 0.1400.38 · 0.116x = -0.53 A = 0.0020 B = 0.0040 Δ = -0.0020x = -0.45 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.37 A = 0.0060 B = 0.0040 Δ = 0.0020x = -0.28 A = 0.0140 B = 0.0040 Δ = 0.0100x = -0.20 A = 0.0220 B = 0.0100 Δ = 0.0120x = -0.12 A = 0.0320 B = 0.0180 Δ = 0.0140x = -0.04 A = 0.0360 B = 0.0300 Δ = 0.0060x = 0.04 A = 0.0460 B = 0.0460 Δ = 0.0000x = 0.13 A = 0.0900 B = 0.0700 Δ = 0.0200x = 0.21 A = 0.0640 B = 0.1120 Δ = -0.0480x = 0.29 A = 0.0880 B = 0.0960 Δ = -0.0080x = 0.38 A = 0.1020 B = 0.1160 Δ = -0.0140x = 0.46 A = 0.1400 B = 0.0980 Δ = 0.0420x = 0.54 A = 0.0720 B = 0.0980 Δ = -0.0260x = 0.62 A = 0.0680 B = 0.1020 Δ = -0.0340x = 0.70 A = 0.0840 B = 0.0820 Δ = 0.0020x = 0.79 A = 0.0420 B = 0.0520 Δ = -0.0100x = 0.87 A = 0.0380 B = 0.0200 Δ = 0.0180x = 0.95 A = 0.0220 B = 0.0240 Δ = -0.0020x = 1.04 A = 0.0180 B = 0.0080 Δ = 0.0100x = 1.12 A = 0.0040 B = 0.0020 Δ = 0.0020x = 1.20 A = 0.0040 B = 0.0000 Δ = 0.0040x = 1.28 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.37 A = 0.0040 B = 0.0020 Δ = 0.0020
beta[4]
reference stan24 bins · -1.14 … 0.40
00.070.070.130.13-10-0.34 · 0.130-0.34 · 0.132x = -1.14 A = 0.0020 B = 0.0020 Δ = 0.0000x = -1.07 A = 0.0040 B = 0.0000 Δ = 0.0040x = -1.00 A = 0.0000 B = 0.0060 Δ = -0.0060x = -0.94 A = 0.0160 B = 0.0060 Δ = 0.0100x = -0.87 A = 0.0200 B = 0.0120 Δ = 0.0080x = -0.81 A = 0.0260 B = 0.0240 Δ = 0.0020x = -0.74 A = 0.0380 B = 0.0380 Δ = 0.0000x = -0.67 A = 0.0460 B = 0.0560 Δ = -0.0100x = -0.60 A = 0.0660 B = 0.0920 Δ = -0.0260x = -0.54 A = 0.0740 B = 0.0860 Δ = -0.0120x = -0.47 A = 0.0940 B = 0.1160 Δ = -0.0220x = -0.41 A = 0.1000 B = 0.0900 Δ = 0.0100x = -0.34 A = 0.1300 B = 0.1320 Δ = -0.0020x = -0.27 A = 0.0960 B = 0.0740 Δ = 0.0220x = -0.20 A = 0.0820 B = 0.0800 Δ = 0.0020x = -0.14 A = 0.0580 B = 0.0620 Δ = -0.0040x = -0.07 A = 0.0560 B = 0.0440 Δ = 0.0120x = -0.01 A = 0.0260 B = 0.0340 Δ = -0.0080x = 0.06 A = 0.0220 B = 0.0220 Δ = 0.0000x = 0.13 A = 0.0220 B = 0.0080 Δ = 0.0140x = 0.20 A = 0.0140 B = 0.0080 Δ = 0.0060x = 0.26 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.33 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.40 A = 0.0000 B = 0.0040 Δ = -0.0040
beta[5]
reference stan24 bins · -0.85 … 1.24
00.070.070.140.14010.51 · 0.1180.42 · 0.140x = -0.85 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.76 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.67 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.58 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.49 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.40 A = 0.0040 B = 0.0040 Δ = 0.0000x = -0.31 A = 0.0140 B = 0.0220 Δ = -0.0080x = -0.22 A = 0.0060 B = 0.0200 Δ = -0.0140x = -0.13 A = 0.0460 B = 0.0200 Δ = 0.0260x = -0.04 A = 0.0500 B = 0.0540 Δ = -0.0040x = 0.06 A = 0.0680 B = 0.0660 Δ = 0.0020x = 0.15 A = 0.0800 B = 0.0600 Δ = 0.0200x = 0.24 A = 0.0840 B = 0.0860 Δ = -0.0020x = 0.33 A = 0.1060 B = 0.1120 Δ = -0.0060x = 0.42 A = 0.0900 B = 0.1400 Δ = -0.0500x = 0.51 A = 0.1180 B = 0.1140 Δ = 0.0040x = 0.60 A = 0.1060 B = 0.0800 Δ = 0.0260x = 0.69 A = 0.0860 B = 0.1040 Δ = -0.0180x = 0.78 A = 0.0460 B = 0.0500 Δ = -0.0040x = 0.88 A = 0.0420 B = 0.0300 Δ = 0.0120x = 0.97 A = 0.0180 B = 0.0240 Δ = -0.0060x = 1.06 A = 0.0080 B = 0.0060 Δ = 0.0020x = 1.15 A = 0.0060 B = 0.0060 Δ = 0.0000x = 1.24 A = 0.0120 B = 0.0020 Δ = 0.0100
beta[6]
reference stan24 bins · -0.35 … 0.58
00.080.080.160.1600.500.06 · 0.1240.14 · 0.158x = -0.35 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.31 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.27 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.23 A = 0.0060 B = 0.0020 Δ = 0.0040x = -0.19 A = 0.0060 B = 0.0080 Δ = -0.0020x = -0.15 A = 0.0140 B = 0.0180 Δ = -0.0040x = -0.10 A = 0.0280 B = 0.0240 Δ = 0.0040x = -0.07 A = 0.0500 B = 0.0480 Δ = 0.0020x = -0.02 A = 0.0840 B = 0.0760 Δ = 0.0080x = 0.02 A = 0.0900 B = 0.0820 Δ = 0.0080x = 0.06 A = 0.1240 B = 0.1020 Δ = 0.0220x = 0.10 A = 0.1200 B = 0.0980 Δ = 0.0220x = 0.14 A = 0.1020 B = 0.1580 Δ = -0.0560x = 0.18 A = 0.1080 B = 0.1020 Δ = 0.0060x = 0.22 A = 0.0980 B = 0.1060 Δ = -0.0080x = 0.26 A = 0.0560 B = 0.0820 Δ = -0.0260x = 0.30 A = 0.0500 B = 0.0580 Δ = -0.0080x = 0.34 A = 0.0200 B = 0.0180 Δ = 0.0020x = 0.38 A = 0.0200 B = 0.0060 Δ = 0.0140x = 0.42 A = 0.0100 B = 0.0040 Δ = 0.0060x = 0.46 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.50 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.54 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.58 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[7]
reference stan24 bins · -1.02 … -0.18
00.060.060.130.13-1-0.50-0.58 · 0.110-0.62 · 0.128x = -1.02 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.98 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.94 A = 0.0040 B = 0.0060 Δ = -0.0020x = -0.91 A = 0.0020 B = 0.0060 Δ = -0.0040x = -0.87 A = 0.0120 B = 0.0060 Δ = 0.0060x = -0.83 A = 0.0120 B = 0.0260 Δ = -0.0140x = -0.80 A = 0.0240 B = 0.0220 Δ = 0.0020x = -0.76 A = 0.0580 B = 0.0600 Δ = -0.0020x = -0.72 A = 0.0600 B = 0.0660 Δ = -0.0060x = -0.69 A = 0.0860 B = 0.0660 Δ = 0.0200x = -0.65 A = 0.1000 B = 0.1080 Δ = -0.0080x = -0.62 A = 0.1000 B = 0.1280 Δ = -0.0280x = -0.58 A = 0.1100 B = 0.1280 Δ = -0.0180x = -0.54 A = 0.1040 B = 0.0920 Δ = 0.0120x = -0.51 A = 0.0920 B = 0.0960 Δ = -0.0040x = -0.47 A = 0.0820 B = 0.0700 Δ = 0.0120x = -0.43 A = 0.0520 B = 0.0320 Δ = 0.0200x = -0.40 A = 0.0260 B = 0.0280 Δ = -0.0020x = -0.36 A = 0.0240 B = 0.0280 Δ = -0.0040x = -0.33 A = 0.0180 B = 0.0120 Δ = 0.0060x = -0.29 A = 0.0140 B = 0.0080 Δ = 0.0060x = -0.25 A = 0.0080 B = 0.0060 Δ = 0.0020x = -0.22 A = 0.0080 B = 0.0040 Δ = 0.0040x = -0.18 A = 0.0040 B = 0.0000 Δ = 0.0040
sigma
reference stan24 bins · 0.25 … 0.52
00.070.070.130.130.300.400.500.33 · 0.1300.32 · 0.124x = 0.25 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.26 A = 0.0160 B = 0.0120 Δ = 0.0040x = 0.27 A = 0.0200 B = 0.0320 Δ = -0.0120x = 0.29 A = 0.0480 B = 0.0520 Δ = -0.0040x = 0.30 A = 0.0580 B = 0.0840 Δ = -0.0260x = 0.31 A = 0.1080 B = 0.1000 Δ = 0.0080x = 0.32 A = 0.1260 B = 0.1240 Δ = 0.0020x = 0.33 A = 0.1300 B = 0.1180 Δ = 0.0120x = 0.34 A = 0.1180 B = 0.1200 Δ = -0.0020x = 0.36 A = 0.1080 B = 0.1120 Δ = -0.0040x = 0.37 A = 0.0720 B = 0.0620 Δ = 0.0100x = 0.38 A = 0.0520 B = 0.0520 Δ = 0.0000x = 0.39 A = 0.0480 B = 0.0520 Δ = -0.0040x = 0.41 A = 0.0300 B = 0.0240 Δ = 0.0060x = 0.42 A = 0.0140 B = 0.0180 Δ = -0.0040x = 0.43 A = 0.0080 B = 0.0160 Δ = -0.0080x = 0.44 A = 0.0200 B = 0.0080 Δ = 0.0120x = 0.45 A = 0.0020 B = 0.0080 Δ = -0.0060x = 0.46 A = 0.0080 B = 0.0040 Δ = 0.0040x = 0.48 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.49 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.50 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.51 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.52 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0136 ≤ tol 0.0523 · floors 0.0152/0.0212
posteriordb-mesquite / logmesquite_logvash
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], sigma) stan pass 0.0137
00 statement source: posteriordb/mesquite-logmesquite_logvash
given

For each of N = 46 plants, the data provide measurements of the plant's weight (in kg), two diameter measurements diam1 and diam2, the height of the canopy, the total height of the plant, and a grouping indicator. The weight is transformed to the log scale to construct the response variable. The analysis uses six derived predictor variables computed from the raw measurements: log(diam1 times diam2 times canopy_height), log(diam1 times diam2), log(diam1 divided by diam2), log(total_height), and the grouping indicator itself (untransformed). All six regression coefficients beta[1] through beta[6] have flat (improper uniform) priors over the real line. The residual standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each plant's log-transformed weight is normally distributed around a linear predictor constructed from the five log-transformed geometric covariates and the grouping indicator. The linear predictor is the sum of an intercept beta[1] plus coefficients beta[2] through beta[6] multiplied by the corresponding derived predictors: beta[2] times log(diam1 times diam2 times canopy_height) plus beta[3] times log(diam1 times diam2) plus beta[4] times log(diam1 divided by diam2) plus beta[5] times log(total_height) plus beta[6] times the grouping indicator. The standard deviation of the normal distribution for each observation is the common parameter sigma across all plants.

query

The marginal posterior distributions of each of the seven parameters: beta[1] (the intercept), beta[2] (the coefficient for log canopy volume), beta[3] (the coefficient for log canopy area), beta[4] (the coefficient for log canopy shape), beta[5] (the coefficient for log total height), beta[6] (the coefficient for the grouping indicator), and sigma (the residual standard deviation).

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.014
stan
1data {
2 int<lower=0> N;
3 vector[N] weight;
4 vector[N] diam1;
5 vector[N] diam2;
6 vector[N] canopy_height;
7 vector[N] total_height;
8 vector[N] group;
9}
10transformed data {
11 vector[N] log_weight;
12 vector[N] log_canopy_volume;
13 vector[N] log_canopy_area;
14 vector[N] log_canopy_shape;
15 vector[N] log_total_height;
16 log_weight = log(weight);
17 log_canopy_volume = log(diam1 .* diam2 .* canopy_height);
18 log_canopy_area = log(diam1 .* diam2);
19 log_canopy_shape = log(diam1 ./ diam2);
20 log_total_height = log(total_height);
21}
22parameters {
23 vector[6] beta;
24 real<lower=0> sigma;
25}
26model {
27 log_weight ~ normal(beta[1] + beta[2] * log_canopy_volume
28 + beta[3] * log_canopy_area
29 + beta[4] * log_canopy_shape
30 + beta[5] * log_total_height + beta[6] * group, sigma);
31}
32
33//@ DATA { N: 46, canopy_height: [46 values], diam1: [46 values], diam2: [46 values], group: [46 values], total_height: [46 values], weight: [46 values] } // values supplied at runtime
34//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","sigma"]
35//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
36
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], sigma)
beta[1]
reference stan24 bins · 4.78 … 5.92
00.070.070.130.1355.505.28 · 0.1345.37 · 0.118x = 4.78 A = 0.0020 B = 0.0020 Δ = 0.0000x = 4.83 A = 0.0020 B = 0.0020 Δ = 0.0000x = 4.88 A = 0.0020 B = 0.0060 Δ = -0.0040x = 4.93 A = 0.0160 B = 0.0120 Δ = 0.0040x = 4.98 A = 0.0080 B = 0.0180 Δ = -0.0100x = 5.03 A = 0.0200 B = 0.0200 Δ = 0.0000x = 5.08 A = 0.0520 B = 0.0400 Δ = 0.0120x = 5.13 A = 0.0520 B = 0.0520 Δ = -0.0000x = 5.18 A = 0.0840 B = 0.0600 Δ = 0.0240x = 5.22 A = 0.1000 B = 0.1140 Δ = -0.0140x = 5.28 A = 0.1340 B = 0.1160 Δ = 0.0180x = 5.33 A = 0.1140 B = 0.1100 Δ = 0.0040x = 5.37 A = 0.1180 B = 0.1180 Δ = 0.0000x = 5.42 A = 0.0980 B = 0.0880 Δ = 0.0100x = 5.47 A = 0.0620 B = 0.0780 Δ = -0.0160x = 5.52 A = 0.0620 B = 0.0540 Δ = 0.0080x = 5.57 A = 0.0260 B = 0.0320 Δ = -0.0060x = 5.62 A = 0.0260 B = 0.0260 Δ = 0.0000x = 5.67 A = 0.0080 B = 0.0260 Δ = -0.0180x = 5.72 A = 0.0040 B = 0.0060 Δ = -0.0020x = 5.77 A = 0.0080 B = 0.0080 Δ = 0.0000x = 5.82 A = 0.0000 B = 0.0080 Δ = -0.0080x = 5.87 A = 0.0000 B = 0.0020 Δ = -0.0020x = 5.92 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[2]
reference stan24 bins · -0.59 … 1.25
00.060.060.130.13010.37 · 0.1140.37 · 0.126x = -0.59 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.51 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.43 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.35 A = 0.0060 B = 0.0020 Δ = 0.0040x = -0.27 A = 0.0040 B = 0.0120 Δ = -0.0080x = -0.19 A = 0.0060 B = 0.0200 Δ = -0.0140x = -0.11 A = 0.0220 B = 0.0280 Δ = -0.0060x = -0.03 A = 0.0320 B = 0.0240 Δ = 0.0080x = 0.05 A = 0.0620 B = 0.0500 Δ = 0.0120x = 0.13 A = 0.0920 B = 0.0580 Δ = 0.0340x = 0.21 A = 0.1020 B = 0.0760 Δ = 0.0260x = 0.29 A = 0.0700 B = 0.1060 Δ = -0.0360x = 0.37 A = 0.1140 B = 0.1260 Δ = -0.0120x = 0.45 A = 0.1000 B = 0.1100 Δ = -0.0100x = 0.53 A = 0.0980 B = 0.0860 Δ = 0.0120x = 0.61 A = 0.0840 B = 0.0800 Δ = 0.0040x = 0.69 A = 0.0620 B = 0.0840 Δ = -0.0220x = 0.77 A = 0.0460 B = 0.0440 Δ = 0.0020x = 0.85 A = 0.0500 B = 0.0320 Δ = 0.0180x = 0.93 A = 0.0220 B = 0.0240 Δ = -0.0020x = 1.01 A = 0.0060 B = 0.0180 Δ = -0.0120x = 1.09 A = 0.0120 B = 0.0100 Δ = 0.0020x = 1.17 A = 0.0020 B = 0.0040 Δ = -0.0020x = 1.25 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[3]
reference stan24 bins · -0.44 … 1.42
00.060.060.120.12010.53 · 0.1220.45 · 0.120x = -0.44 A = 0.0060 B = 0.0060 Δ = 0.0000x = -0.35 A = 0.0060 B = 0.0140 Δ = -0.0080x = -0.28 A = 0.0120 B = 0.0160 Δ = -0.0040x = -0.19 A = 0.0140 B = 0.0040 Δ = 0.0100x = -0.11 A = 0.0280 B = 0.0200 Δ = 0.0080x = -0.03 A = 0.0380 B = 0.0600 Δ = -0.0220x = 0.05 A = 0.0520 B = 0.0520 Δ = 0.0000x = 0.13 A = 0.0940 B = 0.0680 Δ = 0.0260x = 0.21 A = 0.0780 B = 0.0840 Δ = -0.0060x = 0.29 A = 0.0700 B = 0.0940 Δ = -0.0240x = 0.37 A = 0.0940 B = 0.1100 Δ = -0.0160x = 0.45 A = 0.1020 B = 0.1200 Δ = -0.0180x = 0.53 A = 0.1220 B = 0.0800 Δ = 0.0420x = 0.61 A = 0.0840 B = 0.0800 Δ = 0.0040x = 0.69 A = 0.0740 B = 0.0660 Δ = 0.0080x = 0.77 A = 0.0420 B = 0.0460 Δ = -0.0040x = 0.85 A = 0.0400 B = 0.0200 Δ = 0.0200x = 0.93 A = 0.0180 B = 0.0140 Δ = 0.0040x = 1.01 A = 0.0140 B = 0.0240 Δ = -0.0100x = 1.09 A = 0.0040 B = 0.0120 Δ = -0.0080x = 1.18 A = 0.0020 B = 0.0040 Δ = -0.0020x = 1.26 A = 0.0000 B = 0.0060 Δ = -0.0060x = 1.34 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.42 A = 0.0060 B = 0.0000 Δ = 0.0060
beta[4]
reference stan24 bins · -1.17 … 0.36
00.070.070.130.13-10-0.30 · 0.132-0.43 · 0.132x = -1.17 A = 0.0000 B = 0.0020 Δ = -0.0020x = -1.10 A = 0.0000 B = 0.0000 Δ = 0.0000x = -1.03 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.97 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.90 A = 0.0100 B = 0.0060 Δ = 0.0040x = -0.83 A = 0.0020 B = 0.0200 Δ = -0.0180x = -0.77 A = 0.0100 B = 0.0120 Δ = -0.0020x = -0.70 A = 0.0280 B = 0.0460 Δ = -0.0180x = -0.63 A = 0.0540 B = 0.0500 Δ = 0.0040x = -0.57 A = 0.0700 B = 0.0500 Δ = 0.0200x = -0.50 A = 0.0840 B = 0.0940 Δ = -0.0100x = -0.43 A = 0.0980 B = 0.1320 Δ = -0.0340x = -0.37 A = 0.1000 B = 0.0980 Δ = 0.0020x = -0.30 A = 0.1320 B = 0.1180 Δ = 0.0140x = -0.24 A = 0.1020 B = 0.0760 Δ = 0.0260x = -0.17 A = 0.1060 B = 0.0820 Δ = 0.0240x = -0.10 A = 0.0680 B = 0.0660 Δ = 0.0020x = -0.04 A = 0.0620 B = 0.0380 Δ = 0.0240x = 0.03 A = 0.0300 B = 0.0360 Δ = -0.0060x = 0.10 A = 0.0200 B = 0.0280 Δ = -0.0080x = 0.16 A = 0.0080 B = 0.0280 Δ = -0.0200x = 0.23 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.29 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.36 A = 0.0020 B = 0.0060 Δ = -0.0040
beta[5]
reference stan24 bins · -0.51 … 1.42
00.050.050.110.11010.58 · 0.1060.33 · 0.106x = -0.51 A = 0.0000 B = 0.0080 Δ = -0.0080x = -0.43 A = 0.0000 B = 0.0040 Δ = -0.0040x = -0.34 A = 0.0020 B = 0.0100 Δ = -0.0080x = -0.26 A = 0.0100 B = 0.0100 Δ = 0.0000x = -0.18 A = 0.0220 B = 0.0240 Δ = -0.0020x = -0.09 A = 0.0400 B = 0.0280 Δ = 0.0120x = -0.01 A = 0.0560 B = 0.0580 Δ = -0.0020x = 0.08 A = 0.0680 B = 0.0560 Δ = 0.0120x = 0.16 A = 0.0680 B = 0.0600 Δ = 0.0080x = 0.24 A = 0.1040 B = 0.0960 Δ = 0.0080x = 0.33 A = 0.0720 B = 0.1060 Δ = -0.0340x = 0.41 A = 0.0920 B = 0.0960 Δ = -0.0040x = 0.49 A = 0.0900 B = 0.0960 Δ = -0.0060x = 0.58 A = 0.1060 B = 0.0860 Δ = 0.0200x = 0.66 A = 0.0840 B = 0.0860 Δ = -0.0020x = 0.75 A = 0.0740 B = 0.0700 Δ = 0.0040x = 0.83 A = 0.0380 B = 0.0400 Δ = -0.0020x = 0.92 A = 0.0160 B = 0.0260 Δ = -0.0100x = 1.00 A = 0.0220 B = 0.0160 Δ = 0.0060x = 1.08 A = 0.0220 B = 0.0080 Δ = 0.0140x = 1.17 A = 0.0060 B = 0.0040 Δ = 0.0020x = 1.25 A = 0.0040 B = 0.0060 Δ = -0.0020x = 1.33 A = 0.0040 B = 0.0040 Δ = 0.0000x = 1.42 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[6]
reference stan24 bins · -0.93 … -0.09
00.070.070.130.13-0.50-0.49 · 0.128-0.49 · 0.130x = -0.93 A = 0.0020 B = 0.0040 Δ = -0.0020x = -0.89 A = 0.0020 B = 0.0040 Δ = -0.0020x = -0.85 A = 0.0060 B = 0.0080 Δ = -0.0020x = -0.82 A = 0.0140 B = 0.0100 Δ = 0.0040x = -0.78 A = 0.0120 B = 0.0120 Δ = 0.0000x = -0.74 A = 0.0360 B = 0.0300 Δ = 0.0060x = -0.71 A = 0.0520 B = 0.0600 Δ = -0.0080x = -0.67 A = 0.0740 B = 0.0820 Δ = -0.0080x = -0.63 A = 0.0820 B = 0.1020 Δ = -0.0200x = -0.60 A = 0.1000 B = 0.0940 Δ = 0.0060x = -0.56 A = 0.1220 B = 0.1200 Δ = 0.0020x = -0.52 A = 0.0820 B = 0.1080 Δ = -0.0260x = -0.49 A = 0.1280 B = 0.1300 Δ = -0.0020x = -0.45 A = 0.0980 B = 0.0740 Δ = 0.0240x = -0.41 A = 0.0780 B = 0.0480 Δ = 0.0300x = -0.38 A = 0.0400 B = 0.0540 Δ = -0.0140x = -0.34 A = 0.0440 B = 0.0320 Δ = 0.0120x = -0.30 A = 0.0080 B = 0.0160 Δ = -0.0080x = -0.27 A = 0.0120 B = 0.0040 Δ = 0.0080x = -0.23 A = 0.0060 B = 0.0000 Δ = 0.0060x = -0.20 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.16 A = 0.0000 B = 0.0040 Δ = -0.0040x = -0.12 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.09 A = 0.0000 B = 0.0020 Δ = -0.0020
sigma
reference stan24 bins · 0.25 … 0.47
00.060.060.110.110.300.400.34 · 0.1120.32 · 0.096x = 0.25 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.26 A = 0.0100 B = 0.0080 Δ = 0.0020x = 0.27 A = 0.0180 B = 0.0200 Δ = -0.0020x = 0.28 A = 0.0340 B = 0.0400 Δ = -0.0060x = 0.29 A = 0.0680 B = 0.0440 Δ = 0.0240x = 0.30 A = 0.0520 B = 0.0780 Δ = -0.0260x = 0.31 A = 0.0700 B = 0.0800 Δ = -0.0100x = 0.32 A = 0.0900 B = 0.0960 Δ = -0.0060x = 0.33 A = 0.0960 B = 0.0840 Δ = 0.0120x = 0.34 A = 0.1120 B = 0.0760 Δ = 0.0360x = 0.34 A = 0.0880 B = 0.0900 Δ = -0.0020x = 0.35 A = 0.0740 B = 0.0940 Δ = -0.0200x = 0.36 A = 0.0840 B = 0.0860 Δ = -0.0020x = 0.37 A = 0.0380 B = 0.0420 Δ = -0.0040x = 0.38 A = 0.0660 B = 0.0520 Δ = 0.0140x = 0.39 A = 0.0300 B = 0.0180 Δ = 0.0120x = 0.40 A = 0.0180 B = 0.0240 Δ = -0.0060x = 0.41 A = 0.0120 B = 0.0160 Δ = -0.0040x = 0.42 A = 0.0040 B = 0.0200 Δ = -0.0160x = 0.43 A = 0.0140 B = 0.0160 Δ = -0.0020x = 0.44 A = 0.0040 B = 0.0080 Δ = -0.0040x = 0.45 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.46 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.47 A = 0.0020 B = 0.0020 Δ = 0.0000
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0137 ≤ tol 0.0554 · floors 0.0215/0.0277
posteriordb-mesquite / logmesquite_logvolume
answer record(beta[1], beta[2], sigma) stan pass 0.0030
00 statement source: posteriordb/mesquite-logmesquite_logvolume
given

For each of N mesquite trees, the data provide the tree's weight (positive real value), two diameter measurements (diam1 and diam2, both positive reals), and canopy height (positive real). The model operates on log-transformed variables: the natural logarithm of weight as the response, and the natural logarithm of canopy volume (computed as the product diam1 * diam2 * canopy_height) as the predictor. The two regression coefficients beta[1] and beta[2] each have a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each tree's log-weight is normally distributed with a mean equal to the intercept plus the slope times the tree's log-canopy-volume, and a common standard deviation sigma across all trees.

query

The marginal posterior distribution of each of the three parameters: the intercept (reported as beta[1]), the slope on log-canopy-volume (reported as beta[2]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.003
stan
1data {
2 int<lower=0> N;
3 vector[N] weight;
4 vector[N] diam1;
5 vector[N] diam2;
6 vector[N] canopy_height;
7}
8transformed data {
9 vector[N] log_weight;
10 vector[N] log_canopy_volume;
11 log_weight = log(weight);
12 log_canopy_volume = log(diam1 .* diam2 .* canopy_height);
13}
14parameters {
15 vector[2] beta;
16 real<lower=0> sigma;
17}
18model {
19 log_weight ~ normal(beta[1] + beta[2] * log_canopy_volume, sigma);
20}
21
22//@ DATA { N: 46, canopy_height: [46 values], diam1: [46 values], diam2: [46 values], weight: [46 values] } // values supplied at runtime
23//@ PARAMS ["beta[1]","beta[2]","sigma"]
24//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
25
02answer overlay — reference vs stanrecord(beta[1], beta[2], sigma)
beta[1]
reference stan24 bins · 4.88 … 5.51
00.070.070.140.1455.505.13 · 0.1385.15 · 0.142x = 4.88 A = 0.0020 B = 0.0020 Δ = 0.0000x = 4.91 A = 0.0060 B = 0.0000 Δ = 0.0060x = 4.94 A = 0.0000 B = 0.0020 Δ = -0.0020x = 4.96 A = 0.0060 B = 0.0080 Δ = -0.0020x = 4.99 A = 0.0100 B = 0.0140 Δ = -0.0040x = 5.02 A = 0.0280 B = 0.0220 Δ = 0.0060x = 5.04 A = 0.0360 B = 0.0520 Δ = -0.0160x = 5.07 A = 0.0560 B = 0.0680 Δ = -0.0120x = 5.10 A = 0.0940 B = 0.0880 Δ = 0.0060x = 5.13 A = 0.1380 B = 0.1220 Δ = 0.0160x = 5.15 A = 0.1100 B = 0.1420 Δ = -0.0320x = 5.18 A = 0.1300 B = 0.1120 Δ = 0.0180x = 5.21 A = 0.1320 B = 0.0980 Δ = 0.0340x = 5.24 A = 0.0800 B = 0.1080 Δ = -0.0280x = 5.26 A = 0.0700 B = 0.0780 Δ = -0.0080x = 5.29 A = 0.0360 B = 0.0460 Δ = -0.0100x = 5.32 A = 0.0360 B = 0.0140 Δ = 0.0220x = 5.34 A = 0.0140 B = 0.0140 Δ = 0.0000x = 5.37 A = 0.0080 B = 0.0040 Δ = 0.0040x = 5.40 A = 0.0020 B = 0.0020 Δ = 0.0000x = 5.43 A = 0.0040 B = 0.0020 Δ = 0.0020x = 5.45 A = 0.0000 B = 0.0000 Δ = 0.0000x = 5.48 A = 0.0000 B = 0.0020 Δ = -0.0020x = 5.51 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[2]
reference stan24 bins · 0.53 … 0.90
00.070.070.130.130.600.800.75 · 0.1220.74 · 0.132x = 0.53 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.55 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.56 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.58 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.59 A = 0.0140 B = 0.0060 Δ = 0.0080x = 0.61 A = 0.0120 B = 0.0120 Δ = 0.0000x = 0.63 A = 0.0160 B = 0.0260 Δ = -0.0100x = 0.64 A = 0.0560 B = 0.0340 Δ = 0.0220x = 0.66 A = 0.0600 B = 0.0640 Δ = -0.0040x = 0.67 A = 0.0660 B = 0.0740 Δ = -0.0080x = 0.69 A = 0.0860 B = 0.0860 Δ = 0.0000x = 0.70 A = 0.1060 B = 0.1000 Δ = 0.0060x = 0.72 A = 0.1080 B = 0.1120 Δ = -0.0040x = 0.74 A = 0.1020 B = 0.1320 Δ = -0.0300x = 0.75 A = 0.1220 B = 0.1080 Δ = 0.0140x = 0.77 A = 0.0900 B = 0.0900 Δ = -0.0000x = 0.78 A = 0.0560 B = 0.0600 Δ = -0.0040x = 0.80 A = 0.0360 B = 0.0480 Δ = -0.0120x = 0.82 A = 0.0360 B = 0.0280 Δ = 0.0080x = 0.83 A = 0.0100 B = 0.0120 Δ = -0.0020x = 0.85 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.86 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.88 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.90 A = 0.0020 B = 0.0040 Δ = -0.0020
sigma
reference stan24 bins · 0.33 … 0.65
00.070.070.130.130.400.600.43 · 0.1300.41 · 0.120x = 0.33 A = 0.0120 B = 0.0120 Δ = 0.0000x = 0.34 A = 0.0400 B = 0.0180 Δ = 0.0220x = 0.36 A = 0.0620 B = 0.0440 Δ = 0.0180x = 0.37 A = 0.0760 B = 0.0720 Δ = 0.0040x = 0.39 A = 0.0720 B = 0.0940 Δ = -0.0220x = 0.40 A = 0.1240 B = 0.1160 Δ = 0.0080x = 0.41 A = 0.1040 B = 0.1200 Δ = -0.0160x = 0.43 A = 0.1300 B = 0.1020 Δ = 0.0280x = 0.44 A = 0.1000 B = 0.0980 Δ = 0.0020x = 0.46 A = 0.0840 B = 0.0760 Δ = 0.0080x = 0.47 A = 0.0460 B = 0.0900 Δ = -0.0440x = 0.48 A = 0.0500 B = 0.0440 Δ = 0.0060x = 0.50 A = 0.0320 B = 0.0360 Δ = -0.0040x = 0.51 A = 0.0180 B = 0.0260 Δ = -0.0080x = 0.53 A = 0.0180 B = 0.0240 Δ = -0.0060x = 0.54 A = 0.0160 B = 0.0080 Δ = 0.0080x = 0.56 A = 0.0040 B = 0.0100 Δ = -0.0060x = 0.57 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.58 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.60 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.61 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.63 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.64 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.65 A = 0.0020 B = 0.0020 Δ = 0.0000
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0030 ≤ tol 0.0123 · floors 0.0037/0.0050
posteriordb-mesquite / mesquite
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], sigma) stan pass 7.6474
00 statement source: posteriordb/mesquite-mesquite
given

For each of N mesquite trees the data provide measurements of the tree's weight and six predictor variables: two diameter measurements (diam1 and diam2), canopy height, total height, wood density, and a group indicator. The regression has seven coefficients: an intercept and six slopes (one for each predictor). The intercept has a flat improper uniform prior over the real line. Each of the six predictor slopes has a flat improper uniform prior over the real line. The error standard deviation sigma, constrained to be positive, has a flat improper uniform prior over the positive reals.

model

Each tree's weight is Normal-distributed with a mean equal to the intercept plus the sum of six terms, each being a slope coefficient times the corresponding predictor (diam1, diam2, canopy_height, total_height, density, and group), and a common standard deviation sigma across all observations.

query

The marginal posterior distribution of each of the eight parameters: the intercept (reported as beta[1]), the six predictor slopes (reported as beta[2] through beta[7] for diam1, diam2, canopy_height, total_height, density, and group respectively), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization7.647
stan
1data {
2 int<lower=0> N;
3 vector[N] weight;
4 vector[N] diam1;
5 vector[N] diam2;
6 vector[N] canopy_height;
7 vector[N] total_height;
8 vector[N] density;
9 vector[N] group;
10}
11parameters {
12 vector[7] beta;
13 real<lower=0> sigma;
14}
15model {
16 weight ~ normal(beta[1] + beta[2] * diam1 + beta[3] * diam2
17 + beta[4] * canopy_height + beta[5] * total_height
18 + beta[6] * density + beta[7] * group, sigma);
19}
20
21//@ DATA { N: 46, canopy_height: [46 values], density: [46 values], diam1: [46 values], diam2: [46 values], group: [46 values], total_height: [46 values], weight: [46 values] } // values supplied at runtime
22//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","sigma"]
23//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
24
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], sigma)
beta[1]
reference stan24 bins · -1278 … -191
00.070.070.150.15-1000-500-617 · 0.124-758 · 0.148x = -1278 A = 0.0020 B = 0.0000 Δ = 0.0020x = -1231 A = 0.0040 B = 0.0020 Δ = 0.0020x = -1184 A = 0.0040 B = 0.0020 Δ = 0.0020x = -1136 A = 0.0020 B = 0.0000 Δ = 0.0020x = -1089 A = 0.0040 B = 0.0080 Δ = -0.0040x = -1042 A = 0.0180 B = 0.0180 Δ = 0.0000x = -995 A = 0.0300 B = 0.0300 Δ = 0.0000x = -947 A = 0.0440 B = 0.0380 Δ = 0.0060x = -900 A = 0.0560 B = 0.0800 Δ = -0.0240x = -853 A = 0.0800 B = 0.0740 Δ = 0.0060x = -806 A = 0.1180 B = 0.1040 Δ = 0.0140x = -758 A = 0.1100 B = 0.1480 Δ = -0.0380x = -711 A = 0.1080 B = 0.1200 Δ = -0.0120x = -664 A = 0.1180 B = 0.1160 Δ = 0.0020x = -617 A = 0.1240 B = 0.0840 Δ = 0.0400x = -569 A = 0.0620 B = 0.0540 Δ = 0.0080x = -522 A = 0.0480 B = 0.0560 Δ = -0.0080x = -475 A = 0.0220 B = 0.0320 Δ = -0.0100x = -428 A = 0.0260 B = 0.0180 Δ = 0.0080x = -380 A = 0.0080 B = 0.0040 Δ = 0.0040x = -333 A = 0.0080 B = 0.0020 Δ = 0.0060x = -286 A = 0.0040 B = 0.0080 Δ = -0.0040x = -239 A = 0.0000 B = 0.0000 Δ = 0.0000x = -191 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[2]
reference stan24 bins · -213 … 643
00.070.070.140.140500196 · 0.126196 · 0.136x = -213 A = 0.0020 B = 0.0000 Δ = 0.0020x = -176 A = 0.0000 B = 0.0020 Δ = -0.0020x = -139 A = 0.0040 B = 0.0060 Δ = -0.0020x = -102 A = 0.0040 B = 0.0060 Δ = -0.0020x = -64.2 A = 0.0040 B = 0.0160 Δ = -0.0120x = -27 A = 0.0380 B = 0.0280 Δ = 0.0100x = 10.2 A = 0.0320 B = 0.0320 Δ = 0.0000x = 47.4 A = 0.0640 B = 0.0420 Δ = 0.0220x = 84.6 A = 0.0780 B = 0.0940 Δ = -0.0160x = 122 A = 0.1040 B = 0.0960 Δ = 0.0080x = 159 A = 0.1180 B = 0.1120 Δ = 0.0060x = 196 A = 0.1260 B = 0.1360 Δ = -0.0100x = 234 A = 0.1160 B = 0.1000 Δ = 0.0160x = 271 A = 0.0920 B = 0.0960 Δ = -0.0040x = 308 A = 0.0740 B = 0.0860 Δ = -0.0120x = 345 A = 0.0420 B = 0.0620 Δ = -0.0200x = 382 A = 0.0600 B = 0.0460 Δ = 0.0140x = 420 A = 0.0200 B = 0.0220 Δ = -0.0020x = 457 A = 0.0160 B = 0.0100 Δ = 0.0060x = 494 A = 0.0020 B = 0.0040 Δ = -0.0020x = 531 A = 0.0020 B = 0.0000 Δ = 0.0020x = 568 A = 0.0000 B = 0.0000 Δ = 0.0000x = 606 A = 0.0000 B = 0.0040 Δ = -0.0040x = 643 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[3]
reference stan24 bins · -22.3 … 828
00.070.070.140.140500347 · 0.132384 · 0.140x = -22.3 A = 0.0020 B = 0.0040 Δ = -0.0020x = 14.7 A = 0.0060 B = 0.0020 Δ = 0.0040x = 51.6 A = 0.0060 B = 0.0040 Δ = 0.0020x = 88.6 A = 0.0100 B = 0.0280 Δ = -0.0180x = 126 A = 0.0220 B = 0.0380 Δ = -0.0160x = 163 A = 0.0380 B = 0.0240 Δ = 0.0140x = 200 A = 0.0440 B = 0.0580 Δ = -0.0140x = 236 A = 0.0640 B = 0.0600 Δ = 0.0040x = 273 A = 0.0740 B = 0.0620 Δ = 0.0120x = 310 A = 0.0880 B = 0.1020 Δ = -0.0140x = 347 A = 0.1320 B = 0.1180 Δ = 0.0140x = 384 A = 0.1120 B = 0.1400 Δ = -0.0280x = 421 A = 0.0900 B = 0.0940 Δ = -0.0040x = 458 A = 0.1040 B = 0.0560 Δ = 0.0480x = 495 A = 0.0760 B = 0.0760 Δ = 0.0000x = 532 A = 0.0440 B = 0.0480 Δ = -0.0040x = 569 A = 0.0340 B = 0.0360 Δ = -0.0020x = 606 A = 0.0240 B = 0.0180 Δ = 0.0060x = 643 A = 0.0080 B = 0.0120 Δ = -0.0040x = 680 A = 0.0100 B = 0.0040 Δ = 0.0060x = 717 A = 0.0060 B = 0.0040 Δ = 0.0020x = 754 A = 0.0020 B = 0.0020 Δ = 0.0000x = 791 A = 0.0020 B = 0.0080 Δ = -0.0060x = 828 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[4]
reference stan24 bins · -383 … 1024
00.060.060.110.1101000229 · 0.114229 · 0.114x = -383 A = 0.0020 B = 0.0000 Δ = 0.0020x = -322 A = 0.0020 B = 0.0000 Δ = 0.0020x = -260 A = 0.0000 B = 0.0060 Δ = -0.0060x = -199 A = 0.0060 B = 0.0020 Δ = 0.0040x = -138 A = 0.0080 B = 0.0120 Δ = -0.0040x = -76.8 A = 0.0240 B = 0.0140 Δ = 0.0100x = -15.6 A = 0.0340 B = 0.0280 Δ = 0.0060x = 45.6 A = 0.0380 B = 0.0440 Δ = -0.0060x = 107 A = 0.0600 B = 0.0600 Δ = 0.0000x = 168 A = 0.0700 B = 0.0720 Δ = -0.0020x = 229 A = 0.1140 B = 0.1140 Δ = 0.0000x = 290 A = 0.1080 B = 0.1000 Δ = 0.0080x = 351 A = 0.1000 B = 0.1020 Δ = -0.0020x = 413 A = 0.1080 B = 0.1140 Δ = -0.0060x = 474 A = 0.0880 B = 0.0740 Δ = 0.0140x = 535 A = 0.0740 B = 0.0820 Δ = -0.0080x = 596 A = 0.0600 B = 0.0460 Δ = 0.0140x = 657 A = 0.0520 B = 0.0560 Δ = -0.0040x = 719 A = 0.0260 B = 0.0220 Δ = 0.0040x = 780 A = 0.0120 B = 0.0340 Δ = -0.0220x = 841 A = 0.0080 B = 0.0080 Δ = 0.0000x = 902 A = 0.0040 B = 0.0080 Δ = -0.0040x = 963 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1024 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[5]
reference stan24 bins · -875 … 455
00.070.070.140.14-5000-181 · 0.138-181 · 0.116x = -875 A = 0.0000 B = 0.0020 Δ = -0.0020x = -818 A = 0.0000 B = 0.0000 Δ = 0.0000x = -760 A = 0.0000 B = 0.0000 Δ = 0.0000x = -702 A = 0.0020 B = 0.0020 Δ = 0.0000x = -644 A = 0.0020 B = 0.0060 Δ = -0.0040x = -586 A = 0.0060 B = 0.0060 Δ = 0.0000x = -528 A = 0.0060 B = 0.0080 Δ = -0.0020x = -470 A = 0.0200 B = 0.0140 Δ = 0.0060x = -413 A = 0.0300 B = 0.0420 Δ = -0.0120x = -355 A = 0.0460 B = 0.0260 Δ = 0.0200x = -297 A = 0.0640 B = 0.0800 Δ = -0.0160x = -239 A = 0.1080 B = 0.0960 Δ = 0.0120x = -181 A = 0.1380 B = 0.1160 Δ = 0.0220x = -123 A = 0.1160 B = 0.1040 Δ = 0.0120x = -65.4 A = 0.1160 B = 0.1160 Δ = 0.0000x = -7.60 A = 0.0960 B = 0.1020 Δ = -0.0060x = 50.3 A = 0.0860 B = 0.0940 Δ = -0.0080x = 108 A = 0.0460 B = 0.0780 Δ = -0.0320x = 166 A = 0.0540 B = 0.0380 Δ = 0.0160x = 224 A = 0.0320 B = 0.0360 Δ = -0.0040x = 282 A = 0.0160 B = 0.0180 Δ = -0.0020x = 340 A = 0.0100 B = 0.0060 Δ = 0.0040x = 397 A = 0.0040 B = 0.0080 Δ = -0.0040x = 455 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[6]
reference stan24 bins · -10.8 … 233
00.060.060.120.120100200148 · 0.120138 · 0.122x = -10.8 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.20 A = 0.0000 B = 0.0000 Δ = 0.0000x = 10.4 A = 0.0000 B = 0.0000 Δ = 0.0000x = 21 A = 0.0020 B = 0.0000 Δ = 0.0020x = 31.7 A = 0.0020 B = 0.0040 Δ = -0.0020x = 42.3 A = 0.0100 B = 0.0100 Δ = 0.0000x = 52.9 A = 0.0100 B = 0.0180 Δ = -0.0080x = 63.5 A = 0.0120 B = 0.0200 Δ = -0.0080x = 74.1 A = 0.0340 B = 0.0340 Δ = 0.0000x = 84.7 A = 0.0360 B = 0.0420 Δ = -0.0060x = 95.3 A = 0.0760 B = 0.0920 Δ = -0.0160x = 106 A = 0.1020 B = 0.0960 Δ = 0.0060x = 117 A = 0.1080 B = 0.1140 Δ = -0.0060x = 127 A = 0.1140 B = 0.1120 Δ = 0.0020x = 138 A = 0.0980 B = 0.1220 Δ = -0.0240x = 148 A = 0.1200 B = 0.0920 Δ = 0.0280x = 159 A = 0.0720 B = 0.0880 Δ = -0.0160x = 170 A = 0.0760 B = 0.0460 Δ = 0.0300x = 180 A = 0.0560 B = 0.0520 Δ = 0.0040x = 191 A = 0.0260 B = 0.0180 Δ = 0.0080x = 201 A = 0.0220 B = 0.0160 Δ = 0.0060x = 212 A = 0.0160 B = 0.0180 Δ = -0.0020x = 223 A = 0.0000 B = 0.0020 Δ = -0.0020x = 233 A = 0.0060 B = 0.0040 Δ = 0.0020
beta[7]
reference stan24 bins · -814 … -93.6
00.080.080.150.15-500-344 · 0.154-407 · 0.116x = -814 A = 0.0000 B = 0.0020 Δ = -0.0020x = -783 A = 0.0000 B = 0.0000 Δ = 0.0000x = -751 A = 0.0000 B = 0.0000 Δ = 0.0000x = -720 A = 0.0020 B = 0.0000 Δ = 0.0020x = -689 A = 0.0020 B = 0.0000 Δ = 0.0020x = -657 A = 0.0020 B = 0.0000 Δ = 0.0020x = -626 A = 0.0040 B = 0.0040 Δ = 0.0000x = -595 A = 0.0040 B = 0.0080 Δ = -0.0040x = -563 A = 0.0160 B = 0.0100 Δ = 0.0060x = -532 A = 0.0300 B = 0.0300 Δ = 0.0000x = -501 A = 0.0520 B = 0.0400 Δ = 0.0120x = -469 A = 0.0520 B = 0.0760 Δ = -0.0240x = -438 A = 0.0920 B = 0.1080 Δ = -0.0160x = -407 A = 0.0980 B = 0.1160 Δ = -0.0180x = -375 A = 0.1220 B = 0.0980 Δ = 0.0240x = -344 A = 0.1540 B = 0.1060 Δ = 0.0480x = -313 A = 0.1120 B = 0.1060 Δ = 0.0060x = -282 A = 0.0980 B = 0.1000 Δ = -0.0020x = -250 A = 0.0620 B = 0.0700 Δ = -0.0080x = -219 A = 0.0400 B = 0.0600 Δ = -0.0200x = -188 A = 0.0340 B = 0.0460 Δ = -0.0120x = -156 A = 0.0120 B = 0.0080 Δ = 0.0040x = -125 A = 0.0080 B = 0.0080 Δ = 0.0000x = -93.6 A = 0.0040 B = 0.0040 Δ = 0.0000
sigma
reference stan24 bins · 208 … 441
00.070.070.130.13300400278 · 0.132268 · 0.134x = 208 A = 0.0060 B = 0.0040 Δ = 0.0020x = 218 A = 0.0180 B = 0.0040 Δ = 0.0140x = 228 A = 0.0360 B = 0.0540 Δ = -0.0180x = 238 A = 0.0800 B = 0.0680 Δ = 0.0120x = 248 A = 0.0900 B = 0.1160 Δ = -0.0260x = 258 A = 0.1260 B = 0.1180 Δ = 0.0080x = 268 A = 0.1300 B = 0.1340 Δ = -0.0040x = 278 A = 0.1320 B = 0.1260 Δ = 0.0060x = 289 A = 0.1000 B = 0.0940 Δ = 0.0060x = 299 A = 0.0880 B = 0.0900 Δ = -0.0020x = 309 A = 0.0560 B = 0.0480 Δ = 0.0080x = 319 A = 0.0500 B = 0.0480 Δ = 0.0020x = 329 A = 0.0460 B = 0.0360 Δ = 0.0100x = 339 A = 0.0240 B = 0.0200 Δ = 0.0040x = 349 A = 0.0040 B = 0.0160 Δ = -0.0120x = 360 A = 0.0060 B = 0.0080 Δ = -0.0020x = 370 A = 0.0020 B = 0.0080 Δ = -0.0060x = 380 A = 0.0020 B = 0.0040 Δ = -0.0020x = 390 A = 0.0020 B = 0.0000 Δ = 0.0020x = 400 A = 0.0020 B = 0.0020 Δ = 0.0000x = 410 A = 0.0000 B = 0.0000 Δ = 0.0000x = 420 A = 0.0000 B = 0.0000 Δ = 0.0000x = 430 A = 0.0000 B = 0.0000 Δ = 0.0000x = 441 A = 0.0000 B = 0.0020 Δ = -0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=7.6474 ≤ tol 29.6690 · floors 9.2119/14.1346
posteriordb-nes1972 / nes
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma) stan pass 0.0204
00 statement source: posteriordb/nes1972-nes
given

For N = 1330 respondents, the data provide party identification score (partyid7), measured on a 7-point ordinal scale; self-reported ideology rating (real_ideo); race coding (race_adj); education level (educ1); gender (gender); income level (income); and age group (age_discrete, coded 1 = under 30, 2 = 30 to 44, 3 = 45 to 64, 4 = 65 and over). The model constructs three dummy variables for age groups: age30_44 (equals 1 if age_discrete = 2, else 0), age45_64 (equals 1 if age_discrete = 3, else 0), and age65up (equals 1 if age_discrete = 4, else 0), with the under-30 group as the reference category. The regression has nine coefficients (intercept and eight slopes), each with a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each respondent's party identification score is normally distributed with a mean equal to the intercept plus slopes for ideology, race, the three age-group dummy variables, education, gender, and income, each multiplied by the corresponding predictor value. The standard deviation of this normal distribution is sigma, common across all respondents.

query

The marginal posterior distributions of the nine parameters: the intercept (reported as beta[1]), the ideology slope (beta[2]), the race slope (beta[3]), the slope for age 30-44 (beta[4]), the slope for age 45-64 (beta[5]), the slope for age 65 and over (beta[6]), the education slope (beta[7]), the gender slope (beta[8]), the income slope (beta[9]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.020
stan
1data {
2 int<lower=0> N;
3 vector[N] partyid7;
4 vector[N] real_ideo;
5 vector[N] race_adj;
6 vector[N] educ1;
7 vector[N] gender;
8 vector[N] income;
9 array[N] int age_discrete;
10}
11transformed data {
12 vector[N] age30_44; // age as factor
13 vector[N] age45_64;
14 vector[N] age65up;
15
16 for (n in 1 : N) {
17 age30_44[n] = age_discrete[n] == 2;
18 age45_64[n] = age_discrete[n] == 3;
19 age65up[n] = age_discrete[n] == 4;
20 }
21}
22parameters {
23 vector[9] beta;
24 real<lower=0> sigma;
25}
26model {
27 // vectorization
28 partyid7 ~ normal(beta[1] + beta[2] * real_ideo + beta[3] * race_adj
29 + beta[4] * age30_44 + beta[5] * age45_64
30 + beta[6] * age65up + beta[7] * educ1 + beta[8] * gender
31 + beta[9] * income, sigma);
32}
33
34//@ DATA { N: 1330, age_discrete: [1330 values], educ1: [1330 values], gender: [1330 values], income: [1330 values], partyid7: [1330 values], race_adj: [1330 values], real_ideo: [1330 values] } // values supplied at runtime
35//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","beta[8]","beta[9]","sigma"]
36//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
37
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
beta[1]
reference stan24 bins · 0.58 … 2.79
00.060.060.120.12121.73 · 0.1181.64 · 0.096x = 0.58 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.67 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.77 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.87 A = 0.0100 B = 0.0040 Δ = 0.0060x = 0.96 A = 0.0160 B = 0.0180 Δ = -0.0020x = 1.06 A = 0.0220 B = 0.0160 Δ = 0.0060x = 1.15 A = 0.0360 B = 0.0520 Δ = -0.0160x = 1.25 A = 0.0360 B = 0.0520 Δ = -0.0160x = 1.35 A = 0.0680 B = 0.0540 Δ = 0.0140x = 1.44 A = 0.0840 B = 0.0800 Δ = 0.0040x = 1.54 A = 0.0780 B = 0.0900 Δ = -0.0120x = 1.64 A = 0.0860 B = 0.0960 Δ = -0.0100x = 1.73 A = 0.1180 B = 0.0840 Δ = 0.0340x = 1.83 A = 0.0720 B = 0.0880 Δ = -0.0160x = 1.92 A = 0.0720 B = 0.0740 Δ = -0.0020x = 2.02 A = 0.0840 B = 0.0680 Δ = 0.0160x = 2.12 A = 0.0600 B = 0.0460 Δ = 0.0140x = 2.21 A = 0.0420 B = 0.0580 Δ = -0.0160x = 2.31 A = 0.0440 B = 0.0460 Δ = -0.0020x = 2.40 A = 0.0200 B = 0.0240 Δ = -0.0040x = 2.50 A = 0.0200 B = 0.0220 Δ = -0.0020x = 2.60 A = 0.0100 B = 0.0120 Δ = -0.0020x = 2.69 A = 0.0020 B = 0.0020 Δ = 0.0000x = 2.79 A = 0.0080 B = 0.0040 Δ = 0.0040
beta[2]
reference stan24 bins · 0.36 … 0.63
00.060.060.110.110.400.500.600.50 · 0.1120.49 · 0.112x = 0.36 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.38 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.39 A = 0.0060 B = 0.0100 Δ = -0.0040x = 0.40 A = 0.0120 B = 0.0140 Δ = -0.0020x = 0.41 A = 0.0100 B = 0.0180 Δ = -0.0080x = 0.42 A = 0.0420 B = 0.0260 Δ = 0.0160x = 0.43 A = 0.0520 B = 0.0520 Δ = -0.0000x = 0.45 A = 0.0540 B = 0.0780 Δ = -0.0240x = 0.46 A = 0.0760 B = 0.0800 Δ = -0.0040x = 0.47 A = 0.0980 B = 0.0880 Δ = 0.0100x = 0.48 A = 0.1080 B = 0.1080 Δ = -0.0000x = 0.49 A = 0.0980 B = 0.1120 Δ = -0.0140x = 0.50 A = 0.1120 B = 0.0900 Δ = 0.0220x = 0.51 A = 0.1000 B = 0.1000 Δ = 0.0000x = 0.53 A = 0.0780 B = 0.0760 Δ = 0.0020x = 0.54 A = 0.0620 B = 0.0480 Δ = 0.0140x = 0.55 A = 0.0380 B = 0.0340 Δ = 0.0040x = 0.56 A = 0.0180 B = 0.0300 Δ = -0.0120x = 0.57 A = 0.0160 B = 0.0140 Δ = 0.0020x = 0.58 A = 0.0100 B = 0.0160 Δ = -0.0060x = 0.59 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.61 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.62 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.63 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[3]
reference stan24 bins · -1.70 … -0.53
00.060.060.130.13-1.50-1-1.09 · 0.128-1.03 · 0.128x = -1.70 A = 0.0000 B = 0.0040 Δ = -0.0040x = -1.64 A = 0.0020 B = 0.0040 Δ = -0.0020x = -1.59 A = 0.0020 B = 0.0000 Δ = 0.0020x = -1.54 A = 0.0020 B = 0.0000 Δ = 0.0020x = -1.49 A = 0.0220 B = 0.0180 Δ = 0.0040x = -1.44 A = 0.0200 B = 0.0280 Δ = -0.0080x = -1.39 A = 0.0280 B = 0.0420 Δ = -0.0140x = -1.34 A = 0.0400 B = 0.0480 Δ = -0.0080x = -1.29 A = 0.0800 B = 0.0660 Δ = 0.0140x = -1.24 A = 0.0820 B = 0.0980 Δ = -0.0160x = -1.19 A = 0.0960 B = 0.0760 Δ = 0.0200x = -1.14 A = 0.0800 B = 0.0840 Δ = -0.0040x = -1.09 A = 0.1280 B = 0.1100 Δ = 0.0180x = -1.03 A = 0.0860 B = 0.1280 Δ = -0.0420x = -0.98 A = 0.0920 B = 0.0540 Δ = 0.0380x = -0.93 A = 0.0480 B = 0.0640 Δ = -0.0160x = -0.88 A = 0.0820 B = 0.0580 Δ = 0.0240x = -0.83 A = 0.0440 B = 0.0560 Δ = -0.0120x = -0.78 A = 0.0320 B = 0.0200 Δ = 0.0120x = -0.73 A = 0.0200 B = 0.0160 Δ = 0.0040x = -0.68 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.63 A = 0.0060 B = 0.0140 Δ = -0.0080x = -0.58 A = 0.0000 B = 0.0080 Δ = -0.0080x = -0.53 A = 0.0040 B = 0.0020 Δ = 0.0020
beta[4]
reference stan24 bins · -0.59 … 0.23
00.060.060.120.12-0.500-0.20 · 0.096-0.16 · 0.124x = -0.59 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.55 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.52 A = 0.0040 B = 0.0140 Δ = -0.0100x = -0.48 A = 0.0120 B = 0.0120 Δ = 0.0000x = -0.45 A = 0.0240 B = 0.0260 Δ = -0.0020x = -0.41 A = 0.0500 B = 0.0280 Δ = 0.0220x = -0.38 A = 0.0400 B = 0.0500 Δ = -0.0100x = -0.34 A = 0.0540 B = 0.0760 Δ = -0.0220x = -0.30 A = 0.0840 B = 0.0580 Δ = 0.0260x = -0.27 A = 0.0920 B = 0.0760 Δ = 0.0160x = -0.23 A = 0.0880 B = 0.0900 Δ = -0.0020x = -0.20 A = 0.0960 B = 0.1000 Δ = -0.0040x = -0.16 A = 0.0560 B = 0.1240 Δ = -0.0680x = -0.13 A = 0.0860 B = 0.0680 Δ = 0.0180x = -0.09 A = 0.0940 B = 0.0760 Δ = 0.0180x = -0.06 A = 0.0720 B = 0.0620 Δ = 0.0100x = -0.02 A = 0.0480 B = 0.0420 Δ = 0.0060x = 0.01 A = 0.0280 B = 0.0360 Δ = -0.0080x = 0.05 A = 0.0180 B = 0.0240 Δ = -0.0060x = 0.09 A = 0.0160 B = 0.0160 Δ = 0.0000x = 0.12 A = 0.0140 B = 0.0120 Δ = 0.0020x = 0.16 A = 0.0120 B = 0.0040 Δ = 0.0080x = 0.19 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.23 A = 0.0040 B = 0.0000 Δ = 0.0040
beta[5]
reference stan24 bins · -0.43 … 0.36
00.060.060.120.120-0.06 · 0.1180.01 · 0.104x = -0.43 A = 0.0020 B = 0.0100 Δ = -0.0080x = -0.40 A = 0.0040 B = 0.0060 Δ = -0.0020x = -0.36 A = 0.0080 B = 0.0040 Δ = 0.0040x = -0.33 A = 0.0060 B = 0.0100 Δ = -0.0040x = -0.30 A = 0.0160 B = 0.0240 Δ = -0.0080x = -0.26 A = 0.0480 B = 0.0300 Δ = 0.0180x = -0.23 A = 0.0520 B = 0.0500 Δ = 0.0020x = -0.19 A = 0.0580 B = 0.0640 Δ = -0.0060x = -0.16 A = 0.0600 B = 0.0640 Δ = -0.0040x = -0.12 A = 0.1020 B = 0.0820 Δ = 0.0200x = -0.09 A = 0.0820 B = 0.0900 Δ = -0.0080x = -0.06 A = 0.1180 B = 0.0840 Δ = 0.0340x = -0.02 A = 0.1080 B = 0.0940 Δ = 0.0140x = 0.01 A = 0.0840 B = 0.1040 Δ = -0.0200x = 0.05 A = 0.0620 B = 0.0680 Δ = -0.0060x = 0.08 A = 0.0620 B = 0.0660 Δ = -0.0040x = 0.12 A = 0.0280 B = 0.0640 Δ = -0.0360x = 0.15 A = 0.0300 B = 0.0420 Δ = -0.0120x = 0.19 A = 0.0240 B = 0.0120 Δ = 0.0120x = 0.22 A = 0.0240 B = 0.0140 Δ = 0.0100x = 0.26 A = 0.0120 B = 0.0100 Δ = 0.0020x = 0.29 A = 0.0100 B = 0.0020 Δ = 0.0080x = 0.32 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.36 A = 0.0000 B = 0.0040 Δ = -0.0040
beta[6]
reference stan24 bins · -0.02 … 1.09
00.060.060.120.1200.5010.46 · 0.1100.56 · 0.118x = -0.02 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.03 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.07 A = 0.0040 B = 0.0180 Δ = -0.0140x = 0.12 A = 0.0200 B = 0.0200 Δ = 0.0000x = 0.17 A = 0.0140 B = 0.0200 Δ = -0.0060x = 0.22 A = 0.0140 B = 0.0320 Δ = -0.0180x = 0.27 A = 0.0320 B = 0.0440 Δ = -0.0120x = 0.32 A = 0.0660 B = 0.0600 Δ = 0.0060x = 0.36 A = 0.0980 B = 0.0820 Δ = 0.0160x = 0.41 A = 0.0860 B = 0.0740 Δ = 0.0120x = 0.46 A = 0.1100 B = 0.0840 Δ = 0.0260x = 0.51 A = 0.0940 B = 0.0960 Δ = -0.0020x = 0.56 A = 0.1000 B = 0.1180 Δ = -0.0180x = 0.61 A = 0.0940 B = 0.1020 Δ = -0.0080x = 0.66 A = 0.0700 B = 0.0700 Δ = 0.0000x = 0.71 A = 0.0760 B = 0.0460 Δ = 0.0300x = 0.75 A = 0.0420 B = 0.0500 Δ = -0.0080x = 0.80 A = 0.0320 B = 0.0240 Δ = 0.0080x = 0.85 A = 0.0100 B = 0.0260 Δ = -0.0160x = 0.90 A = 0.0160 B = 0.0100 Δ = 0.0060x = 0.95 A = 0.0060 B = 0.0040 Δ = 0.0020x = 1.00 A = 0.0040 B = 0.0080 Δ = -0.0040x = 1.05 A = 0.0040 B = 0.0000 Δ = 0.0040x = 1.09 A = 0.0040 B = 0.0000 Δ = 0.0040
beta[7]
reference stan24 bins · 0.11 … 0.50
00.060.060.120.120.200.400.28 · 0.1100.30 · 0.124x = 0.11 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.13 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.15 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.17 A = 0.0120 B = 0.0080 Δ = 0.0040x = 0.18 A = 0.0180 B = 0.0140 Δ = 0.0040x = 0.20 A = 0.0420 B = 0.0360 Δ = 0.0060x = 0.21 A = 0.0560 B = 0.0320 Δ = 0.0240x = 0.23 A = 0.0460 B = 0.0680 Δ = -0.0220x = 0.25 A = 0.0900 B = 0.0640 Δ = 0.0260x = 0.27 A = 0.0720 B = 0.0880 Δ = -0.0160x = 0.28 A = 0.1100 B = 0.1200 Δ = -0.0100x = 0.30 A = 0.1060 B = 0.1240 Δ = -0.0180x = 0.32 A = 0.1060 B = 0.1160 Δ = -0.0100x = 0.33 A = 0.0840 B = 0.0840 Δ = 0.0000x = 0.35 A = 0.0860 B = 0.0740 Δ = 0.0120x = 0.37 A = 0.0560 B = 0.0500 Δ = 0.0060x = 0.38 A = 0.0500 B = 0.0380 Δ = 0.0120x = 0.40 A = 0.0280 B = 0.0320 Δ = -0.0040x = 0.42 A = 0.0220 B = 0.0240 Δ = -0.0020x = 0.43 A = 0.0060 B = 0.0120 Δ = -0.0060x = 0.45 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.47 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.48 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.50 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[8]
reference stan24 bins · -0.41 … 0.32
00.070.070.140.1400 · 0.1400.06 · 0.116x = -0.41 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.38 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.35 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.32 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.28 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.25 A = 0.0080 B = 0.0020 Δ = 0.0060x = -0.22 A = 0.0080 B = 0.0100 Δ = -0.0020x = -0.19 A = 0.0220 B = 0.0240 Δ = -0.0020x = -0.16 A = 0.0320 B = 0.0460 Δ = -0.0140x = -0.13 A = 0.0620 B = 0.0540 Δ = 0.0080x = -0.09 A = 0.0840 B = 0.0840 Δ = -0.0000x = -0.06 A = 0.1360 B = 0.0960 Δ = 0.0400x = -0.03 A = 0.1140 B = 0.1000 Δ = 0.0140x = 0 A = 0.1400 B = 0.1060 Δ = 0.0340x = 0.03 A = 0.0960 B = 0.1100 Δ = -0.0140x = 0.06 A = 0.0960 B = 0.1160 Δ = -0.0200x = 0.10 A = 0.0680 B = 0.0740 Δ = -0.0060x = 0.13 A = 0.0540 B = 0.0740 Δ = -0.0200x = 0.16 A = 0.0260 B = 0.0400 Δ = -0.0140x = 0.19 A = 0.0200 B = 0.0280 Δ = -0.0080x = 0.22 A = 0.0160 B = 0.0160 Δ = 0.0000x = 0.25 A = 0.0020 B = 0.0080 Δ = -0.0060x = 0.28 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.32 A = 0.0060 B = 0.0040 Δ = 0.0020
beta[9]
reference stan24 bins · 0.01 … 0.33
00.060.060.110.110.200.17 · 0.1120.17 · 0.114x = 0.01 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.02 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.04 A = 0.0040 B = 0.0120 Δ = -0.0080x = 0.05 A = 0.0120 B = 0.0080 Δ = 0.0040x = 0.07 A = 0.0180 B = 0.0140 Δ = 0.0040x = 0.08 A = 0.0240 B = 0.0220 Δ = 0.0020x = 0.09 A = 0.0380 B = 0.0540 Δ = -0.0160x = 0.11 A = 0.0700 B = 0.0520 Δ = 0.0180x = 0.12 A = 0.0900 B = 0.0640 Δ = 0.0260x = 0.13 A = 0.0900 B = 0.0820 Δ = 0.0080x = 0.15 A = 0.0840 B = 0.0980 Δ = -0.0140x = 0.16 A = 0.0900 B = 0.1080 Δ = -0.0180x = 0.17 A = 0.1120 B = 0.1140 Δ = -0.0020x = 0.19 A = 0.0920 B = 0.0900 Δ = 0.0020x = 0.20 A = 0.0700 B = 0.0860 Δ = -0.0160x = 0.22 A = 0.0680 B = 0.0500 Δ = 0.0180x = 0.23 A = 0.0540 B = 0.0560 Δ = -0.0020x = 0.24 A = 0.0320 B = 0.0280 Δ = 0.0040x = 0.26 A = 0.0200 B = 0.0220 Δ = -0.0020x = 0.27 A = 0.0120 B = 0.0200 Δ = -0.0080x = 0.28 A = 0.0080 B = 0.0040 Δ = 0.0040x = 0.30 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.31 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.33 A = 0.0000 B = 0.0020 Δ = -0.0020
sigma
reference stan24 bins · 1.78 … 2.00
00.060.060.120.121.801.901.87 · 0.1221.88 · 0.098x = 1.78 A = 0.0060 B = 0.0020 Δ = 0.0040x = 1.79 A = 0.0020 B = 0.0080 Δ = -0.0060x = 1.80 A = 0.0080 B = 0.0020 Δ = 0.0060x = 1.81 A = 0.0080 B = 0.0160 Δ = -0.0080x = 1.82 A = 0.0220 B = 0.0240 Δ = -0.0020x = 1.82 A = 0.0280 B = 0.0240 Δ = 0.0040x = 1.83 A = 0.0420 B = 0.0360 Δ = 0.0060x = 1.84 A = 0.0500 B = 0.0680 Δ = -0.0180x = 1.85 A = 0.0860 B = 0.0840 Δ = 0.0020x = 1.86 A = 0.0940 B = 0.0980 Δ = -0.0040x = 1.87 A = 0.1220 B = 0.0900 Δ = 0.0320x = 1.88 A = 0.0980 B = 0.0980 Δ = -0.0000x = 1.89 A = 0.1040 B = 0.0960 Δ = 0.0080x = 1.90 A = 0.0860 B = 0.0960 Δ = -0.0100x = 1.91 A = 0.0680 B = 0.0640 Δ = 0.0040x = 1.92 A = 0.0540 B = 0.0580 Δ = -0.0040x = 1.93 A = 0.0340 B = 0.0500 Δ = -0.0160x = 1.94 A = 0.0400 B = 0.0400 Δ = 0.0000x = 1.95 A = 0.0200 B = 0.0120 Δ = 0.0080x = 1.96 A = 0.0120 B = 0.0100 Δ = 0.0020x = 1.97 A = 0.0060 B = 0.0100 Δ = -0.0040x = 1.98 A = 0.0040 B = 0.0060 Δ = -0.0020x = 1.99 A = 0.0040 B = 0.0040 Δ = 0.0000x = 2.00 A = 0.0020 B = 0.0040 Δ = -0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0204 ≤ tol 0.0745 · floors 0.0372/0.0286
posteriordb-nes1976 / nes
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma) stan pass 0.0131
00 statement source: posteriordb/nes1976-nes
given

For each of N = 1184 respondents, the data provide a party identification measure on a 7-point scale (partyid7), five continuous predictors (ideological self-placement, adjusted race, education level, gender, and income), and a categorical age variable with four levels. The regression has nine coefficients: an intercept and eight slopes (for ideological self-placement, adjusted race, three binary indicators for age categories 30-44, 45-64, and 65+, education level, gender, and income), each with a flat (improper uniform) prior over the reals. The baseline age category (age under 30) is absorbed into the intercept. The error standard deviation sigma, constrained positive, has an improper uniform prior over the positive reals.

model

Each respondent's party identification is Normal-distributed with a mean equal to a linear combination of an intercept, the respondent's ideological self-placement, adjusted race, three binary indicators for age categories (with the baseline category under 30 absorbed into the intercept), education level, gender, and income, multiplied by their respective slope coefficients. The common standard deviation across all respondents is sigma.

query

The marginal posterior distribution of each of the ten parameters: the intercept (reported as beta[1]), the slope on ideological self-placement (reported as beta[2]), the slope on adjusted race (reported as beta[3]), the slope on the 30-44 age indicator (reported as beta[4]), the slope on the 45-64 age indicator (reported as beta[5]), the slope on the 65+ age indicator (reported as beta[6]), the slope on education level (reported as beta[7]), the slope on gender (reported as beta[8]), the slope on income (reported as beta[9]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.013
stan
1data {
2 int<lower=0> N;
3 vector[N] partyid7;
4 vector[N] real_ideo;
5 vector[N] race_adj;
6 vector[N] educ1;
7 vector[N] gender;
8 vector[N] income;
9 array[N] int age_discrete;
10}
11transformed data {
12 vector[N] age30_44; // age as factor
13 vector[N] age45_64;
14 vector[N] age65up;
15
16 for (n in 1 : N) {
17 age30_44[n] = age_discrete[n] == 2;
18 age45_64[n] = age_discrete[n] == 3;
19 age65up[n] = age_discrete[n] == 4;
20 }
21}
22parameters {
23 vector[9] beta;
24 real<lower=0> sigma;
25}
26model {
27 // vectorization
28 partyid7 ~ normal(beta[1] + beta[2] * real_ideo + beta[3] * race_adj
29 + beta[4] * age30_44 + beta[5] * age45_64
30 + beta[6] * age65up + beta[7] * educ1 + beta[8] * gender
31 + beta[9] * income, sigma);
32}
33
34//@ DATA { N: 1184, age_discrete: [1184 values], educ1: [1184 values], gender: [1184 values], income: [1184 values], partyid7: [1184 values], race_adj: [1184 values], real_ideo: [1184 values] } // values supplied at runtime
35//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","beta[8]","beta[9]","sigma"]
36//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
37
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
beta[1]
reference stan24 bins · -0.47 … 2.24
00.060.060.130.130121.06 · 0.1160.82 · 0.126x = -0.47 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.35 A = 0.0000 B = 0.0060 Δ = -0.0060x = -0.24 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.12 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.12 A = 0.0100 B = 0.0140 Δ = -0.0040x = 0.23 A = 0.0260 B = 0.0240 Δ = 0.0020x = 0.35 A = 0.0440 B = 0.0340 Δ = 0.0100x = 0.47 A = 0.0620 B = 0.0660 Δ = -0.0040x = 0.59 A = 0.0940 B = 0.0640 Δ = 0.0300x = 0.70 A = 0.0780 B = 0.0680 Δ = 0.0100x = 0.82 A = 0.0920 B = 0.1260 Δ = -0.0340x = 0.94 A = 0.1120 B = 0.0840 Δ = 0.0280x = 1.06 A = 0.1160 B = 0.0920 Δ = 0.0240x = 1.18 A = 0.0940 B = 0.0900 Δ = 0.0040x = 1.29 A = 0.0760 B = 0.0860 Δ = -0.0100x = 1.41 A = 0.0700 B = 0.0760 Δ = -0.0060x = 1.53 A = 0.0420 B = 0.0740 Δ = -0.0320x = 1.65 A = 0.0320 B = 0.0280 Δ = 0.0040x = 1.76 A = 0.0120 B = 0.0280 Δ = -0.0160x = 1.88 A = 0.0120 B = 0.0100 Δ = 0.0020x = 2 A = 0.0060 B = 0.0120 Δ = -0.0060x = 2.12 A = 0.0040 B = 0.0040 Δ = 0.0000x = 2.24 A = 0.0080 B = 0.0040 Δ = 0.0040
beta[2]
reference stan24 bins · 0.47 … 0.70
00.060.060.110.110.500.600.60 · 0.1140.60 · 0.096x = 0.47 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.48 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.49 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.50 A = 0.0060 B = 0.0120 Δ = -0.0060x = 0.51 A = 0.0060 B = 0.0180 Δ = -0.0120x = 0.52 A = 0.0240 B = 0.0260 Δ = -0.0020x = 0.53 A = 0.0180 B = 0.0420 Δ = -0.0240x = 0.54 A = 0.0380 B = 0.0480 Δ = -0.0100x = 0.55 A = 0.0520 B = 0.0640 Δ = -0.0120x = 0.56 A = 0.0760 B = 0.0700 Δ = 0.0060x = 0.57 A = 0.1120 B = 0.0820 Δ = 0.0300x = 0.58 A = 0.1020 B = 0.0740 Δ = 0.0280x = 0.59 A = 0.0780 B = 0.0780 Δ = 0.0000x = 0.60 A = 0.1140 B = 0.0960 Δ = 0.0180x = 0.61 A = 0.1060 B = 0.0880 Δ = 0.0180x = 0.62 A = 0.0500 B = 0.0860 Δ = -0.0360x = 0.63 A = 0.0740 B = 0.0680 Δ = 0.0060x = 0.64 A = 0.0320 B = 0.0540 Δ = -0.0220x = 0.65 A = 0.0420 B = 0.0320 Δ = 0.0100x = 0.66 A = 0.0200 B = 0.0220 Δ = -0.0020x = 0.67 A = 0.0160 B = 0.0140 Δ = 0.0020x = 0.68 A = 0.0060 B = 0.0120 Δ = -0.0060x = 0.69 A = 0.0120 B = 0.0040 Δ = 0.0080x = 0.70 A = 0.0080 B = 0.0020 Δ = 0.0060
beta[3]
reference stan24 bins · -1.74 … -0.57
00.060.060.120.12-1.50-1-1.08 · 0.124-1.03 · 0.110x = -1.74 A = 0.0020 B = 0.0000 Δ = 0.0020x = -1.69 A = 0.0000 B = 0.0000 Δ = 0.0000x = -1.64 A = 0.0060 B = 0.0040 Δ = 0.0020x = -1.59 A = 0.0040 B = 0.0020 Δ = 0.0020x = -1.54 A = 0.0060 B = 0.0100 Δ = -0.0040x = -1.49 A = 0.0180 B = 0.0160 Δ = 0.0020x = -1.43 A = 0.0200 B = 0.0240 Δ = -0.0040x = -1.38 A = 0.0540 B = 0.0320 Δ = 0.0220x = -1.33 A = 0.0440 B = 0.0580 Δ = -0.0140x = -1.28 A = 0.0640 B = 0.0820 Δ = -0.0180x = -1.23 A = 0.0800 B = 0.0880 Δ = -0.0080x = -1.18 A = 0.0820 B = 0.1060 Δ = -0.0240x = -1.13 A = 0.0980 B = 0.1100 Δ = -0.0120x = -1.08 A = 0.1240 B = 0.0860 Δ = 0.0380x = -1.03 A = 0.1160 B = 0.1100 Δ = 0.0060x = -0.97 A = 0.0840 B = 0.0660 Δ = 0.0180x = -0.92 A = 0.0620 B = 0.0620 Δ = 0.0000x = -0.87 A = 0.0520 B = 0.0440 Δ = 0.0080x = -0.82 A = 0.0400 B = 0.0460 Δ = -0.0060x = -0.77 A = 0.0220 B = 0.0220 Δ = -0.0000x = -0.72 A = 0.0120 B = 0.0200 Δ = -0.0080x = -0.67 A = 0.0060 B = 0.0060 Δ = 0.0000x = -0.62 A = 0.0000 B = 0.0040 Δ = -0.0040x = -0.57 A = 0.0040 B = 0.0020 Δ = 0.0020
beta[4]
reference stan24 bins · -0.59 … 0.40
00.070.070.150.15-0.500-0.07 · 0.146-0.03 · 0.146x = -0.59 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.55 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.50 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.46 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.42 A = 0.0020 B = 0.0080 Δ = -0.0060x = -0.37 A = 0.0080 B = 0.0100 Δ = -0.0020x = -0.33 A = 0.0180 B = 0.0140 Δ = 0.0040x = -0.29 A = 0.0320 B = 0.0180 Δ = 0.0140x = -0.24 A = 0.0460 B = 0.0380 Δ = 0.0080x = -0.20 A = 0.0640 B = 0.0720 Δ = -0.0080x = -0.16 A = 0.0740 B = 0.0800 Δ = -0.0060x = -0.11 A = 0.0920 B = 0.1040 Δ = -0.0120x = -0.07 A = 0.1460 B = 0.1300 Δ = 0.0160x = -0.03 A = 0.1020 B = 0.1460 Δ = -0.0440x = 0.01 A = 0.1000 B = 0.0800 Δ = 0.0200x = 0.06 A = 0.0880 B = 0.1040 Δ = -0.0160x = 0.10 A = 0.0840 B = 0.0620 Δ = 0.0220x = 0.14 A = 0.0460 B = 0.0560 Δ = -0.0100x = 0.19 A = 0.0500 B = 0.0260 Δ = 0.0240x = 0.23 A = 0.0260 B = 0.0160 Δ = 0.0100x = 0.27 A = 0.0120 B = 0.0140 Δ = -0.0020x = 0.32 A = 0.0060 B = 0.0100 Δ = -0.0040x = 0.36 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.40 A = 0.0000 B = 0.0040 Δ = -0.0040
beta[5]
reference stan24 bins · -0.54 … 0.48
00.080.080.150.15-0.5000.04 · 0.134-0.00 · 0.150x = -0.54 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.49 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.45 A = 0.0020 B = 0.0040 Δ = -0.0020x = -0.40 A = 0.0060 B = 0.0020 Δ = 0.0040x = -0.36 A = 0.0160 B = 0.0180 Δ = -0.0020x = -0.31 A = 0.0280 B = 0.0180 Δ = 0.0100x = -0.27 A = 0.0360 B = 0.0320 Δ = 0.0040x = -0.23 A = 0.0680 B = 0.0680 Δ = 0.0000x = -0.18 A = 0.0780 B = 0.0840 Δ = -0.0060x = -0.14 A = 0.1180 B = 0.1000 Δ = 0.0180x = -0.09 A = 0.1060 B = 0.1200 Δ = -0.0140x = -0.05 A = 0.0900 B = 0.1280 Δ = -0.0380x = -0.00 A = 0.1100 B = 0.1500 Δ = -0.0400x = 0.04 A = 0.1340 B = 0.0800 Δ = 0.0540x = 0.08 A = 0.0760 B = 0.0580 Δ = 0.0180x = 0.13 A = 0.0540 B = 0.0360 Δ = 0.0180x = 0.17 A = 0.0380 B = 0.0480 Δ = -0.0100x = 0.22 A = 0.0280 B = 0.0160 Δ = 0.0120x = 0.26 A = 0.0060 B = 0.0180 Δ = -0.0120x = 0.31 A = 0.0020 B = 0.0120 Δ = -0.0100x = 0.35 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.39 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.44 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.48 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[6]
reference stan24 bins · -0.10 … 1.01
00.070.070.140.1400.5010.43 · 0.1380.48 · 0.108x = -0.10 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.05 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.00 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.04 A = 0.0100 B = 0.0100 Δ = 0.0000x = 0.09 A = 0.0160 B = 0.0080 Δ = 0.0080x = 0.14 A = 0.0260 B = 0.0440 Δ = -0.0180x = 0.19 A = 0.0320 B = 0.0540 Δ = -0.0220x = 0.24 A = 0.0400 B = 0.0440 Δ = -0.0040x = 0.29 A = 0.0600 B = 0.0760 Δ = -0.0160x = 0.34 A = 0.1020 B = 0.1000 Δ = 0.0020x = 0.38 A = 0.1060 B = 0.0820 Δ = 0.0240x = 0.43 A = 0.1380 B = 0.0880 Δ = 0.0500x = 0.48 A = 0.0940 B = 0.1080 Δ = -0.0140x = 0.53 A = 0.0820 B = 0.0940 Δ = -0.0120x = 0.58 A = 0.0620 B = 0.0860 Δ = -0.0240x = 0.63 A = 0.0640 B = 0.0680 Δ = -0.0040x = 0.68 A = 0.0640 B = 0.0420 Δ = 0.0220x = 0.72 A = 0.0480 B = 0.0400 Δ = 0.0080x = 0.77 A = 0.0160 B = 0.0160 Δ = 0.0000x = 0.82 A = 0.0060 B = 0.0180 Δ = -0.0120x = 0.87 A = 0.0080 B = 0.0100 Δ = -0.0020x = 0.92 A = 0.0080 B = 0.0040 Δ = 0.0040x = 0.96 A = 0.0020 B = 0.0020 Δ = 0.0000x = 1.01 A = 0.0040 B = 0.0000 Δ = 0.0040
beta[7]
reference stan24 bins · 0.07 … 0.46
00.070.070.130.130.200.400.27 · 0.1300.26 · 0.122x = 0.07 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.09 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.11 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.12 A = 0.0080 B = 0.0020 Δ = 0.0060x = 0.14 A = 0.0140 B = 0.0120 Δ = 0.0020x = 0.16 A = 0.0100 B = 0.0120 Δ = -0.0020x = 0.17 A = 0.0200 B = 0.0340 Δ = -0.0140x = 0.19 A = 0.0260 B = 0.0340 Δ = -0.0080x = 0.21 A = 0.0700 B = 0.0620 Δ = 0.0080x = 0.22 A = 0.0680 B = 0.0740 Δ = -0.0060x = 0.24 A = 0.0800 B = 0.0760 Δ = 0.0040x = 0.26 A = 0.1280 B = 0.1220 Δ = 0.0060x = 0.27 A = 0.1300 B = 0.0980 Δ = 0.0320x = 0.29 A = 0.1020 B = 0.0960 Δ = 0.0060x = 0.31 A = 0.1100 B = 0.0880 Δ = 0.0220x = 0.32 A = 0.0600 B = 0.0860 Δ = -0.0260x = 0.34 A = 0.0700 B = 0.0700 Δ = -0.0000x = 0.36 A = 0.0480 B = 0.0500 Δ = -0.0020x = 0.37 A = 0.0200 B = 0.0260 Δ = -0.0060x = 0.39 A = 0.0100 B = 0.0320 Δ = -0.0220x = 0.41 A = 0.0100 B = 0.0060 Δ = 0.0040x = 0.42 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.44 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.46 A = 0.0040 B = 0.0000 Δ = 0.0040
beta[8]
reference stan24 bins · -0.16 … 0.46
00.050.050.100.1000.08 · 0.1000.11 · 0.104x = -0.16 A = 0.0020 B = 0.0060 Δ = -0.0040x = -0.14 A = 0.0080 B = 0.0040 Δ = 0.0040x = -0.11 A = 0.0080 B = 0.0120 Δ = -0.0040x = -0.08 A = 0.0080 B = 0.0060 Δ = 0.0020x = -0.05 A = 0.0220 B = 0.0240 Δ = -0.0020x = -0.03 A = 0.0300 B = 0.0240 Δ = 0.0060x = 0.00 A = 0.0480 B = 0.0440 Δ = 0.0040x = 0.03 A = 0.0480 B = 0.0760 Δ = -0.0280x = 0.06 A = 0.0900 B = 0.0740 Δ = 0.0160x = 0.08 A = 0.1000 B = 0.0900 Δ = 0.0100x = 0.11 A = 0.0920 B = 0.1040 Δ = -0.0120x = 0.14 A = 0.0780 B = 0.0820 Δ = -0.0040x = 0.17 A = 0.1000 B = 0.1000 Δ = 0.0000x = 0.19 A = 0.0860 B = 0.0960 Δ = -0.0100x = 0.22 A = 0.0920 B = 0.0760 Δ = 0.0160x = 0.25 A = 0.0780 B = 0.0620 Δ = 0.0160x = 0.27 A = 0.0340 B = 0.0400 Δ = -0.0060x = 0.30 A = 0.0320 B = 0.0240 Δ = 0.0080x = 0.33 A = 0.0200 B = 0.0200 Δ = 0.0000x = 0.35 A = 0.0060 B = 0.0200 Δ = -0.0140x = 0.38 A = 0.0100 B = 0.0160 Δ = -0.0060x = 0.41 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.44 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.46 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[9]
reference stan24 bins · -0.01 … 0.34
00.060.060.130.1300.200.19 · 0.1280.17 · 0.120x = -0.01 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.01 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.02 A = 0.0040 B = 0.0080 Δ = -0.0040x = 0.04 A = 0.0080 B = 0.0060 Δ = 0.0020x = 0.05 A = 0.0200 B = 0.0140 Δ = 0.0060x = 0.07 A = 0.0260 B = 0.0260 Δ = 0.0000x = 0.08 A = 0.0240 B = 0.0280 Δ = -0.0040x = 0.10 A = 0.0420 B = 0.0460 Δ = -0.0040x = 0.11 A = 0.0500 B = 0.0660 Δ = -0.0160x = 0.13 A = 0.0760 B = 0.0860 Δ = -0.0100x = 0.14 A = 0.0720 B = 0.0840 Δ = -0.0120x = 0.16 A = 0.0920 B = 0.0660 Δ = 0.0260x = 0.17 A = 0.0980 B = 0.1200 Δ = -0.0220x = 0.19 A = 0.1280 B = 0.0860 Δ = 0.0420x = 0.20 A = 0.1060 B = 0.0920 Δ = 0.0140x = 0.22 A = 0.0840 B = 0.1040 Δ = -0.0200x = 0.23 A = 0.0460 B = 0.0580 Δ = -0.0120x = 0.25 A = 0.0520 B = 0.0340 Δ = 0.0180x = 0.26 A = 0.0240 B = 0.0160 Δ = 0.0080x = 0.28 A = 0.0220 B = 0.0260 Δ = -0.0040x = 0.29 A = 0.0100 B = 0.0160 Δ = -0.0060x = 0.30 A = 0.0080 B = 0.0020 Δ = 0.0060x = 0.32 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.34 A = 0.0000 B = 0.0080 Δ = -0.0080
sigma
reference stan24 bins · 1.68 … 1.92
00.070.070.130.131.701.801.901.77 · 0.1061.77 · 0.132x = 1.68 A = 0.0060 B = 0.0020 Δ = 0.0040x = 1.69 A = 0.0040 B = 0.0040 Δ = 0.0000x = 1.70 A = 0.0100 B = 0.0140 Δ = -0.0040x = 1.71 A = 0.0180 B = 0.0100 Δ = 0.0080x = 1.72 A = 0.0240 B = 0.0080 Δ = 0.0160x = 1.73 A = 0.0500 B = 0.0400 Δ = 0.0100x = 1.74 A = 0.0460 B = 0.0500 Δ = -0.0040x = 1.75 A = 0.0860 B = 0.0980 Δ = -0.0120x = 1.76 A = 0.0900 B = 0.1160 Δ = -0.0260x = 1.77 A = 0.1060 B = 0.1320 Δ = -0.0260x = 1.78 A = 0.1060 B = 0.1060 Δ = 0.0000x = 1.80 A = 0.1040 B = 0.1020 Δ = 0.0020x = 1.81 A = 0.1060 B = 0.0940 Δ = 0.0120x = 1.82 A = 0.0820 B = 0.0660 Δ = 0.0160x = 1.83 A = 0.0340 B = 0.0560 Δ = -0.0220x = 1.84 A = 0.0540 B = 0.0400 Δ = 0.0140x = 1.85 A = 0.0200 B = 0.0260 Δ = -0.0060x = 1.86 A = 0.0280 B = 0.0200 Δ = 0.0080x = 1.87 A = 0.0080 B = 0.0060 Δ = 0.0020x = 1.88 A = 0.0080 B = 0.0080 Δ = 0.0000x = 1.89 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.90 A = 0.0040 B = 0.0020 Δ = 0.0020x = 1.91 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.92 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0131 ≤ tol 0.0395 · floors 0.0173/0.0194
posteriordb-nes1980 / nes
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma) stan pass 0.0186
00 statement source: posteriordb/nes1980-nes
given

For each of N respondents, the data provide party identification on a continuous scale (partyid7), respondent ideology (real_ideo), race adjustment (race_adj), education level (educ1), gender, income level, and a discrete age group indicator (age_discrete: 1 for under 30, 2 for ages 30-44, 3 for ages 45-64, 4 for age 65 and over). The model includes nine regression coefficients (intercept and eight slopes), each with a flat or improper uniform prior over the reals. The error standard deviation sigma, constrained positive, has an improper uniform prior over the positive reals.

model

Each respondent's party identification is normally distributed with a mean equal to a linear combination of an intercept, slopes on ideology, race adjustment, three age group indicators (ages 30-44, 45-64, and 65-plus), education, gender, and income, and a common standard deviation sigma across all respondents. The age group indicators are binary variables derived from the discrete age group: one for each age bracket (with the under-30 group as reference), taking value 1 if the respondent falls in that bracket and 0 otherwise.

query

The marginal posterior distributions of each of the ten parameters: the intercept (reported as beta[1]), the slope on ideology (reported as beta[2]), the slope on race adjustment (reported as beta[3]), the slope on the 30-44 age group indicator (reported as beta[4]), the slope on the 45-64 age group indicator (reported as beta[5]), the slope on the 65+ age group indicator (reported as beta[6]), the slope on education (reported as beta[7]), the slope on gender (reported as beta[8]), the slope on income (reported as beta[9]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.019
stan
1data {
2 int<lower=0> N;
3 vector[N] partyid7;
4 vector[N] real_ideo;
5 vector[N] race_adj;
6 vector[N] educ1;
7 vector[N] gender;
8 vector[N] income;
9 array[N] int age_discrete;
10}
11transformed data {
12 vector[N] age30_44; // age as factor
13 vector[N] age45_64;
14 vector[N] age65up;
15
16 for (n in 1 : N) {
17 age30_44[n] = age_discrete[n] == 2;
18 age45_64[n] = age_discrete[n] == 3;
19 age65up[n] = age_discrete[n] == 4;
20 }
21}
22parameters {
23 vector[9] beta;
24 real<lower=0> sigma;
25}
26model {
27 // vectorization
28 partyid7 ~ normal(beta[1] + beta[2] * real_ideo + beta[3] * race_adj
29 + beta[4] * age30_44 + beta[5] * age45_64
30 + beta[6] * age65up + beta[7] * educ1 + beta[8] * gender
31 + beta[9] * income, sigma);
32}
33
34//@ DATA { N: 701, age_discrete: [701 values], educ1: [701 values], gender: [701 values], income: [701 values], partyid7: [701 values], race_adj: [701 values], real_ideo: [701 values] } // values supplied at runtime
35//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","beta[8]","beta[9]","sigma"]
36//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
37
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
beta[1]
reference stan24 bins · -0.25 … 3.48
00.060.060.120.12021.69 · 0.1181.86 · 0.124x = -0.25 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.09 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.07 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.23 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.40 A = 0.0060 B = 0.0100 Δ = -0.0040x = 0.56 A = 0.0220 B = 0.0160 Δ = 0.0060x = 0.72 A = 0.0300 B = 0.0200 Δ = 0.0100x = 0.88 A = 0.0460 B = 0.0300 Δ = 0.0160x = 1.05 A = 0.0700 B = 0.0600 Δ = 0.0100x = 1.21 A = 0.0920 B = 0.0840 Δ = 0.0080x = 1.37 A = 0.0900 B = 0.1140 Δ = -0.0240x = 1.53 A = 0.1080 B = 0.1040 Δ = 0.0040x = 1.69 A = 0.1180 B = 0.1120 Δ = 0.0060x = 1.86 A = 0.0780 B = 0.1240 Δ = -0.0460x = 2.02 A = 0.0940 B = 0.0820 Δ = 0.0120x = 2.18 A = 0.0820 B = 0.0740 Δ = 0.0080x = 2.34 A = 0.0580 B = 0.0600 Δ = -0.0020x = 2.50 A = 0.0440 B = 0.0380 Δ = 0.0060x = 2.67 A = 0.0240 B = 0.0440 Δ = -0.0200x = 2.83 A = 0.0080 B = 0.0160 Δ = -0.0080x = 2.99 A = 0.0080 B = 0.0080 Δ = 0.0000x = 3.15 A = 0.0020 B = 0.0000 Δ = 0.0020x = 3.31 A = 0.0020 B = 0.0000 Δ = 0.0020x = 3.48 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[2]
reference stan24 bins · 0.43 … 0.81
00.070.070.140.140.600.800.60 · 0.1400.61 · 0.142x = 0.43 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.45 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.47 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.48 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.50 A = 0.0140 B = 0.0220 Δ = -0.0080x = 0.52 A = 0.0260 B = 0.0360 Δ = -0.0100x = 0.53 A = 0.0580 B = 0.0420 Δ = 0.0160x = 0.55 A = 0.0560 B = 0.0780 Δ = -0.0220x = 0.56 A = 0.0820 B = 0.0900 Δ = -0.0080x = 0.58 A = 0.0900 B = 0.1060 Δ = -0.0160x = 0.60 A = 0.1400 B = 0.1060 Δ = 0.0340x = 0.61 A = 0.1220 B = 0.1420 Δ = -0.0200x = 0.63 A = 0.1100 B = 0.1140 Δ = -0.0040x = 0.65 A = 0.1080 B = 0.0840 Δ = 0.0240x = 0.66 A = 0.0720 B = 0.0760 Δ = -0.0040x = 0.68 A = 0.0440 B = 0.0360 Δ = 0.0080x = 0.69 A = 0.0300 B = 0.0280 Δ = 0.0020x = 0.71 A = 0.0120 B = 0.0120 Δ = 0.0000x = 0.73 A = 0.0100 B = 0.0060 Δ = 0.0040x = 0.74 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.76 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.78 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.79 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.81 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[3]
reference stan24 bins · -1.99 … -0.56
00.050.050.100.10-1-1.24 · 0.104-1.30 · 0.102x = -1.99 A = 0.0080 B = 0.0040 Δ = 0.0040x = -1.92 A = 0.0040 B = 0.0000 Δ = 0.0040x = -1.86 A = 0.0080 B = 0.0040 Δ = 0.0040x = -1.80 A = 0.0160 B = 0.0100 Δ = 0.0060x = -1.74 A = 0.0080 B = 0.0100 Δ = -0.0020x = -1.68 A = 0.0320 B = 0.0460 Δ = -0.0140x = -1.61 A = 0.0460 B = 0.0520 Δ = -0.0060x = -1.55 A = 0.0460 B = 0.0540 Δ = -0.0080x = -1.49 A = 0.0860 B = 0.0820 Δ = 0.0040x = -1.43 A = 0.0820 B = 0.0900 Δ = -0.0080x = -1.37 A = 0.0820 B = 0.0840 Δ = -0.0020x = -1.30 A = 0.0940 B = 0.1020 Δ = -0.0080x = -1.24 A = 0.1040 B = 0.0820 Δ = 0.0220x = -1.18 A = 0.0820 B = 0.0980 Δ = -0.0160x = -1.12 A = 0.0800 B = 0.0980 Δ = -0.0180x = -1.06 A = 0.0600 B = 0.0580 Δ = 0.0020x = -0.99 A = 0.0460 B = 0.0500 Δ = -0.0040x = -0.93 A = 0.0480 B = 0.0300 Δ = 0.0180x = -0.87 A = 0.0180 B = 0.0200 Δ = -0.0020x = -0.81 A = 0.0200 B = 0.0180 Δ = 0.0020x = -0.75 A = 0.0100 B = 0.0040 Δ = 0.0060x = -0.69 A = 0.0100 B = 0.0020 Δ = 0.0080x = -0.62 A = 0.0060 B = 0.0020 Δ = 0.0040x = -0.56 A = 0.0040 B = 0.0000 Δ = 0.0040
beta[4]
reference stan24 bins · -0.69 … 0.45
00.060.060.130.13-0.500-0.14 · 0.126-0.19 · 0.112x = -0.69 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.64 A = 0.0080 B = 0.0000 Δ = 0.0080x = -0.59 A = 0.0060 B = 0.0040 Δ = 0.0020x = -0.54 A = 0.0060 B = 0.0060 Δ = 0.0000x = -0.49 A = 0.0120 B = 0.0220 Δ = -0.0100x = -0.44 A = 0.0260 B = 0.0300 Δ = -0.0040x = -0.39 A = 0.0520 B = 0.0340 Δ = 0.0180x = -0.34 A = 0.0400 B = 0.0780 Δ = -0.0380x = -0.29 A = 0.0600 B = 0.0720 Δ = -0.0120x = -0.24 A = 0.0920 B = 0.0660 Δ = 0.0260x = -0.19 A = 0.1140 B = 0.1120 Δ = 0.0020x = -0.14 A = 0.1260 B = 0.1020 Δ = 0.0240x = -0.09 A = 0.0940 B = 0.1100 Δ = -0.0160x = -0.04 A = 0.0960 B = 0.1040 Δ = -0.0080x = 0.01 A = 0.0740 B = 0.0880 Δ = -0.0140x = 0.06 A = 0.0600 B = 0.0660 Δ = -0.0060x = 0.11 A = 0.0460 B = 0.0500 Δ = -0.0040x = 0.16 A = 0.0260 B = 0.0160 Δ = 0.0100x = 0.21 A = 0.0200 B = 0.0120 Δ = 0.0080x = 0.26 A = 0.0160 B = 0.0180 Δ = -0.0020x = 0.30 A = 0.0140 B = 0.0060 Δ = 0.0080x = 0.35 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.41 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.45 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[5]
reference stan24 bins · -0.90 … 0.23
00.060.060.120.12-0.500-0.36 · 0.124-0.46 · 0.122x = -0.90 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.85 A = 0.0000 B = 0.0060 Δ = -0.0060x = -0.80 A = 0.0080 B = 0.0060 Δ = 0.0020x = -0.75 A = 0.0220 B = 0.0180 Δ = 0.0040x = -0.70 A = 0.0320 B = 0.0200 Δ = 0.0120x = -0.66 A = 0.0320 B = 0.0320 Δ = 0.0000x = -0.61 A = 0.0460 B = 0.0580 Δ = -0.0120x = -0.56 A = 0.0660 B = 0.0680 Δ = -0.0020x = -0.51 A = 0.0920 B = 0.0760 Δ = 0.0160x = -0.46 A = 0.0960 B = 0.1220 Δ = -0.0260x = -0.41 A = 0.0740 B = 0.1040 Δ = -0.0300x = -0.36 A = 0.1240 B = 0.0840 Δ = 0.0400x = -0.31 A = 0.0900 B = 0.1000 Δ = -0.0100x = -0.26 A = 0.0900 B = 0.0940 Δ = -0.0040x = -0.21 A = 0.0600 B = 0.0560 Δ = 0.0040x = -0.16 A = 0.0420 B = 0.0640 Δ = -0.0220x = -0.11 A = 0.0320 B = 0.0380 Δ = -0.0060x = -0.06 A = 0.0440 B = 0.0180 Δ = 0.0260x = -0.01 A = 0.0160 B = 0.0180 Δ = -0.0020x = 0.03 A = 0.0160 B = 0.0100 Δ = 0.0060x = 0.08 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.13 A = 0.0100 B = 0.0020 Δ = 0.0080x = 0.18 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.23 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[6]
reference stan24 bins · -0.67 … 0.79
00.070.070.130.1300.03 · 0.1320.09 · 0.130x = -0.67 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.60 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.54 A = 0.0060 B = 0.0020 Δ = 0.0040x = -0.48 A = 0.0080 B = 0.0100 Δ = -0.0020x = -0.41 A = 0.0180 B = 0.0120 Δ = 0.0060x = -0.35 A = 0.0240 B = 0.0340 Δ = -0.0100x = -0.29 A = 0.0320 B = 0.0420 Δ = -0.0100x = -0.22 A = 0.0640 B = 0.0460 Δ = 0.0180x = -0.16 A = 0.0800 B = 0.0600 Δ = 0.0200x = -0.10 A = 0.0920 B = 0.1120 Δ = -0.0200x = -0.03 A = 0.0720 B = 0.1260 Δ = -0.0540x = 0.03 A = 0.1320 B = 0.1160 Δ = 0.0160x = 0.09 A = 0.1140 B = 0.1300 Δ = -0.0160x = 0.16 A = 0.0980 B = 0.0920 Δ = 0.0060x = 0.22 A = 0.0820 B = 0.0820 Δ = 0.0000x = 0.28 A = 0.0480 B = 0.0560 Δ = -0.0080x = 0.35 A = 0.0480 B = 0.0280 Δ = 0.0200x = 0.41 A = 0.0320 B = 0.0180 Δ = 0.0140x = 0.47 A = 0.0200 B = 0.0180 Δ = 0.0020x = 0.54 A = 0.0120 B = 0.0080 Δ = 0.0040x = 0.60 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.66 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.73 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.79 A = 0.0060 B = 0.0000 Δ = 0.0060
beta[7]
reference stan24 bins · -0.18 … 0.34
00.060.060.110.1100.200.12 · 0.1060.07 · 0.112x = -0.18 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.16 A = 0.0020 B = 0.0040 Δ = -0.0020x = -0.14 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.11 A = 0.0020 B = 0.0120 Δ = -0.0100x = -0.09 A = 0.0120 B = 0.0040 Δ = 0.0080x = -0.07 A = 0.0160 B = 0.0160 Δ = 0.0000x = -0.04 A = 0.0240 B = 0.0260 Δ = -0.0020x = -0.02 A = 0.0600 B = 0.0580 Δ = 0.0020x = 0.00 A = 0.0580 B = 0.0400 Δ = 0.0180x = 0.02 A = 0.0600 B = 0.0820 Δ = -0.0220x = 0.05 A = 0.0700 B = 0.0860 Δ = -0.0160x = 0.07 A = 0.0980 B = 0.1120 Δ = -0.0140x = 0.09 A = 0.0980 B = 0.1100 Δ = -0.0120x = 0.12 A = 0.1060 B = 0.0940 Δ = 0.0120x = 0.14 A = 0.0780 B = 0.0840 Δ = -0.0060x = 0.16 A = 0.0800 B = 0.0900 Δ = -0.0100x = 0.18 A = 0.0820 B = 0.0560 Δ = 0.0260x = 0.20 A = 0.0500 B = 0.0460 Δ = 0.0040x = 0.23 A = 0.0560 B = 0.0300 Δ = 0.0260x = 0.25 A = 0.0180 B = 0.0200 Δ = -0.0020x = 0.27 A = 0.0140 B = 0.0020 Δ = 0.0120x = 0.30 A = 0.0100 B = 0.0100 Δ = 0.0000x = 0.32 A = 0.0000 B = 0.0080 Δ = -0.0080x = 0.34 A = 0.0020 B = 0.0080 Δ = -0.0060
beta[8]
reference stan24 bins · -0.49 … 0.44
00.060.060.120.120-0.08 · 0.1160.04 · 0.110x = -0.49 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.45 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.41 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.36 A = 0.0020 B = 0.0080 Δ = -0.0060x = -0.32 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.28 A = 0.0080 B = 0.0040 Δ = 0.0040x = -0.24 A = 0.0200 B = 0.0160 Δ = 0.0040x = -0.20 A = 0.0180 B = 0.0280 Δ = -0.0100x = -0.16 A = 0.0360 B = 0.0640 Δ = -0.0280x = -0.12 A = 0.0680 B = 0.0740 Δ = -0.0060x = -0.08 A = 0.1160 B = 0.0860 Δ = 0.0300x = -0.04 A = 0.0880 B = 0.0900 Δ = -0.0020x = -0.00 A = 0.1060 B = 0.1020 Δ = 0.0040x = 0.04 A = 0.1160 B = 0.1100 Δ = 0.0060x = 0.08 A = 0.1040 B = 0.1100 Δ = -0.0060x = 0.12 A = 0.0880 B = 0.0820 Δ = 0.0060x = 0.16 A = 0.0740 B = 0.0860 Δ = -0.0120x = 0.20 A = 0.0480 B = 0.0640 Δ = -0.0160x = 0.24 A = 0.0400 B = 0.0360 Δ = 0.0040x = 0.28 A = 0.0300 B = 0.0200 Δ = 0.0100x = 0.32 A = 0.0120 B = 0.0080 Δ = 0.0040x = 0.36 A = 0.0080 B = 0.0040 Δ = 0.0040x = 0.40 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.44 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[9]
reference stan24 bins · -0.02 … 0.47
00.070.070.130.1300.200.400.24 · 0.1340.26 · 0.130x = -0.02 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.00 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.02 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.05 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.07 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.09 A = 0.0180 B = 0.0160 Δ = 0.0020x = 0.11 A = 0.0480 B = 0.0400 Δ = 0.0080x = 0.13 A = 0.0440 B = 0.0620 Δ = -0.0180x = 0.15 A = 0.0620 B = 0.0640 Δ = -0.0020x = 0.17 A = 0.0880 B = 0.0780 Δ = 0.0100x = 0.20 A = 0.0980 B = 0.0960 Δ = 0.0020x = 0.22 A = 0.1240 B = 0.1180 Δ = 0.0060x = 0.24 A = 0.1340 B = 0.1040 Δ = 0.0300x = 0.26 A = 0.1120 B = 0.1300 Δ = -0.0180x = 0.28 A = 0.0680 B = 0.0880 Δ = -0.0200x = 0.30 A = 0.0720 B = 0.0700 Δ = 0.0020x = 0.32 A = 0.0440 B = 0.0400 Δ = 0.0040x = 0.34 A = 0.0260 B = 0.0280 Δ = -0.0020x = 0.36 A = 0.0120 B = 0.0260 Δ = -0.0140x = 0.39 A = 0.0100 B = 0.0120 Δ = -0.0020x = 0.41 A = 0.0080 B = 0.0060 Δ = 0.0020x = 0.43 A = 0.0100 B = 0.0060 Δ = 0.0040x = 0.45 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.47 A = 0.0040 B = 0.0000 Δ = 0.0040
sigma
reference stan24 bins · 1.71 … 1.98
00.060.060.120.121.801.901.80 · 0.0981.82 · 0.116x = 1.71 A = 0.0040 B = 0.0080 Δ = -0.0040x = 1.72 A = 0.0100 B = 0.0060 Δ = 0.0040x = 1.73 A = 0.0040 B = 0.0100 Δ = -0.0060x = 1.75 A = 0.0320 B = 0.0220 Δ = 0.0100x = 1.76 A = 0.0180 B = 0.0320 Δ = -0.0140x = 1.77 A = 0.0420 B = 0.0560 Δ = -0.0140x = 1.78 A = 0.0720 B = 0.0800 Δ = -0.0080x = 1.79 A = 0.0820 B = 0.0600 Δ = 0.0220x = 1.80 A = 0.0980 B = 0.0740 Δ = 0.0240x = 1.82 A = 0.0800 B = 0.1160 Δ = -0.0360x = 1.83 A = 0.0920 B = 0.0800 Δ = 0.0120x = 1.84 A = 0.0940 B = 0.0900 Δ = 0.0040x = 1.85 A = 0.0960 B = 0.0860 Δ = 0.0100x = 1.86 A = 0.0760 B = 0.0660 Δ = 0.0100x = 1.88 A = 0.0700 B = 0.0500 Δ = 0.0200x = 1.89 A = 0.0460 B = 0.0660 Δ = -0.0200x = 1.90 A = 0.0360 B = 0.0360 Δ = 0.0000x = 1.91 A = 0.0220 B = 0.0280 Δ = -0.0060x = 1.92 A = 0.0100 B = 0.0120 Δ = -0.0020x = 1.94 A = 0.0020 B = 0.0140 Δ = -0.0120x = 1.95 A = 0.0080 B = 0.0040 Δ = 0.0040x = 1.96 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.97 A = 0.0020 B = 0.0020 Δ = 0.0000x = 1.98 A = 0.0020 B = 0.0020 Δ = 0.0000
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0186 ≤ tol 0.0536 · floors 0.0268/0.0268
posteriordb-nes1984 / nes
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma) stan pass 0.0221
00 statement source: posteriordb/nes1984-nes
given

For each of N observations, the data provide a response variable (party identification), six continuous and categorical predictors (ideological position, race adjustment, education level, gender, and income), and a discrete age category (with values 1, 2, 3, 4 corresponding to under 30, 30-44, 45-64, and 65+). The regression includes nine coefficients: an intercept, slopes for each of the six base predictors, and slopes for three binary indicators derived from age categories (for ages 30-44, 45-64, and 65+, with ages under 30 as the implicit reference). Each of the nine coefficients has a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained to be positive, has a flat (improper uniform) prior over the positive reals.

model

A 9-predictor linear regression model for party identification. Each observation's party identification value is normally distributed with a mean equal to the intercept plus a weighted sum of six base predictors (ideological position, race adjustment, education level, gender, and income) and three binary age indicators (for 30-44, 45-64, and 65+, with under 30 as the reference). The standard deviation of the normal distribution is sigma, shared across all observations.

query

The marginal posterior distributions of the ten parameters: beta[1] (the intercept), beta[2] (the slope on ideological position), beta[3] (the slope on race adjustment), beta[4] (the slope on the age 30-44 indicator), beta[5] (the slope on the age 45-64 indicator), beta[6] (the slope on the age 65+ indicator), beta[7] (the slope on education level), beta[8] (the slope on gender), beta[9] (the slope on income), and sigma (the error standard deviation).

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.022
stan
1data {
2 int<lower=0> N;
3 vector[N] partyid7;
4 vector[N] real_ideo;
5 vector[N] race_adj;
6 vector[N] educ1;
7 vector[N] gender;
8 vector[N] income;
9 array[N] int age_discrete;
10}
11transformed data {
12 vector[N] age30_44; // age as factor
13 vector[N] age45_64;
14 vector[N] age65up;
15
16 for (n in 1 : N) {
17 age30_44[n] = age_discrete[n] == 2;
18 age45_64[n] = age_discrete[n] == 3;
19 age65up[n] = age_discrete[n] == 4;
20 }
21}
22parameters {
23 vector[9] beta;
24 real<lower=0> sigma;
25}
26model {
27 // vectorization
28 partyid7 ~ normal(beta[1] + beta[2] * real_ideo + beta[3] * race_adj
29 + beta[4] * age30_44 + beta[5] * age45_64
30 + beta[6] * age65up + beta[7] * educ1 + beta[8] * gender
31 + beta[9] * income, sigma);
32}
33
34//@ DATA { N: 1226, age_discrete: [1226 values], educ1: [1226 values], gender: [1226 values], income: [1226 values], partyid7: [1226 values], race_adj: [1226 values], real_ideo: [1226 values] } // values supplied at runtime
35//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","beta[8]","beta[9]","sigma"]
36//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
37
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
beta[1]
reference stan24 bins · 0.97 … 3.35
00.050.050.110.111232.42 · 0.1062.21 · 0.104x = 0.97 A = 0.0060 B = 0.0000 Δ = 0.0060x = 1.08 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.18 A = 0.0080 B = 0.0020 Δ = 0.0060x = 1.28 A = 0.0020 B = 0.0060 Δ = -0.0040x = 1.39 A = 0.0080 B = 0.0020 Δ = 0.0060x = 1.49 A = 0.0120 B = 0.0200 Δ = -0.0080x = 1.59 A = 0.0360 B = 0.0180 Δ = 0.0180x = 1.70 A = 0.0340 B = 0.0280 Δ = 0.0060x = 1.80 A = 0.0440 B = 0.0600 Δ = -0.0160x = 1.90 A = 0.0640 B = 0.0560 Δ = 0.0080x = 2.01 A = 0.0700 B = 0.0920 Δ = -0.0220x = 2.11 A = 0.0840 B = 0.1000 Δ = -0.0160x = 2.21 A = 0.1040 B = 0.1040 Δ = 0.0000x = 2.32 A = 0.1020 B = 0.0940 Δ = 0.0080x = 2.42 A = 0.1060 B = 0.0780 Δ = 0.0280x = 2.52 A = 0.0900 B = 0.1020 Δ = -0.0120x = 2.63 A = 0.0720 B = 0.0760 Δ = -0.0040x = 2.73 A = 0.0440 B = 0.0560 Δ = -0.0120x = 2.83 A = 0.0360 B = 0.0360 Δ = 0.0000x = 2.94 A = 0.0260 B = 0.0320 Δ = -0.0060x = 3.04 A = 0.0220 B = 0.0240 Δ = -0.0020x = 3.14 A = 0.0120 B = 0.0040 Δ = 0.0080x = 3.25 A = 0.0100 B = 0.0080 Δ = 0.0020x = 3.35 A = 0.0080 B = 0.0000 Δ = 0.0080
beta[2]
reference stan24 bins · 0.51 … 0.75
00.060.060.120.120.600.700.62 · 0.1200.61 · 0.114x = 0.51 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.52 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.53 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.54 A = 0.0060 B = 0.0100 Δ = -0.0040x = 0.55 A = 0.0300 B = 0.0120 Δ = 0.0180x = 0.56 A = 0.0180 B = 0.0180 Δ = 0.0000x = 0.57 A = 0.0400 B = 0.0460 Δ = -0.0060x = 0.58 A = 0.0480 B = 0.0360 Δ = 0.0120x = 0.59 A = 0.0800 B = 0.0620 Δ = 0.0180x = 0.60 A = 0.0800 B = 0.0680 Δ = 0.0120x = 0.61 A = 0.0980 B = 0.1140 Δ = -0.0160x = 0.62 A = 0.1200 B = 0.1100 Δ = 0.0100x = 0.63 A = 0.1080 B = 0.1020 Δ = 0.0060x = 0.64 A = 0.0940 B = 0.0960 Δ = -0.0020x = 0.65 A = 0.0920 B = 0.0980 Δ = -0.0060x = 0.67 A = 0.0520 B = 0.0740 Δ = -0.0220x = 0.68 A = 0.0340 B = 0.0380 Δ = -0.0040x = 0.69 A = 0.0280 B = 0.0480 Δ = -0.0200x = 0.70 A = 0.0260 B = 0.0280 Δ = -0.0020x = 0.71 A = 0.0200 B = 0.0220 Δ = -0.0020x = 0.72 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.73 A = 0.0080 B = 0.0020 Δ = 0.0060x = 0.74 A = 0.0020 B = 0.0060 Δ = -0.0040x = 0.75 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[3]
reference stan24 bins · -2.06 … -0.92
00.070.070.130.13-2-1.50-1-1.56 · 0.102-1.52 · 0.130x = -2.06 A = 0.0000 B = 0.0020 Δ = -0.0020x = -2.01 A = 0.0040 B = 0.0020 Δ = 0.0020x = -1.96 A = 0.0000 B = 0.0020 Δ = -0.0020x = -1.91 A = 0.0040 B = 0.0060 Δ = -0.0020x = -1.86 A = 0.0200 B = 0.0100 Δ = 0.0100x = -1.81 A = 0.0320 B = 0.0100 Δ = 0.0220x = -1.76 A = 0.0640 B = 0.0400 Δ = 0.0240x = -1.71 A = 0.0380 B = 0.0500 Δ = -0.0120x = -1.66 A = 0.0680 B = 0.0560 Δ = 0.0120x = -1.61 A = 0.0780 B = 0.0960 Δ = -0.0180x = -1.56 A = 0.1020 B = 0.1120 Δ = -0.0100x = -1.52 A = 0.0880 B = 0.1300 Δ = -0.0420x = -1.47 A = 0.0940 B = 0.0900 Δ = 0.0040x = -1.42 A = 0.0880 B = 0.0900 Δ = -0.0020x = -1.37 A = 0.0660 B = 0.0880 Δ = -0.0220x = -1.32 A = 0.0680 B = 0.0760 Δ = -0.0080x = -1.27 A = 0.0620 B = 0.0500 Δ = 0.0120x = -1.22 A = 0.0480 B = 0.0420 Δ = 0.0060x = -1.17 A = 0.0280 B = 0.0220 Δ = 0.0060x = -1.12 A = 0.0180 B = 0.0140 Δ = 0.0040x = -1.07 A = 0.0160 B = 0.0080 Δ = 0.0080x = -1.02 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.97 A = 0.0060 B = 0.0040 Δ = 0.0020x = -0.92 A = 0.0040 B = 0.0000 Δ = 0.0040
beta[4]
reference stan24 bins · -0.70 … 0.19
00.060.060.120.12-0.500-0.24 · 0.114-0.24 · 0.120x = -0.70 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.67 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.63 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.59 A = 0.0040 B = 0.0100 Δ = -0.0060x = -0.55 A = 0.0200 B = 0.0040 Δ = 0.0160x = -0.51 A = 0.0200 B = 0.0100 Δ = 0.0100x = -0.47 A = 0.0220 B = 0.0220 Δ = -0.0000x = -0.43 A = 0.0420 B = 0.0280 Δ = 0.0140x = -0.40 A = 0.0660 B = 0.0740 Δ = -0.0080x = -0.36 A = 0.0860 B = 0.0700 Δ = 0.0160x = -0.32 A = 0.0700 B = 0.0820 Δ = -0.0120x = -0.28 A = 0.1000 B = 0.1100 Δ = -0.0100x = -0.24 A = 0.1140 B = 0.1200 Δ = -0.0060x = -0.20 A = 0.0840 B = 0.1000 Δ = -0.0160x = -0.16 A = 0.0880 B = 0.0660 Δ = 0.0220x = -0.12 A = 0.0960 B = 0.0740 Δ = 0.0220x = -0.09 A = 0.0520 B = 0.0640 Δ = -0.0120x = -0.05 A = 0.0480 B = 0.0740 Δ = -0.0260x = -0.01 A = 0.0440 B = 0.0320 Δ = 0.0120x = 0.03 A = 0.0120 B = 0.0360 Δ = -0.0240x = 0.07 A = 0.0140 B = 0.0120 Δ = 0.0020x = 0.11 A = 0.0040 B = 0.0080 Δ = -0.0040x = 0.15 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.19 A = 0.0040 B = 0.0020 Δ = 0.0020
beta[5]
reference stan24 bins · -1.13 … -0.22
00.050.050.100.10-1-0.50-0.61 · 0.102-0.54 · 0.098x = -1.13 A = 0.0040 B = 0.0000 Δ = 0.0040x = -1.09 A = 0.0020 B = 0.0040 Δ = -0.0020x = -1.05 A = 0.0020 B = 0.0040 Δ = -0.0020x = -1.01 A = 0.0160 B = 0.0120 Δ = 0.0040x = -0.97 A = 0.0200 B = 0.0060 Δ = 0.0140x = -0.93 A = 0.0300 B = 0.0220 Δ = 0.0080x = -0.89 A = 0.0420 B = 0.0180 Δ = 0.0240x = -0.85 A = 0.0420 B = 0.0480 Δ = -0.0060x = -0.81 A = 0.0660 B = 0.0860 Δ = -0.0200x = -0.77 A = 0.0840 B = 0.0900 Δ = -0.0060x = -0.73 A = 0.0820 B = 0.0820 Δ = -0.0000x = -0.69 A = 0.1020 B = 0.0860 Δ = 0.0160x = -0.65 A = 0.1020 B = 0.0940 Δ = 0.0080x = -0.61 A = 0.1020 B = 0.0960 Δ = 0.0060x = -0.57 A = 0.0800 B = 0.0920 Δ = -0.0120x = -0.54 A = 0.0520 B = 0.0980 Δ = -0.0460x = -0.50 A = 0.0500 B = 0.0400 Δ = 0.0100x = -0.46 A = 0.0400 B = 0.0480 Δ = -0.0080x = -0.42 A = 0.0320 B = 0.0320 Δ = -0.0000x = -0.38 A = 0.0200 B = 0.0140 Δ = 0.0060x = -0.34 A = 0.0140 B = 0.0120 Δ = 0.0020x = -0.30 A = 0.0060 B = 0.0060 Δ = 0.0000x = -0.26 A = 0.0060 B = 0.0100 Δ = -0.0040x = -0.22 A = 0.0040 B = 0.0000 Δ = 0.0040
beta[6]
reference stan24 bins · -0.85 … 0.42
00.080.080.150.15-0.500-0.24 · 0.150-0.19 · 0.144x = -0.85 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.80 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.74 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.69 A = 0.0080 B = 0.0120 Δ = -0.0040x = -0.63 A = 0.0220 B = 0.0100 Δ = 0.0120x = -0.58 A = 0.0300 B = 0.0160 Δ = 0.0140x = -0.52 A = 0.0400 B = 0.0260 Δ = 0.0140x = -0.47 A = 0.0680 B = 0.0520 Δ = 0.0160x = -0.41 A = 0.0680 B = 0.0880 Δ = -0.0200x = -0.35 A = 0.0700 B = 0.1020 Δ = -0.0320x = -0.30 A = 0.1060 B = 0.1340 Δ = -0.0280x = -0.24 A = 0.1500 B = 0.1040 Δ = 0.0460x = -0.19 A = 0.1180 B = 0.1440 Δ = -0.0260x = -0.13 A = 0.0920 B = 0.1080 Δ = -0.0160x = -0.08 A = 0.0580 B = 0.0620 Δ = -0.0040x = -0.02 A = 0.0540 B = 0.0580 Δ = -0.0040x = 0.03 A = 0.0460 B = 0.0460 Δ = -0.0000x = 0.09 A = 0.0340 B = 0.0140 Δ = 0.0200x = 0.14 A = 0.0160 B = 0.0100 Δ = 0.0060x = 0.20 A = 0.0080 B = 0.0120 Δ = -0.0040x = 0.25 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.31 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.36 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.42 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[7]
reference stan24 bins · -0.17 … 0.25
00.070.070.130.1300.200.09 · 0.1180.07 · 0.132x = -0.17 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.15 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.13 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.11 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.09 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.08 A = 0.0100 B = 0.0060 Δ = 0.0040x = -0.06 A = 0.0140 B = 0.0120 Δ = 0.0020x = -0.04 A = 0.0260 B = 0.0240 Δ = 0.0020x = -0.02 A = 0.0560 B = 0.0480 Δ = 0.0080x = -0.00 A = 0.0620 B = 0.0580 Δ = 0.0040x = 0.02 A = 0.0680 B = 0.0860 Δ = -0.0180x = 0.03 A = 0.0720 B = 0.0960 Δ = -0.0240x = 0.05 A = 0.1120 B = 0.0920 Δ = 0.0200x = 0.07 A = 0.0940 B = 0.1320 Δ = -0.0380x = 0.09 A = 0.1180 B = 0.1040 Δ = 0.0140x = 0.11 A = 0.0940 B = 0.1060 Δ = -0.0120x = 0.13 A = 0.0660 B = 0.0640 Δ = 0.0020x = 0.14 A = 0.0660 B = 0.0480 Δ = 0.0180x = 0.16 A = 0.0540 B = 0.0460 Δ = 0.0080x = 0.18 A = 0.0280 B = 0.0240 Δ = 0.0040x = 0.20 A = 0.0240 B = 0.0220 Δ = 0.0020x = 0.22 A = 0.0120 B = 0.0080 Δ = 0.0040x = 0.23 A = 0.0120 B = 0.0140 Δ = -0.0020x = 0.25 A = 0.0020 B = 0.0040 Δ = -0.0020
beta[8]
reference stan24 bins · -0.30 … 0.34
00.060.060.120.120-0.02 · 0.1100.03 · 0.122x = -0.30 A = 0.0040 B = 0.0060 Δ = -0.0020x = -0.27 A = 0.0040 B = 0.0040 Δ = 0.0000x = -0.24 A = 0.0080 B = 0.0140 Δ = -0.0060x = -0.22 A = 0.0140 B = 0.0160 Δ = -0.0020x = -0.19 A = 0.0280 B = 0.0240 Δ = 0.0040x = -0.16 A = 0.0340 B = 0.0400 Δ = -0.0060x = -0.13 A = 0.0540 B = 0.0580 Δ = -0.0040x = -0.11 A = 0.0960 B = 0.0620 Δ = 0.0340x = -0.08 A = 0.0640 B = 0.0760 Δ = -0.0120x = -0.05 A = 0.0880 B = 0.1060 Δ = -0.0180x = -0.02 A = 0.1100 B = 0.0980 Δ = 0.0120x = 0.01 A = 0.1080 B = 0.1080 Δ = 0.0000x = 0.03 A = 0.0940 B = 0.1220 Δ = -0.0280x = 0.06 A = 0.0720 B = 0.0580 Δ = 0.0140x = 0.09 A = 0.0820 B = 0.0800 Δ = 0.0020x = 0.12 A = 0.0540 B = 0.0460 Δ = 0.0080x = 0.15 A = 0.0180 B = 0.0220 Δ = -0.0040x = 0.17 A = 0.0220 B = 0.0260 Δ = -0.0040x = 0.20 A = 0.0200 B = 0.0180 Δ = 0.0020x = 0.23 A = 0.0160 B = 0.0060 Δ = 0.0100x = 0.26 A = 0.0060 B = 0.0080 Δ = -0.0020x = 0.28 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.31 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.34 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[9]
reference stan24 bins · 0.04 … 0.43
00.070.070.150.150.200.400.27 · 0.1120.22 · 0.146x = 0.04 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.05 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.07 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.09 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.10 A = 0.0160 B = 0.0160 Δ = 0.0000x = 0.12 A = 0.0160 B = 0.0400 Δ = -0.0240x = 0.14 A = 0.0500 B = 0.0380 Δ = 0.0120x = 0.15 A = 0.0600 B = 0.0600 Δ = -0.0000x = 0.17 A = 0.0720 B = 0.0840 Δ = -0.0120x = 0.19 A = 0.0940 B = 0.1040 Δ = -0.0100x = 0.21 A = 0.0960 B = 0.0960 Δ = -0.0000x = 0.22 A = 0.0940 B = 0.1460 Δ = -0.0520x = 0.24 A = 0.1100 B = 0.1080 Δ = 0.0020x = 0.26 A = 0.0900 B = 0.0660 Δ = 0.0240x = 0.27 A = 0.1120 B = 0.0920 Δ = 0.0200x = 0.29 A = 0.0780 B = 0.0400 Δ = 0.0380x = 0.31 A = 0.0500 B = 0.0460 Δ = 0.0040x = 0.33 A = 0.0160 B = 0.0280 Δ = -0.0120x = 0.34 A = 0.0180 B = 0.0120 Δ = 0.0060x = 0.36 A = 0.0100 B = 0.0140 Δ = -0.0040x = 0.38 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.39 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.41 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.43 A = 0.0020 B = 0.0000 Δ = 0.0020
sigma
reference stan24 bins · 1.78 … 2.00
00.050.050.110.111.801.901.87 · 0.1081.86 · 0.102x = 1.78 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.79 A = 0.0040 B = 0.0000 Δ = 0.0040x = 1.80 A = 0.0060 B = 0.0020 Δ = 0.0040x = 1.81 A = 0.0140 B = 0.0180 Δ = -0.0040x = 1.82 A = 0.0220 B = 0.0280 Δ = -0.0060x = 1.83 A = 0.0300 B = 0.0440 Δ = -0.0140x = 1.84 A = 0.0360 B = 0.0420 Δ = -0.0060x = 1.85 A = 0.0660 B = 0.0580 Δ = 0.0080x = 1.85 A = 0.0560 B = 0.0580 Δ = -0.0020x = 1.86 A = 0.1020 B = 0.1020 Δ = 0.0000x = 1.87 A = 0.1080 B = 0.0960 Δ = 0.0120x = 1.88 A = 0.0940 B = 0.0860 Δ = 0.0080x = 1.89 A = 0.1000 B = 0.0920 Δ = 0.0080x = 1.90 A = 0.1000 B = 0.0780 Δ = 0.0220x = 1.91 A = 0.0640 B = 0.0880 Δ = -0.0240x = 1.92 A = 0.0660 B = 0.0480 Δ = 0.0180x = 1.93 A = 0.0440 B = 0.0500 Δ = -0.0060x = 1.94 A = 0.0220 B = 0.0260 Δ = -0.0040x = 1.95 A = 0.0260 B = 0.0320 Δ = -0.0060x = 1.96 A = 0.0220 B = 0.0240 Δ = -0.0020x = 1.97 A = 0.0080 B = 0.0140 Δ = -0.0060x = 1.98 A = 0.0040 B = 0.0100 Δ = -0.0060x = 1.99 A = 0.0020 B = 0.0020 Δ = 0.0000x = 2.00 A = 0.0020 B = 0.0020 Δ = 0.0000
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0221 ≤ tol 0.0816 · floors 0.0408/0.0361
posteriordb-nes1988 / nes
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma) stan pass 0.0156
00 statement source: posteriordb/nes1988-nes
given

For each of N = 1113 individuals, the data provide their party identification on a 7-point scale (partyid7), ideology on a continuous scale (real_ideo), adjusted race category (race_adj), education level (educ1), gender (gender), income level (income), and age in discrete categories (age_discrete). The model has nine regression coefficients (beta[1] through beta[9]), each with a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each individual's party identification is normally distributed with a mean equal to an intercept plus eight slope terms. The slope terms are: the ideology coefficient times that individual's ideology, the race coefficient times that individual's race category, the education coefficient times that individual's education level, the gender coefficient times that individual's gender, the income coefficient times that individual's income, plus three age-related terms constructed from the discrete age variable—binary indicators for whether the individual's age is in the 30-44 range, the 45-64 range, or 65 and over, each multiplied by their respective age coefficients. All individuals share a common standard deviation sigma.

query

The marginal posterior distributions of each of the ten parameters: the intercept (reported as beta[1]), the ideology slope (beta[2]), the race slope (beta[3]), the age 30-44 slope (beta[4]), the age 45-64 slope (beta[5]), the age 65+ slope (beta[6]), the education slope (beta[7]), the gender slope (beta[8]), the income slope (beta[9]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.016
stan
1data {
2 int<lower=0> N;
3 vector[N] partyid7;
4 vector[N] real_ideo;
5 vector[N] race_adj;
6 vector[N] educ1;
7 vector[N] gender;
8 vector[N] income;
9 array[N] int age_discrete;
10}
11transformed data {
12 vector[N] age30_44; // age as factor
13 vector[N] age45_64;
14 vector[N] age65up;
15
16 for (n in 1 : N) {
17 age30_44[n] = age_discrete[n] == 2;
18 age45_64[n] = age_discrete[n] == 3;
19 age65up[n] = age_discrete[n] == 4;
20 }
21}
22parameters {
23 vector[9] beta;
24 real<lower=0> sigma;
25}
26model {
27 // vectorization
28 partyid7 ~ normal(beta[1] + beta[2] * real_ideo + beta[3] * race_adj
29 + beta[4] * age30_44 + beta[5] * age45_64
30 + beta[6] * age65up + beta[7] * educ1 + beta[8] * gender
31 + beta[9] * income, sigma);
32}
33
34//@ DATA { N: 1113, age_discrete: [1113 values], educ1: [1113 values], gender: [1113 values], income: [1113 values], partyid7: [1113 values], race_adj: [1113 values], real_ideo: [1113 values] } // values supplied at runtime
35//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","beta[8]","beta[9]","sigma"]
36//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
37
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
beta[1]
reference stan24 bins · 1.87 … 4.67
00.060.060.110.112343.21 · 0.1123.21 · 0.110x = 1.87 A = 0.0060 B = 0.0040 Δ = 0.0020x = 1.99 A = 0.0020 B = 0.0040 Δ = -0.0020x = 2.11 A = 0.0180 B = 0.0080 Δ = 0.0100x = 2.23 A = 0.0100 B = 0.0140 Δ = -0.0040x = 2.35 A = 0.0220 B = 0.0220 Δ = 0.0000x = 2.48 A = 0.0380 B = 0.0400 Δ = -0.0020x = 2.60 A = 0.0520 B = 0.0500 Δ = 0.0020x = 2.72 A = 0.0760 B = 0.0560 Δ = 0.0200x = 2.84 A = 0.0760 B = 0.0920 Δ = -0.0160x = 2.96 A = 0.0980 B = 0.0880 Δ = 0.0100x = 3.08 A = 0.1080 B = 0.0740 Δ = 0.0340x = 3.21 A = 0.1120 B = 0.1100 Δ = 0.0020x = 3.33 A = 0.1060 B = 0.0860 Δ = 0.0200x = 3.45 A = 0.0780 B = 0.0820 Δ = -0.0040x = 3.57 A = 0.0800 B = 0.0660 Δ = 0.0140x = 3.69 A = 0.0480 B = 0.0600 Δ = -0.0120x = 3.82 A = 0.0320 B = 0.0600 Δ = -0.0280x = 3.94 A = 0.0180 B = 0.0320 Δ = -0.0140x = 4.06 A = 0.0120 B = 0.0200 Δ = -0.0080x = 4.18 A = 0.0020 B = 0.0160 Δ = -0.0140x = 4.30 A = 0.0020 B = 0.0080 Δ = -0.0060x = 4.42 A = 0.0020 B = 0.0060 Δ = -0.0040x = 4.55 A = 0.0000 B = 0.0000 Δ = 0.0000x = 4.67 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[2]
reference stan24 bins · 0.49 … 0.73
00.060.060.110.110.500.600.700.62 · 0.1140.62 · 0.108x = 0.49 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.50 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.51 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.52 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.53 A = 0.0000 B = 0.0160 Δ = -0.0160x = 0.54 A = 0.0140 B = 0.0260 Δ = -0.0120x = 0.55 A = 0.0300 B = 0.0260 Δ = 0.0040x = 0.56 A = 0.0400 B = 0.0480 Δ = -0.0080x = 0.57 A = 0.0560 B = 0.0760 Δ = -0.0200x = 0.58 A = 0.0720 B = 0.0760 Δ = -0.0040x = 0.60 A = 0.1000 B = 0.0740 Δ = 0.0260x = 0.61 A = 0.0960 B = 0.0980 Δ = -0.0020x = 0.62 A = 0.1140 B = 0.1080 Δ = 0.0060x = 0.63 A = 0.0820 B = 0.0900 Δ = -0.0080x = 0.64 A = 0.0620 B = 0.0780 Δ = -0.0160x = 0.65 A = 0.0720 B = 0.0800 Δ = -0.0080x = 0.66 A = 0.0680 B = 0.0520 Δ = 0.0160x = 0.67 A = 0.0760 B = 0.0460 Δ = 0.0300x = 0.68 A = 0.0420 B = 0.0420 Δ = 0.0000x = 0.69 A = 0.0360 B = 0.0320 Δ = 0.0040x = 0.70 A = 0.0200 B = 0.0180 Δ = 0.0020x = 0.71 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.72 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.73 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[3]
reference stan24 bins · -2.24 … -1.17
00.060.060.110.11-2-1.50-1.68 · 0.114-1.82 · 0.108x = -2.24 A = 0.0000 B = 0.0060 Δ = -0.0060x = -2.19 A = 0.0020 B = 0.0080 Δ = -0.0060x = -2.15 A = 0.0080 B = 0.0080 Δ = 0.0000x = -2.10 A = 0.0040 B = 0.0240 Δ = -0.0200x = -2.06 A = 0.0200 B = 0.0160 Δ = 0.0040x = -2.01 A = 0.0360 B = 0.0380 Δ = -0.0020x = -1.96 A = 0.0460 B = 0.0520 Δ = -0.0060x = -1.92 A = 0.0700 B = 0.0760 Δ = -0.0060x = -1.87 A = 0.0780 B = 0.0760 Δ = 0.0020x = -1.82 A = 0.1000 B = 0.1080 Δ = -0.0080x = -1.77 A = 0.0800 B = 0.0980 Δ = -0.0180x = -1.73 A = 0.1000 B = 0.0920 Δ = 0.0080x = -1.68 A = 0.1140 B = 0.0980 Δ = 0.0160x = -1.64 A = 0.1040 B = 0.0560 Δ = 0.0480x = -1.59 A = 0.0760 B = 0.0880 Δ = -0.0120x = -1.54 A = 0.0440 B = 0.0460 Δ = -0.0020x = -1.50 A = 0.0460 B = 0.0520 Δ = -0.0060x = -1.45 A = 0.0260 B = 0.0240 Δ = 0.0020x = -1.40 A = 0.0220 B = 0.0100 Δ = 0.0120x = -1.36 A = 0.0140 B = 0.0080 Δ = 0.0060x = -1.31 A = 0.0060 B = 0.0160 Δ = -0.0100x = -1.26 A = 0.0000 B = 0.0000 Δ = 0.0000x = -1.22 A = 0.0020 B = 0.0000 Δ = 0.0020x = -1.17 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[4]
reference stan24 bins · -0.73 … 0.13
00.060.060.110.11-0.500-0.32 · 0.114-0.35 · 0.096x = -0.73 A = 0.0000 B = 0.0060 Δ = -0.0060x = -0.69 A = 0.0040 B = 0.0040 Δ = 0.0000x = -0.65 A = 0.0080 B = 0.0100 Δ = -0.0020x = -0.61 A = 0.0140 B = 0.0160 Δ = -0.0020x = -0.58 A = 0.0160 B = 0.0140 Δ = 0.0020x = -0.54 A = 0.0360 B = 0.0380 Δ = -0.0020x = -0.50 A = 0.0580 B = 0.0360 Δ = 0.0220x = -0.47 A = 0.0500 B = 0.0460 Δ = 0.0040x = -0.43 A = 0.0720 B = 0.0960 Δ = -0.0240x = -0.39 A = 0.0920 B = 0.0820 Δ = 0.0100x = -0.35 A = 0.0840 B = 0.0960 Δ = -0.0120x = -0.32 A = 0.1140 B = 0.0800 Δ = 0.0340x = -0.28 A = 0.0840 B = 0.0860 Δ = -0.0020x = -0.24 A = 0.0920 B = 0.0760 Δ = 0.0160x = -0.20 A = 0.0780 B = 0.0720 Δ = 0.0060x = -0.17 A = 0.0460 B = 0.0580 Δ = -0.0120x = -0.13 A = 0.0540 B = 0.0660 Δ = -0.0120x = -0.09 A = 0.0520 B = 0.0360 Δ = 0.0160x = -0.06 A = 0.0120 B = 0.0300 Δ = -0.0180x = -0.02 A = 0.0140 B = 0.0280 Δ = -0.0140x = 0.02 A = 0.0140 B = 0.0100 Δ = 0.0040x = 0.06 A = 0.0040 B = 0.0100 Δ = -0.0060x = 0.09 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.13 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[5]
reference stan24 bins · -0.90 … -0.01
00.050.050.110.11-0.50-0.48 · 0.098-0.44 · 0.108x = -0.90 A = 0.0020 B = 0.0040 Δ = -0.0020x = -0.86 A = 0.0040 B = 0.0080 Δ = -0.0040x = -0.83 A = 0.0060 B = 0.0120 Δ = -0.0060x = -0.79 A = 0.0080 B = 0.0120 Δ = -0.0040x = -0.75 A = 0.0140 B = 0.0160 Δ = -0.0020x = -0.71 A = 0.0260 B = 0.0280 Δ = -0.0020x = -0.67 A = 0.0540 B = 0.0300 Δ = 0.0240x = -0.63 A = 0.0660 B = 0.0480 Δ = 0.0180x = -0.59 A = 0.0700 B = 0.0680 Δ = 0.0020x = -0.56 A = 0.0960 B = 0.0720 Δ = 0.0240x = -0.52 A = 0.0900 B = 0.0840 Δ = 0.0060x = -0.48 A = 0.0980 B = 0.0920 Δ = 0.0060x = -0.44 A = 0.0920 B = 0.1080 Δ = -0.0160x = -0.40 A = 0.0660 B = 0.0840 Δ = -0.0180x = -0.36 A = 0.0700 B = 0.0880 Δ = -0.0180x = -0.32 A = 0.0580 B = 0.0580 Δ = 0.0000x = -0.28 A = 0.0720 B = 0.0580 Δ = 0.0140x = -0.25 A = 0.0400 B = 0.0440 Δ = -0.0040x = -0.21 A = 0.0360 B = 0.0240 Δ = 0.0120x = -0.17 A = 0.0080 B = 0.0260 Δ = -0.0180x = -0.13 A = 0.0120 B = 0.0120 Δ = 0.0000x = -0.09 A = 0.0080 B = 0.0080 Δ = 0.0000x = -0.05 A = 0.0040 B = 0.0080 Δ = -0.0040x = -0.01 A = 0.0000 B = 0.0080 Δ = -0.0080
beta[6]
reference stan24 bins · -1.02 … 0.23
00.070.070.140.14-1-0.500-0.37 · 0.136-0.48 · 0.112x = -1.02 A = 0.0000 B = 0.0040 Δ = -0.0040x = -0.97 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.91 A = 0.0000 B = 0.0080 Δ = -0.0080x = -0.86 A = 0.0160 B = 0.0080 Δ = 0.0080x = -0.81 A = 0.0100 B = 0.0100 Δ = 0.0000x = -0.75 A = 0.0100 B = 0.0260 Δ = -0.0160x = -0.70 A = 0.0260 B = 0.0340 Δ = -0.0080x = -0.64 A = 0.0460 B = 0.0500 Δ = -0.0040x = -0.59 A = 0.0820 B = 0.0720 Δ = 0.0100x = -0.53 A = 0.0860 B = 0.0800 Δ = 0.0060x = -0.48 A = 0.1220 B = 0.1120 Δ = 0.0100x = -0.42 A = 0.1240 B = 0.1020 Δ = 0.0220x = -0.37 A = 0.1360 B = 0.1020 Δ = 0.0340x = -0.31 A = 0.0800 B = 0.0900 Δ = -0.0100x = -0.26 A = 0.0680 B = 0.0740 Δ = -0.0060x = -0.20 A = 0.0680 B = 0.0780 Δ = -0.0100x = -0.15 A = 0.0520 B = 0.0560 Δ = -0.0040x = -0.10 A = 0.0200 B = 0.0440 Δ = -0.0240x = -0.04 A = 0.0240 B = 0.0180 Δ = 0.0060x = 0.01 A = 0.0140 B = 0.0060 Δ = 0.0080x = 0.07 A = 0.0060 B = 0.0240 Δ = -0.0180x = 0.12 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.18 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.23 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[7]
reference stan24 bins · -0.07 … 0.33
00.060.060.120.1200.200.15 · 0.1220.15 · 0.122x = -0.07 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.06 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.04 A = 0.0000 B = 0.0060 Δ = -0.0060x = -0.02 A = 0.0060 B = 0.0020 Δ = 0.0040x = -0.00 A = 0.0040 B = 0.0120 Δ = -0.0080x = 0.01 A = 0.0120 B = 0.0200 Δ = -0.0080x = 0.03 A = 0.0260 B = 0.0240 Δ = 0.0020x = 0.05 A = 0.0260 B = 0.0360 Δ = -0.0100x = 0.07 A = 0.0620 B = 0.0680 Δ = -0.0060x = 0.08 A = 0.0700 B = 0.0680 Δ = 0.0020x = 0.10 A = 0.1000 B = 0.0820 Δ = 0.0180x = 0.12 A = 0.0760 B = 0.0920 Δ = -0.0160x = 0.14 A = 0.1080 B = 0.1040 Δ = 0.0040x = 0.15 A = 0.1220 B = 0.1220 Δ = 0.0000x = 0.17 A = 0.1000 B = 0.0940 Δ = 0.0060x = 0.19 A = 0.0700 B = 0.0740 Δ = -0.0040x = 0.21 A = 0.0700 B = 0.0660 Δ = 0.0040x = 0.22 A = 0.0520 B = 0.0300 Δ = 0.0220x = 0.24 A = 0.0380 B = 0.0460 Δ = -0.0080x = 0.26 A = 0.0260 B = 0.0220 Δ = 0.0040x = 0.28 A = 0.0140 B = 0.0160 Δ = -0.0020x = 0.29 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.31 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.33 A = 0.0040 B = 0.0040 Δ = 0.0000
beta[8]
reference stan24 bins · -0.42 … 0.24
00.060.060.130.130-0.10 · 0.100-0.07 · 0.126x = -0.42 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.39 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.36 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.33 A = 0.0100 B = 0.0040 Δ = 0.0060x = -0.30 A = 0.0120 B = 0.0120 Δ = 0.0000x = -0.27 A = 0.0200 B = 0.0280 Δ = -0.0080x = -0.25 A = 0.0300 B = 0.0480 Δ = -0.0180x = -0.22 A = 0.0420 B = 0.0520 Δ = -0.0100x = -0.19 A = 0.0660 B = 0.0740 Δ = -0.0080x = -0.16 A = 0.0840 B = 0.0880 Δ = -0.0040x = -0.13 A = 0.0920 B = 0.0760 Δ = 0.0160x = -0.10 A = 0.1000 B = 0.0840 Δ = 0.0160x = -0.07 A = 0.0960 B = 0.1260 Δ = -0.0300x = -0.04 A = 0.0760 B = 0.0860 Δ = -0.0100x = -0.02 A = 0.0740 B = 0.0700 Δ = 0.0040x = 0.01 A = 0.0900 B = 0.0680 Δ = 0.0220x = 0.04 A = 0.0720 B = 0.0680 Δ = 0.0040x = 0.07 A = 0.0500 B = 0.0520 Δ = -0.0020x = 0.10 A = 0.0320 B = 0.0340 Δ = -0.0020x = 0.13 A = 0.0140 B = 0.0160 Δ = -0.0020x = 0.16 A = 0.0120 B = 0.0060 Δ = 0.0060x = 0.18 A = 0.0100 B = 0.0040 Δ = 0.0060x = 0.21 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.24 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[9]
reference stan24 bins · -0.13 … 0.22
00.060.060.110.1100.200.08 · 0.1100.05 · 0.112x = -0.13 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.11 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.10 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.08 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.07 A = 0.0140 B = 0.0160 Δ = -0.0020x = -0.05 A = 0.0100 B = 0.0200 Δ = -0.0100x = -0.04 A = 0.0200 B = 0.0100 Δ = 0.0100x = -0.02 A = 0.0340 B = 0.0320 Δ = 0.0020x = -0.01 A = 0.0560 B = 0.0380 Δ = 0.0180x = 0.01 A = 0.0720 B = 0.0880 Δ = -0.0160x = 0.02 A = 0.0720 B = 0.0960 Δ = -0.0240x = 0.04 A = 0.0760 B = 0.0780 Δ = -0.0020x = 0.05 A = 0.1060 B = 0.1120 Δ = -0.0060x = 0.07 A = 0.0920 B = 0.1060 Δ = -0.0140x = 0.08 A = 0.1100 B = 0.0980 Δ = 0.0120x = 0.10 A = 0.0860 B = 0.0800 Δ = 0.0060x = 0.11 A = 0.0800 B = 0.0620 Δ = 0.0180x = 0.13 A = 0.0580 B = 0.0620 Δ = -0.0040x = 0.14 A = 0.0300 B = 0.0500 Δ = -0.0200x = 0.16 A = 0.0300 B = 0.0220 Δ = 0.0080x = 0.17 A = 0.0180 B = 0.0160 Δ = 0.0020x = 0.19 A = 0.0160 B = 0.0080 Δ = 0.0080x = 0.20 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.22 A = 0.0040 B = 0.0000 Δ = 0.0040
sigma
reference stan24 bins · 1.75 … 2.00
00.060.060.120.121.801.9021.87 · 0.1201.87 · 0.112x = 1.75 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.76 A = 0.0040 B = 0.0020 Δ = 0.0020x = 1.77 A = 0.0040 B = 0.0000 Δ = 0.0040x = 1.78 A = 0.0080 B = 0.0220 Δ = -0.0140x = 1.79 A = 0.0220 B = 0.0320 Δ = -0.0100x = 1.80 A = 0.0260 B = 0.0400 Δ = -0.0140x = 1.81 A = 0.0600 B = 0.0460 Δ = 0.0140x = 1.83 A = 0.0700 B = 0.0640 Δ = 0.0060x = 1.84 A = 0.0840 B = 0.0980 Δ = -0.0140x = 1.85 A = 0.0900 B = 0.1080 Δ = -0.0180x = 1.86 A = 0.1200 B = 0.1080 Δ = 0.0120x = 1.87 A = 0.1200 B = 0.1120 Δ = 0.0080x = 1.88 A = 0.1080 B = 0.0840 Δ = 0.0240x = 1.89 A = 0.0740 B = 0.0840 Δ = -0.0100x = 1.90 A = 0.0860 B = 0.0760 Δ = 0.0100x = 1.92 A = 0.0420 B = 0.0480 Δ = -0.0060x = 1.93 A = 0.0280 B = 0.0280 Δ = 0.0000x = 1.94 A = 0.0180 B = 0.0220 Δ = -0.0040x = 1.95 A = 0.0180 B = 0.0140 Δ = 0.0040x = 1.96 A = 0.0100 B = 0.0060 Δ = 0.0040x = 1.97 A = 0.0020 B = 0.0020 Δ = 0.0000x = 1.98 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.99 A = 0.0000 B = 0.0020 Δ = -0.0020x = 2.00 A = 0.0040 B = 0.0000 Δ = 0.0040
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0156 ≤ tol 0.0584 · floors 0.0292/0.0186
posteriordb-nes1992 / nes
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma) stan pass 0.0145
00 statement source: posteriordb/nes1992-nes
given

For each of N = 1350 survey respondents, the data provide a party identification score (partyid7), an ideological self-placement score (real_ideo), a race-adjusted value (race_adj), education level (educ1), gender indicator (gender), income level (income), and an age group indicator (age_discrete, an integer in 1, 2, 3, 4 where 1 represents under 30, 2 represents 30-44, 3 represents 45-64, and 4 represents 65+). The regression has nine coefficients: an intercept (beta[1]), a slope for real_ideo (beta[2]), a slope for race_adj (beta[3]), three slopes for age group indicators coded as 30-44 (beta[4]), 45-64 (beta[5]), and 65+ (beta[6]) with under-30 as the reference level, slopes for educ1 (beta[7]), gender (beta[8]), and income (beta[9]). Each regression coefficient has an improper uniform (flat) prior over the reals. The error standard deviation sigma, constrained positive, has an improper uniform prior over the positive reals.

model

Each respondent's party identification score is normally distributed with a mean equal to the intercept plus the sum of products of slopes and predictors (ideological self-placement, race adjustment, age group indicators, education, gender, and income), and a common standard deviation sigma across all respondents.

query

The marginal posterior distributions of each of the ten parameters: the intercept (beta[1]), the coefficient for ideological self-placement (beta[2]), the coefficient for race adjustment (beta[3]), the coefficients for the three age group indicators, 30-44 years old (beta[4]), 45-64 years old (beta[5]), and 65 and older (beta[6]), the coefficient for education (beta[7]), the coefficient for gender (beta[8]), the coefficient for income (beta[9]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.014
stan
1data {
2 int<lower=0> N;
3 vector[N] partyid7;
4 vector[N] real_ideo;
5 vector[N] race_adj;
6 vector[N] educ1;
7 vector[N] gender;
8 vector[N] income;
9 array[N] int age_discrete;
10}
11transformed data {
12 vector[N] age30_44; // age as factor
13 vector[N] age45_64;
14 vector[N] age65up;
15
16 for (n in 1 : N) {
17 age30_44[n] = age_discrete[n] == 2;
18 age45_64[n] = age_discrete[n] == 3;
19 age65up[n] = age_discrete[n] == 4;
20 }
21}
22parameters {
23 vector[9] beta;
24 real<lower=0> sigma;
25}
26model {
27 // vectorization
28 partyid7 ~ normal(beta[1] + beta[2] * real_ideo + beta[3] * race_adj
29 + beta[4] * age30_44 + beta[5] * age45_64
30 + beta[6] * age65up + beta[7] * educ1 + beta[8] * gender
31 + beta[9] * income, sigma);
32}
33
34//@ DATA { N: 1350, age_discrete: [1350 values], educ1: [1350 values], gender: [1350 values], income: [1350 values], partyid7: [1350 values], race_adj: [1350 values], real_ideo: [1350 values] } // values supplied at runtime
35//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","beta[8]","beta[9]","sigma"]
36//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
37
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
beta[1]
reference stan24 bins · 0.31 … 2.71
00.070.070.150.15121.56 · 0.1261.35 · 0.146x = 0.31 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.42 A = 0.0020 B = 0.0100 Δ = -0.0080x = 0.52 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.63 A = 0.0020 B = 0.0100 Δ = -0.0080x = 0.73 A = 0.0100 B = 0.0100 Δ = 0.0000x = 0.83 A = 0.0220 B = 0.0180 Δ = 0.0040x = 0.94 A = 0.0380 B = 0.0320 Δ = 0.0060x = 1.04 A = 0.0520 B = 0.0540 Δ = -0.0020x = 1.15 A = 0.0640 B = 0.0740 Δ = -0.0100x = 1.25 A = 0.1200 B = 0.1160 Δ = 0.0040x = 1.35 A = 0.1000 B = 0.1460 Δ = -0.0460x = 1.46 A = 0.0860 B = 0.1160 Δ = -0.0300x = 1.56 A = 0.1260 B = 0.1000 Δ = 0.0260x = 1.67 A = 0.0980 B = 0.0720 Δ = 0.0260x = 1.77 A = 0.0880 B = 0.0720 Δ = 0.0160x = 1.87 A = 0.0480 B = 0.0700 Δ = -0.0220x = 1.98 A = 0.0520 B = 0.0340 Δ = 0.0180x = 2.08 A = 0.0440 B = 0.0260 Δ = 0.0180x = 2.19 A = 0.0240 B = 0.0100 Δ = 0.0140x = 2.29 A = 0.0140 B = 0.0160 Δ = -0.0020x = 2.39 A = 0.0020 B = 0.0020 Δ = 0.0000x = 2.50 A = 0.0020 B = 0.0040 Δ = -0.0020x = 2.60 A = 0.0000 B = 0.0000 Δ = 0.0000x = 2.71 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[2]
reference stan24 bins · 0.61 … 0.80
00.060.060.120.120.700.800.73 · 0.1120.72 · 0.122x = 0.61 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.62 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.62 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.63 A = 0.0200 B = 0.0060 Δ = 0.0140x = 0.64 A = 0.0060 B = 0.0080 Δ = -0.0020x = 0.65 A = 0.0200 B = 0.0220 Δ = -0.0020x = 0.66 A = 0.0340 B = 0.0340 Δ = 0.0000x = 0.67 A = 0.0360 B = 0.0280 Δ = 0.0080x = 0.67 A = 0.0620 B = 0.0840 Δ = -0.0220x = 0.68 A = 0.0800 B = 0.0560 Δ = 0.0240x = 0.69 A = 0.0660 B = 0.0920 Δ = -0.0260x = 0.70 A = 0.1000 B = 0.0940 Δ = 0.0060x = 0.71 A = 0.1000 B = 0.1080 Δ = -0.0080x = 0.72 A = 0.0940 B = 0.1220 Δ = -0.0280x = 0.73 A = 0.1120 B = 0.0780 Δ = 0.0340x = 0.73 A = 0.0720 B = 0.0640 Δ = 0.0080x = 0.74 A = 0.0480 B = 0.0740 Δ = -0.0260x = 0.75 A = 0.0600 B = 0.0540 Δ = 0.0060x = 0.76 A = 0.0340 B = 0.0300 Δ = 0.0040x = 0.77 A = 0.0160 B = 0.0180 Δ = -0.0020x = 0.78 A = 0.0160 B = 0.0100 Δ = 0.0060x = 0.78 A = 0.0120 B = 0.0080 Δ = 0.0040x = 0.79 A = 0.0040 B = 0.0080 Δ = -0.0040x = 0.80 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[3]
reference stan24 bins · -1.84 … -0.81
00.060.060.130.13-1.50-1-1.26 · 0.128-1.26 · 0.120x = -1.84 A = 0.0020 B = 0.0000 Δ = 0.0020x = -1.80 A = 0.0020 B = 0.0000 Δ = 0.0020x = -1.75 A = 0.0060 B = 0.0000 Δ = 0.0060x = -1.71 A = 0.0120 B = 0.0080 Δ = 0.0040x = -1.66 A = 0.0060 B = 0.0060 Δ = 0.0000x = -1.62 A = 0.0300 B = 0.0240 Δ = 0.0060x = -1.57 A = 0.0500 B = 0.0440 Δ = 0.0060x = -1.53 A = 0.0660 B = 0.0440 Δ = 0.0220x = -1.48 A = 0.0600 B = 0.0600 Δ = 0.0000x = -1.44 A = 0.0980 B = 0.0740 Δ = 0.0240x = -1.39 A = 0.0940 B = 0.1140 Δ = -0.0200x = -1.35 A = 0.1140 B = 0.1120 Δ = 0.0020x = -1.30 A = 0.0980 B = 0.1160 Δ = -0.0180x = -1.26 A = 0.1280 B = 0.1200 Δ = 0.0080x = -1.21 A = 0.0860 B = 0.0980 Δ = -0.0120x = -1.17 A = 0.0680 B = 0.0680 Δ = 0.0000x = -1.12 A = 0.0300 B = 0.0520 Δ = -0.0220x = -1.08 A = 0.0300 B = 0.0280 Δ = 0.0020x = -1.03 A = 0.0080 B = 0.0080 Δ = 0.0000x = -0.99 A = 0.0060 B = 0.0140 Δ = -0.0080x = -0.94 A = 0.0040 B = 0.0060 Δ = -0.0020x = -0.90 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.85 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.81 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[4]
reference stan24 bins · -0.71 … 0.18
00.060.060.120.12-0.500-0.24 · 0.120-0.24 · 0.122x = -0.71 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.67 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.63 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.59 A = 0.0020 B = 0.0100 Δ = -0.0080x = -0.56 A = 0.0060 B = 0.0000 Δ = 0.0060x = -0.52 A = 0.0180 B = 0.0220 Δ = -0.0040x = -0.48 A = 0.0240 B = 0.0340 Δ = -0.0100x = -0.44 A = 0.0280 B = 0.0180 Δ = 0.0100x = -0.40 A = 0.0460 B = 0.0320 Δ = 0.0140x = -0.36 A = 0.0500 B = 0.0620 Δ = -0.0120x = -0.32 A = 0.0700 B = 0.0580 Δ = 0.0120x = -0.28 A = 0.0920 B = 0.0800 Δ = 0.0120x = -0.24 A = 0.1200 B = 0.1220 Δ = -0.0020x = -0.20 A = 0.1040 B = 0.1220 Δ = -0.0180x = -0.17 A = 0.0900 B = 0.0980 Δ = -0.0080x = -0.13 A = 0.1000 B = 0.0800 Δ = 0.0200x = -0.09 A = 0.0660 B = 0.1000 Δ = -0.0340x = -0.05 A = 0.0620 B = 0.0540 Δ = 0.0080x = -0.01 A = 0.0540 B = 0.0540 Δ = 0.0000x = 0.03 A = 0.0240 B = 0.0340 Δ = -0.0100x = 0.07 A = 0.0260 B = 0.0080 Δ = 0.0180x = 0.11 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.14 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.18 A = 0.0040 B = 0.0000 Δ = 0.0040
beta[5]
reference stan24 bins · -0.99 … -0.09
00.060.060.110.11-0.50-0.48 · 0.112-0.56 · 0.108x = -0.99 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.95 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.91 A = 0.0040 B = 0.0060 Δ = -0.0020x = -0.87 A = 0.0120 B = 0.0060 Δ = 0.0060x = -0.83 A = 0.0180 B = 0.0180 Δ = 0.0000x = -0.79 A = 0.0120 B = 0.0120 Δ = 0.0000x = -0.76 A = 0.0140 B = 0.0200 Δ = -0.0060x = -0.72 A = 0.0460 B = 0.0340 Δ = 0.0120x = -0.68 A = 0.0580 B = 0.0540 Δ = 0.0040x = -0.64 A = 0.0500 B = 0.0620 Δ = -0.0120x = -0.60 A = 0.0960 B = 0.0820 Δ = 0.0140x = -0.56 A = 0.0960 B = 0.1080 Δ = -0.0120x = -0.52 A = 0.0940 B = 0.0960 Δ = -0.0020x = -0.48 A = 0.1120 B = 0.0860 Δ = 0.0260x = -0.44 A = 0.0880 B = 0.1000 Δ = -0.0120x = -0.40 A = 0.0600 B = 0.0840 Δ = -0.0240x = -0.36 A = 0.0840 B = 0.0580 Δ = 0.0260x = -0.32 A = 0.0440 B = 0.0720 Δ = -0.0280x = -0.28 A = 0.0400 B = 0.0400 Δ = 0.0000x = -0.24 A = 0.0260 B = 0.0160 Δ = 0.0100x = -0.21 A = 0.0180 B = 0.0240 Δ = -0.0060x = -0.17 A = 0.0140 B = 0.0040 Δ = 0.0100x = -0.13 A = 0.0060 B = 0.0100 Δ = -0.0040x = -0.09 A = 0.0060 B = 0.0040 Δ = 0.0020
beta[6]
reference stan24 bins · -0.92 … 0.04
00.050.050.110.11-0.500-0.42 · 0.096-0.38 · 0.108x = -0.92 A = 0.0040 B = 0.0020 Δ = 0.0020x = -0.88 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.84 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.80 A = 0.0080 B = 0.0040 Δ = 0.0040x = -0.75 A = 0.0100 B = 0.0220 Δ = -0.0120x = -0.71 A = 0.0160 B = 0.0240 Δ = -0.0080x = -0.67 A = 0.0420 B = 0.0360 Δ = 0.0060x = -0.63 A = 0.0520 B = 0.0260 Δ = 0.0260x = -0.58 A = 0.0580 B = 0.0520 Δ = 0.0060x = -0.54 A = 0.0780 B = 0.0620 Δ = 0.0160x = -0.50 A = 0.0680 B = 0.0900 Δ = -0.0220x = -0.46 A = 0.0860 B = 0.0860 Δ = 0.0000x = -0.42 A = 0.0960 B = 0.0820 Δ = 0.0140x = -0.38 A = 0.0880 B = 0.1080 Δ = -0.0200x = -0.33 A = 0.0820 B = 0.0940 Δ = -0.0120x = -0.29 A = 0.0940 B = 0.0800 Δ = 0.0140x = -0.25 A = 0.0640 B = 0.0760 Δ = -0.0120x = -0.21 A = 0.0580 B = 0.0600 Δ = -0.0020x = -0.17 A = 0.0380 B = 0.0320 Δ = 0.0060x = -0.12 A = 0.0200 B = 0.0180 Δ = 0.0020x = -0.08 A = 0.0100 B = 0.0160 Δ = -0.0060x = -0.04 A = 0.0140 B = 0.0100 Δ = 0.0040x = 0.00 A = 0.0080 B = 0.0100 Δ = -0.0020x = 0.04 A = 0.0020 B = 0.0100 Δ = -0.0080
beta[7]
reference stan24 bins · 0.12 … 0.44
00.050.050.100.100.200.400.27 · 0.1040.30 · 0.096x = 0.12 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.13 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.15 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.16 A = 0.0160 B = 0.0080 Δ = 0.0080x = 0.17 A = 0.0100 B = 0.0160 Δ = -0.0060x = 0.19 A = 0.0320 B = 0.0360 Δ = -0.0040x = 0.20 A = 0.0480 B = 0.0340 Δ = 0.0140x = 0.22 A = 0.0380 B = 0.0480 Δ = -0.0100x = 0.23 A = 0.0720 B = 0.0620 Δ = 0.0100x = 0.24 A = 0.0820 B = 0.0740 Δ = 0.0080x = 0.26 A = 0.0860 B = 0.0800 Δ = 0.0060x = 0.27 A = 0.1040 B = 0.0940 Δ = 0.0100x = 0.29 A = 0.0920 B = 0.0960 Δ = -0.0040x = 0.30 A = 0.0860 B = 0.0960 Δ = -0.0100x = 0.31 A = 0.0860 B = 0.0740 Δ = 0.0120x = 0.33 A = 0.0820 B = 0.0700 Δ = 0.0120x = 0.34 A = 0.0520 B = 0.0640 Δ = -0.0120x = 0.36 A = 0.0380 B = 0.0580 Δ = -0.0200x = 0.37 A = 0.0280 B = 0.0300 Δ = -0.0020x = 0.38 A = 0.0100 B = 0.0240 Δ = -0.0140x = 0.40 A = 0.0120 B = 0.0120 Δ = 0.0000x = 0.41 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.42 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.44 A = 0.0040 B = 0.0040 Δ = 0.0000
beta[8]
reference stan24 bins · -0.34 … 0.21
00.050.050.100.10-0.2000.20-0.08 · 0.094-0.03 · 0.102x = -0.34 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.32 A = 0.0040 B = 0.0100 Δ = -0.0060x = -0.29 A = 0.0180 B = 0.0180 Δ = 0.0000x = -0.27 A = 0.0080 B = 0.0120 Δ = -0.0040x = -0.24 A = 0.0120 B = 0.0220 Δ = -0.0100x = -0.22 A = 0.0360 B = 0.0340 Δ = 0.0020x = -0.20 A = 0.0300 B = 0.0460 Δ = -0.0160x = -0.17 A = 0.0560 B = 0.0400 Δ = 0.0160x = -0.15 A = 0.0660 B = 0.0680 Δ = -0.0020x = -0.13 A = 0.0920 B = 0.0640 Δ = 0.0280x = -0.10 A = 0.0840 B = 0.0980 Δ = -0.0140x = -0.08 A = 0.0940 B = 0.0700 Δ = 0.0240x = -0.06 A = 0.0620 B = 0.0900 Δ = -0.0280x = -0.03 A = 0.0880 B = 0.1020 Δ = -0.0140x = -0.01 A = 0.0780 B = 0.0940 Δ = -0.0160x = 0.02 A = 0.0680 B = 0.0540 Δ = 0.0140x = 0.04 A = 0.0600 B = 0.0500 Δ = 0.0100x = 0.06 A = 0.0640 B = 0.0600 Δ = 0.0040x = 0.09 A = 0.0320 B = 0.0300 Δ = 0.0020x = 0.11 A = 0.0300 B = 0.0120 Δ = 0.0180x = 0.14 A = 0.0100 B = 0.0140 Δ = -0.0040x = 0.16 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.18 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.21 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[9]
reference stan24 bins · -0.02 … 0.28
00.060.060.130.1300.200.13 · 0.1060.14 · 0.126x = -0.02 A = 0.0000 B = 0.0040 Δ = -0.0040x = -0.01 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.01 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.02 A = 0.0060 B = 0.0080 Δ = -0.0020x = 0.03 A = 0.0120 B = 0.0160 Δ = -0.0040x = 0.04 A = 0.0240 B = 0.0160 Δ = 0.0080x = 0.06 A = 0.0460 B = 0.0380 Δ = 0.0080x = 0.07 A = 0.0460 B = 0.0540 Δ = -0.0080x = 0.09 A = 0.0820 B = 0.0620 Δ = 0.0200x = 0.10 A = 0.0900 B = 0.0560 Δ = 0.0340x = 0.11 A = 0.0740 B = 0.1100 Δ = -0.0360x = 0.13 A = 0.1060 B = 0.0840 Δ = 0.0220x = 0.14 A = 0.1060 B = 0.1260 Δ = -0.0200x = 0.15 A = 0.1020 B = 0.0900 Δ = 0.0120x = 0.17 A = 0.0960 B = 0.0940 Δ = 0.0020x = 0.18 A = 0.0580 B = 0.0800 Δ = -0.0220x = 0.19 A = 0.0520 B = 0.0500 Δ = 0.0020x = 0.20 A = 0.0360 B = 0.0240 Δ = 0.0120x = 0.22 A = 0.0200 B = 0.0320 Δ = -0.0120x = 0.23 A = 0.0180 B = 0.0200 Δ = -0.0020x = 0.24 A = 0.0140 B = 0.0160 Δ = -0.0020x = 0.26 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.27 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.28 A = 0.0020 B = 0.0040 Δ = -0.0020
sigma
reference stan24 bins · 1.69 … 1.92
00.060.060.110.111.701.801.901.79 · 0.1141.78 · 0.112x = 1.69 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.70 A = 0.0020 B = 0.0040 Δ = -0.0020x = 1.71 A = 0.0060 B = 0.0060 Δ = 0.0000x = 1.72 A = 0.0100 B = 0.0220 Δ = -0.0120x = 1.73 A = 0.0200 B = 0.0200 Δ = 0.0000x = 1.74 A = 0.0280 B = 0.0620 Δ = -0.0340x = 1.75 A = 0.0580 B = 0.0500 Δ = 0.0080x = 1.76 A = 0.0740 B = 0.0960 Δ = -0.0220x = 1.77 A = 0.1040 B = 0.0780 Δ = 0.0260x = 1.78 A = 0.1060 B = 0.1120 Δ = -0.0060x = 1.79 A = 0.1140 B = 0.1060 Δ = 0.0080x = 1.80 A = 0.1060 B = 0.0920 Δ = 0.0140x = 1.81 A = 0.1060 B = 0.1080 Δ = -0.0020x = 1.82 A = 0.0820 B = 0.0720 Δ = 0.0100x = 1.83 A = 0.0700 B = 0.0560 Δ = 0.0140x = 1.84 A = 0.0600 B = 0.0480 Δ = 0.0120x = 1.85 A = 0.0260 B = 0.0260 Δ = -0.0000x = 1.86 A = 0.0040 B = 0.0200 Δ = -0.0160x = 1.87 A = 0.0160 B = 0.0140 Δ = 0.0020x = 1.88 A = 0.0040 B = 0.0060 Δ = -0.0020x = 1.89 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.90 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.91 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.92 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0145 ≤ tol 0.0585 · floors 0.0293/0.0170
posteriordb-nes1996 / nes
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma) stan pass 0.0138
00 statement source: posteriordb/nes1996-nes
given

For each of N respondents, the data provide seven measurements: ideology on the liberal-conservative spectrum (real_ideo), race (race_adj), education level (educ1), gender (binary), income level (income), and age group as an integer in {1, 2, 3, 4}. The regression has nine coefficients: an intercept and eight slopes, corresponding to ideology, race, three age-group indicators (age 30-44, age 45-64, age 65-plus, with age group 1 as the reference category), education, gender, and income. Each coefficient, including the intercept, has a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

For each respondent, the response partyid7 is modeled as normally distributed with a linear predictor and a common standard deviation sigma. The linear predictor is the intercept plus the sum of the eight slope coefficients each multiplied by the corresponding predictor: ideology, race, three binary age-group indicators (which are deterministically constructed from the discrete age variable, with age group 1 as the reference), education, gender, and income. The three age indicators are one if the respondent belongs to that age group and zero otherwise.

query

The marginal posterior distributions of the nine regression coefficients (the intercept reported as beta[1], and the eight slopes reported as beta[2] through beta[9] for ideology, race, age 30-44, age 45-64, age 65-plus, education, gender, and income respectively) and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.014
stan
1data {
2 int<lower=0> N;
3 vector[N] partyid7;
4 vector[N] real_ideo;
5 vector[N] race_adj;
6 vector[N] educ1;
7 vector[N] gender;
8 vector[N] income;
9 array[N] int age_discrete;
10}
11transformed data {
12 vector[N] age30_44; // age as factor
13 vector[N] age45_64;
14 vector[N] age65up;
15
16 for (n in 1 : N) {
17 age30_44[n] = age_discrete[n] == 2;
18 age45_64[n] = age_discrete[n] == 3;
19 age65up[n] = age_discrete[n] == 4;
20 }
21}
22parameters {
23 vector[9] beta;
24 real<lower=0> sigma;
25}
26model {
27 // vectorization
28 partyid7 ~ normal(beta[1] + beta[2] * real_ideo + beta[3] * race_adj
29 + beta[4] * age30_44 + beta[5] * age45_64
30 + beta[6] * age65up + beta[7] * educ1 + beta[8] * gender
31 + beta[9] * income, sigma);
32}
33
34//@ DATA { N: 1043, age_discrete: [1043 values], educ1: [1043 values], gender: [1043 values], income: [1043 values], partyid7: [1043 values], race_adj: [1043 values], real_ideo: [1043 values] } // values supplied at runtime
35//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","beta[8]","beta[9]","sigma"]
36//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
37
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
beta[1]
reference stan24 bins · -1.34 … 1.33
00.060.060.110.11-1010.17 · 0.098-0.07 · 0.110x = -1.34 A = 0.0020 B = 0.0020 Δ = 0.0000x = -1.23 A = 0.0000 B = 0.0000 Δ = 0.0000x = -1.11 A = 0.0060 B = 0.0040 Δ = 0.0020x = -0.99 A = 0.0060 B = 0.0080 Δ = -0.0020x = -0.88 A = 0.0220 B = 0.0260 Δ = -0.0040x = -0.76 A = 0.0320 B = 0.0340 Δ = -0.0020x = -0.65 A = 0.0300 B = 0.0340 Δ = -0.0040x = -0.53 A = 0.0560 B = 0.0600 Δ = -0.0040x = -0.41 A = 0.0700 B = 0.0680 Δ = 0.0020x = -0.30 A = 0.0880 B = 0.0720 Δ = 0.0160x = -0.18 A = 0.0840 B = 0.0840 Δ = -0.0000x = -0.07 A = 0.0860 B = 0.1100 Δ = -0.0240x = 0.05 A = 0.0940 B = 0.0820 Δ = 0.0120x = 0.17 A = 0.0980 B = 0.0860 Δ = 0.0120x = 0.28 A = 0.0820 B = 0.0660 Δ = 0.0160x = 0.40 A = 0.0740 B = 0.0720 Δ = 0.0020x = 0.52 A = 0.0560 B = 0.0620 Δ = -0.0060x = 0.63 A = 0.0580 B = 0.0520 Δ = 0.0060x = 0.75 A = 0.0240 B = 0.0340 Δ = -0.0100x = 0.86 A = 0.0080 B = 0.0140 Δ = -0.0060x = 0.98 A = 0.0160 B = 0.0140 Δ = 0.0020x = 1.10 A = 0.0060 B = 0.0040 Δ = 0.0020x = 1.21 A = 0.0020 B = 0.0100 Δ = -0.0080x = 1.33 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[2]
reference stan24 bins · 0.80 … 1.05
00.060.060.130.130.800.9010.96 · 0.1100.94 · 0.130x = 0.80 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.81 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.82 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.83 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.84 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.85 A = 0.0120 B = 0.0100 Δ = 0.0020x = 0.86 A = 0.0120 B = 0.0160 Δ = -0.0040x = 0.87 A = 0.0380 B = 0.0320 Δ = 0.0060x = 0.89 A = 0.0440 B = 0.0580 Δ = -0.0140x = 0.90 A = 0.0680 B = 0.0680 Δ = 0.0000x = 0.91 A = 0.0900 B = 0.0940 Δ = -0.0040x = 0.92 A = 0.1020 B = 0.1260 Δ = -0.0240x = 0.93 A = 0.1060 B = 0.0920 Δ = 0.0140x = 0.94 A = 0.0980 B = 0.1300 Δ = -0.0320x = 0.95 A = 0.0920 B = 0.0960 Δ = -0.0040x = 0.96 A = 0.1100 B = 0.0620 Δ = 0.0480x = 0.97 A = 0.0840 B = 0.0680 Δ = 0.0160x = 0.98 A = 0.0580 B = 0.0560 Δ = 0.0020x = 1.00 A = 0.0340 B = 0.0220 Δ = 0.0120x = 1.01 A = 0.0160 B = 0.0280 Δ = -0.0120x = 1.02 A = 0.0220 B = 0.0120 Δ = 0.0100x = 1.03 A = 0.0000 B = 0.0040 Δ = -0.0040x = 1.04 A = 0.0040 B = 0.0100 Δ = -0.0060x = 1.05 A = 0.0000 B = 0.0040 Δ = -0.0040
beta[3]
reference stan24 bins · -1.67 … -0.71
00.050.050.110.11-1.50-1-1.21 · 0.106-1.21 · 0.090x = -1.67 A = 0.0040 B = 0.0020 Δ = 0.0020x = -1.63 A = 0.0020 B = 0.0040 Δ = -0.0020x = -1.59 A = 0.0060 B = 0.0180 Δ = -0.0120x = -1.55 A = 0.0220 B = 0.0340 Δ = -0.0120x = -1.51 A = 0.0220 B = 0.0260 Δ = -0.0040x = -1.46 A = 0.0420 B = 0.0220 Δ = 0.0200x = -1.42 A = 0.0420 B = 0.0620 Δ = -0.0200x = -1.38 A = 0.0740 B = 0.0660 Δ = 0.0080x = -1.34 A = 0.0980 B = 0.0760 Δ = 0.0220x = -1.30 A = 0.0780 B = 0.0880 Δ = -0.0100x = -1.25 A = 0.0780 B = 0.0760 Δ = 0.0020x = -1.21 A = 0.1060 B = 0.0900 Δ = 0.0160x = -1.17 A = 0.0860 B = 0.0860 Δ = -0.0000x = -1.13 A = 0.0780 B = 0.0900 Δ = -0.0120x = -1.08 A = 0.0860 B = 0.0660 Δ = 0.0200x = -1.04 A = 0.0660 B = 0.0380 Δ = 0.0280x = -1.00 A = 0.0400 B = 0.0440 Δ = -0.0040x = -0.96 A = 0.0380 B = 0.0440 Δ = -0.0060x = -0.92 A = 0.0100 B = 0.0260 Δ = -0.0160x = -0.88 A = 0.0120 B = 0.0220 Δ = -0.0100x = -0.83 A = 0.0040 B = 0.0080 Δ = -0.0040x = -0.79 A = 0.0020 B = 0.0060 Δ = -0.0040x = -0.75 A = 0.0040 B = 0.0040 Δ = 0.0000x = -0.71 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[4]
reference stan24 bins · -0.62 … 0.46
00.060.060.120.12-0.5000.08 · 0.120-0.01 · 0.118x = -0.62 A = 0.0000 B = 0.0040 Δ = -0.0040x = -0.57 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.52 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.48 A = 0.0020 B = 0.0060 Δ = -0.0040x = -0.43 A = 0.0020 B = 0.0100 Δ = -0.0080x = -0.39 A = 0.0060 B = 0.0100 Δ = -0.0040x = -0.34 A = 0.0320 B = 0.0220 Δ = 0.0100x = -0.29 A = 0.0360 B = 0.0240 Δ = 0.0120x = -0.24 A = 0.0600 B = 0.0360 Δ = 0.0240x = -0.20 A = 0.0480 B = 0.0620 Δ = -0.0140x = -0.15 A = 0.0900 B = 0.0840 Δ = 0.0060x = -0.10 A = 0.1100 B = 0.1000 Δ = 0.0100x = -0.06 A = 0.0920 B = 0.1000 Δ = -0.0080x = -0.01 A = 0.0960 B = 0.1180 Δ = -0.0220x = 0.04 A = 0.0980 B = 0.0820 Δ = 0.0160x = 0.08 A = 0.1200 B = 0.1060 Δ = 0.0140x = 0.13 A = 0.0780 B = 0.0600 Δ = 0.0180x = 0.17 A = 0.0600 B = 0.0580 Δ = 0.0020x = 0.22 A = 0.0260 B = 0.0360 Δ = -0.0100x = 0.27 A = 0.0240 B = 0.0380 Δ = -0.0140x = 0.32 A = 0.0120 B = 0.0100 Δ = 0.0020x = 0.36 A = 0.0040 B = 0.0200 Δ = -0.0160x = 0.41 A = 0.0020 B = 0.0080 Δ = -0.0060x = 0.46 A = 0.0000 B = 0.0060 Δ = -0.0060
beta[5]
reference stan24 bins · -0.78 … 0.27
00.070.070.130.13-0.500-0.23 · 0.134-0.32 · 0.118x = -0.78 A = 0.0040 B = 0.0040 Δ = 0.0000x = -0.74 A = 0.0000 B = 0.0040 Δ = -0.0040x = -0.69 A = 0.0020 B = 0.0100 Δ = -0.0080x = -0.65 A = 0.0060 B = 0.0140 Δ = -0.0080x = -0.60 A = 0.0280 B = 0.0120 Δ = 0.0160x = -0.55 A = 0.0320 B = 0.0160 Δ = 0.0160x = -0.51 A = 0.0320 B = 0.0440 Δ = -0.0120x = -0.46 A = 0.0680 B = 0.0440 Δ = 0.0240x = -0.41 A = 0.0900 B = 0.0840 Δ = 0.0060x = -0.37 A = 0.0940 B = 0.0760 Δ = 0.0180x = -0.32 A = 0.0880 B = 0.1180 Δ = -0.0300x = -0.28 A = 0.0880 B = 0.1160 Δ = -0.0280x = -0.23 A = 0.1340 B = 0.0960 Δ = 0.0380x = -0.19 A = 0.0740 B = 0.0860 Δ = -0.0120x = -0.14 A = 0.0940 B = 0.0720 Δ = 0.0220x = -0.10 A = 0.0480 B = 0.0540 Δ = -0.0060x = -0.05 A = 0.0420 B = 0.0420 Δ = 0.0000x = -0.00 A = 0.0380 B = 0.0320 Δ = 0.0060x = 0.04 A = 0.0200 B = 0.0280 Δ = -0.0080x = 0.09 A = 0.0100 B = 0.0220 Δ = -0.0120x = 0.14 A = 0.0040 B = 0.0200 Δ = -0.0160x = 0.18 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.23 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.27 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[6]
reference stan24 bins · -0.77 … 0.42
00.060.060.130.13-0.500-0.20 · 0.120-0.10 · 0.128x = -0.77 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.71 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.66 A = 0.0000 B = 0.0040 Δ = -0.0040x = -0.61 A = 0.0020 B = 0.0040 Δ = -0.0020x = -0.56 A = 0.0100 B = 0.0060 Δ = 0.0040x = -0.51 A = 0.0140 B = 0.0160 Δ = -0.0020x = -0.46 A = 0.0220 B = 0.0280 Δ = -0.0060x = -0.40 A = 0.0460 B = 0.0320 Δ = 0.0140x = -0.35 A = 0.0460 B = 0.0340 Δ = 0.0120x = -0.30 A = 0.0840 B = 0.0660 Δ = 0.0180x = -0.25 A = 0.0620 B = 0.0660 Δ = -0.0040x = -0.20 A = 0.1200 B = 0.0720 Δ = 0.0480x = -0.15 A = 0.1100 B = 0.1100 Δ = 0.0000x = -0.10 A = 0.1040 B = 0.1280 Δ = -0.0240x = -0.04 A = 0.0920 B = 0.1080 Δ = -0.0160x = 0.01 A = 0.0760 B = 0.0800 Δ = -0.0040x = 0.06 A = 0.0600 B = 0.0680 Δ = -0.0080x = 0.11 A = 0.0500 B = 0.0500 Δ = 0.0000x = 0.16 A = 0.0460 B = 0.0540 Δ = -0.0080x = 0.21 A = 0.0260 B = 0.0260 Δ = 0.0000x = 0.27 A = 0.0160 B = 0.0220 Δ = -0.0060x = 0.32 A = 0.0100 B = 0.0100 Δ = 0.0000x = 0.37 A = 0.0020 B = 0.0100 Δ = -0.0080x = 0.42 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[7]
reference stan24 bins · 0.05 … 0.55
00.070.070.140.140.200.400.25 · 0.1380.23 · 0.140x = 0.05 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.07 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.10 A = 0.0040 B = 0.0080 Δ = -0.0040x = 0.12 A = 0.0140 B = 0.0200 Δ = -0.0060x = 0.14 A = 0.0240 B = 0.0260 Δ = -0.0020x = 0.16 A = 0.0500 B = 0.0480 Δ = 0.0020x = 0.18 A = 0.0820 B = 0.0620 Δ = 0.0200x = 0.20 A = 0.0960 B = 0.1080 Δ = -0.0120x = 0.23 A = 0.1080 B = 0.1400 Δ = -0.0320x = 0.25 A = 0.1380 B = 0.1260 Δ = 0.0120x = 0.27 A = 0.1240 B = 0.1200 Δ = 0.0040x = 0.29 A = 0.1220 B = 0.1080 Δ = 0.0140x = 0.31 A = 0.0780 B = 0.0900 Δ = -0.0120x = 0.33 A = 0.0620 B = 0.0640 Δ = -0.0020x = 0.35 A = 0.0400 B = 0.0240 Δ = 0.0160x = 0.37 A = 0.0380 B = 0.0240 Δ = 0.0140x = 0.40 A = 0.0100 B = 0.0100 Δ = 0.0000x = 0.42 A = 0.0020 B = 0.0080 Δ = -0.0060x = 0.44 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.46 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.48 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.50 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.52 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.55 A = 0.0000 B = 0.0020 Δ = -0.0020
beta[8]
reference stan24 bins · -0.39 … 0.25
00.050.050.110.110-0.03 · 0.1060.03 · 0.100x = -0.39 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.36 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.33 A = 0.0040 B = 0.0060 Δ = -0.0020x = -0.31 A = 0.0100 B = 0.0140 Δ = -0.0040x = -0.28 A = 0.0100 B = 0.0200 Δ = -0.0100x = -0.25 A = 0.0280 B = 0.0300 Δ = -0.0020x = -0.22 A = 0.0240 B = 0.0300 Δ = -0.0060x = -0.19 A = 0.0500 B = 0.0500 Δ = 0.0000x = -0.17 A = 0.0600 B = 0.0720 Δ = -0.0120x = -0.14 A = 0.0720 B = 0.0880 Δ = -0.0160x = -0.11 A = 0.0800 B = 0.0940 Δ = -0.0140x = -0.08 A = 0.0960 B = 0.0800 Δ = 0.0160x = -0.06 A = 0.1020 B = 0.0680 Δ = 0.0340x = -0.03 A = 0.1060 B = 0.0980 Δ = 0.0080x = 0.00 A = 0.1040 B = 0.0880 Δ = 0.0160x = 0.03 A = 0.0640 B = 0.1000 Δ = -0.0360x = 0.06 A = 0.0640 B = 0.0700 Δ = -0.0060x = 0.08 A = 0.0420 B = 0.0320 Δ = 0.0100x = 0.11 A = 0.0380 B = 0.0260 Δ = 0.0120x = 0.14 A = 0.0220 B = 0.0160 Δ = 0.0060x = 0.17 A = 0.0100 B = 0.0080 Δ = 0.0020x = 0.20 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.22 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.25 A = 0.0040 B = 0.0040 Δ = 0.0000
beta[9]
reference stan24 bins · 0.05 … 0.36
00.060.060.120.120.200.21 · 0.1220.22 · 0.116x = 0.05 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.06 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.07 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.09 A = 0.0100 B = 0.0060 Δ = 0.0040x = 0.10 A = 0.0160 B = 0.0240 Δ = -0.0080x = 0.11 A = 0.0180 B = 0.0260 Δ = -0.0080x = 0.13 A = 0.0440 B = 0.0420 Δ = 0.0020x = 0.14 A = 0.0540 B = 0.0580 Δ = -0.0040x = 0.15 A = 0.0620 B = 0.0580 Δ = 0.0040x = 0.17 A = 0.0840 B = 0.0560 Δ = 0.0280x = 0.18 A = 0.1000 B = 0.0700 Δ = 0.0300x = 0.20 A = 0.0580 B = 0.0780 Δ = -0.0200x = 0.21 A = 0.1220 B = 0.0880 Δ = 0.0340x = 0.22 A = 0.1060 B = 0.1160 Δ = -0.0100x = 0.24 A = 0.0940 B = 0.1080 Δ = -0.0140x = 0.25 A = 0.0640 B = 0.0560 Δ = 0.0080x = 0.27 A = 0.0400 B = 0.0720 Δ = -0.0320x = 0.28 A = 0.0480 B = 0.0580 Δ = -0.0100x = 0.29 A = 0.0360 B = 0.0340 Δ = 0.0020x = 0.30 A = 0.0180 B = 0.0120 Δ = 0.0060x = 0.32 A = 0.0080 B = 0.0120 Δ = -0.0040x = 0.33 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.35 A = 0.0000 B = 0.0040 Δ = -0.0040x = 0.36 A = 0.0060 B = 0.0040 Δ = 0.0020
sigma
reference stan24 bins · 1.58 … 1.79
00.050.050.110.111.601.701.67 · 0.1081.69 · 0.104x = 1.58 A = 0.0000 B = 0.0040 Δ = -0.0040x = 1.59 A = 0.0040 B = 0.0040 Δ = 0.0000x = 1.60 A = 0.0100 B = 0.0060 Δ = 0.0040x = 1.61 A = 0.0140 B = 0.0120 Δ = 0.0020x = 1.62 A = 0.0240 B = 0.0300 Δ = -0.0060x = 1.63 A = 0.0420 B = 0.0300 Δ = 0.0120x = 1.64 A = 0.0400 B = 0.0600 Δ = -0.0200x = 1.65 A = 0.0600 B = 0.0640 Δ = -0.0040x = 1.66 A = 0.0940 B = 0.0920 Δ = 0.0020x = 1.66 A = 0.0700 B = 0.0980 Δ = -0.0280x = 1.67 A = 0.1080 B = 0.1000 Δ = 0.0080x = 1.68 A = 0.1040 B = 0.0800 Δ = 0.0240x = 1.69 A = 0.1020 B = 0.1040 Δ = -0.0020x = 1.70 A = 0.0860 B = 0.0740 Δ = 0.0120x = 1.71 A = 0.0740 B = 0.0600 Δ = 0.0140x = 1.72 A = 0.0500 B = 0.0700 Δ = -0.0200x = 1.73 A = 0.0400 B = 0.0340 Δ = 0.0060x = 1.74 A = 0.0300 B = 0.0340 Δ = -0.0040x = 1.75 A = 0.0200 B = 0.0160 Δ = 0.0040x = 1.76 A = 0.0140 B = 0.0180 Δ = -0.0040x = 1.76 A = 0.0120 B = 0.0040 Δ = 0.0080x = 1.77 A = 0.0000 B = 0.0040 Δ = -0.0040x = 1.78 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.79 A = 0.0000 B = 0.0020 Δ = -0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0138 ≤ tol 0.0464 · floors 0.0162/0.0195
posteriordb-nes2000 / nes
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma) stan pass 0.0223
00 statement source: posteriordb/nes2000-nes
given

For each of N = 476 respondents, the data provide the respondent's party identification (on a 7-point scale), ideology score, race adjustment value, education code, gender, income code, and a discrete age group (1, 2, 3, or 4 representing age brackets including one reference age group and three comparison groups). The regression has nine coefficients: an intercept and eight slopes for the predictors (ideology, race adjustment, age groups 2/3/4, education, gender, and income). All nine coefficients have a flat (improper uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a flat (improper uniform) prior over the positive reals.

model

Each respondent's party identification is normally distributed with a mean equal to the intercept plus the sum of eight slope terms: the ideology coefficient times ideology, the race adjustment coefficient times race adjustment, three age group coefficients for age groups 2, 3, and 4 (with age group 1 as reference), an education coefficient times education, a gender coefficient times gender, and an income coefficient times income. The standard deviation of the response is sigma, common across all respondents.

query

The marginal posterior distribution of each of the ten parameters: the intercept (reported as beta[1]), the ideology coefficient (reported as beta[2]), the race adjustment coefficient (reported as beta[3]), the three age group coefficients (reported as beta[4], beta[5], beta[6] for age groups 2, 3, and 4 respectively), the education coefficient (reported as beta[7]), the gender coefficient (reported as beta[8]), the income coefficient (reported as beta[9]), and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.022
stan
1data {
2 int<lower=0> N;
3 vector[N] partyid7;
4 vector[N] real_ideo;
5 vector[N] race_adj;
6 vector[N] educ1;
7 vector[N] gender;
8 vector[N] income;
9 array[N] int age_discrete;
10}
11transformed data {
12 vector[N] age30_44; // age as factor
13 vector[N] age45_64;
14 vector[N] age65up;
15
16 for (n in 1 : N) {
17 age30_44[n] = age_discrete[n] == 2;
18 age45_64[n] = age_discrete[n] == 3;
19 age65up[n] = age_discrete[n] == 4;
20 }
21}
22parameters {
23 vector[9] beta;
24 real<lower=0> sigma;
25}
26model {
27 // vectorization
28 partyid7 ~ normal(beta[1] + beta[2] * real_ideo + beta[3] * race_adj
29 + beta[4] * age30_44 + beta[5] * age45_64
30 + beta[6] * age65up + beta[7] * educ1 + beta[8] * gender
31 + beta[9] * income, sigma);
32}
33
34//@ DATA { N: 476, age_discrete: [476 values], educ1: [476 values], gender: [476 values], income: [476 values], partyid7: [476 values], race_adj: [476 values], real_ideo: [476 values] } // values supplied at runtime
35//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","beta[8]","beta[9]","sigma"]
36//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
37
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], sigma)
beta[1]
reference stan24 bins · -1.71 … 3.16
00.060.060.110.11021.04 · 0.1081.47 · 0.112x = -1.71 A = 0.0020 B = 0.0000 Δ = 0.0020x = -1.50 A = 0.0000 B = 0.0000 Δ = 0.0000x = -1.29 A = 0.0040 B = 0.0060 Δ = -0.0020x = -1.07 A = 0.0040 B = 0.0060 Δ = -0.0020x = -0.86 A = 0.0040 B = 0.0080 Δ = -0.0040x = -0.65 A = 0.0160 B = 0.0100 Δ = 0.0060x = -0.44 A = 0.0360 B = 0.0300 Δ = 0.0060x = -0.23 A = 0.0360 B = 0.0560 Δ = -0.0200x = -0.02 A = 0.0660 B = 0.0540 Δ = 0.0120x = 0.20 A = 0.1020 B = 0.0760 Δ = 0.0260x = 0.41 A = 0.1000 B = 0.0900 Δ = 0.0100x = 0.62 A = 0.0940 B = 0.0720 Δ = 0.0220x = 0.83 A = 0.1000 B = 0.0960 Δ = 0.0040x = 1.04 A = 0.1080 B = 0.1060 Δ = 0.0020x = 1.25 A = 0.0820 B = 0.0980 Δ = -0.0160x = 1.47 A = 0.0540 B = 0.1120 Δ = -0.0580x = 1.68 A = 0.0780 B = 0.0700 Δ = 0.0080x = 1.89 A = 0.0560 B = 0.0440 Δ = 0.0120x = 2.10 A = 0.0240 B = 0.0340 Δ = -0.0100x = 2.31 A = 0.0140 B = 0.0260 Δ = -0.0120x = 2.52 A = 0.0120 B = 0.0040 Δ = 0.0080x = 2.74 A = 0.0000 B = 0.0000 Δ = 0.0000x = 2.95 A = 0.0040 B = 0.0020 Δ = 0.0020x = 3.16 A = 0.0040 B = 0.0000 Δ = 0.0040
beta[2]
reference stan24 bins · 0.62 … 0.93
00.060.060.110.110.800.81 · 0.1100.81 · 0.102x = 0.62 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.63 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.64 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.66 A = 0.0060 B = 0.0120 Δ = -0.0060x = 0.67 A = 0.0180 B = 0.0240 Δ = -0.0060x = 0.69 A = 0.0180 B = 0.0200 Δ = -0.0020x = 0.70 A = 0.0380 B = 0.0260 Δ = 0.0120x = 0.71 A = 0.0400 B = 0.0420 Δ = -0.0020x = 0.73 A = 0.0360 B = 0.0680 Δ = -0.0320x = 0.74 A = 0.0460 B = 0.0620 Δ = -0.0160x = 0.75 A = 0.0620 B = 0.0640 Δ = -0.0020x = 0.77 A = 0.0820 B = 0.0780 Δ = 0.0040x = 0.78 A = 0.0960 B = 0.0960 Δ = 0.0000x = 0.79 A = 0.0900 B = 0.0840 Δ = 0.0060x = 0.81 A = 0.1100 B = 0.1020 Δ = 0.0080x = 0.82 A = 0.0740 B = 0.0700 Δ = 0.0040x = 0.83 A = 0.0680 B = 0.0700 Δ = -0.0020x = 0.85 A = 0.0540 B = 0.0560 Δ = -0.0020x = 0.86 A = 0.0540 B = 0.0380 Δ = 0.0160x = 0.88 A = 0.0380 B = 0.0180 Δ = 0.0200x = 0.89 A = 0.0240 B = 0.0280 Δ = -0.0040x = 0.90 A = 0.0060 B = 0.0080 Δ = -0.0020x = 0.92 A = 0.0140 B = 0.0140 Δ = 0.0000x = 0.93 A = 0.0100 B = 0.0060 Δ = 0.0040
beta[3]
reference stan24 bins · -2.08 … -0.17
00.070.070.130.13-2-1-1.08 · 0.120-1.17 · 0.134x = -2.08 A = 0.0000 B = 0.0060 Δ = -0.0060x = -2.00 A = 0.0060 B = 0.0000 Δ = 0.0060x = -1.91 A = 0.0020 B = 0.0000 Δ = 0.0020x = -1.83 A = 0.0060 B = 0.0040 Δ = 0.0020x = -1.75 A = 0.0140 B = 0.0140 Δ = 0.0000x = -1.66 A = 0.0180 B = 0.0320 Δ = -0.0140x = -1.58 A = 0.0200 B = 0.0320 Δ = -0.0120x = -1.50 A = 0.0380 B = 0.0340 Δ = 0.0040x = -1.42 A = 0.0360 B = 0.0700 Δ = -0.0340x = -1.33 A = 0.0640 B = 0.0880 Δ = -0.0240x = -1.25 A = 0.1160 B = 0.0660 Δ = 0.0500x = -1.17 A = 0.1000 B = 0.1340 Δ = -0.0340x = -1.08 A = 0.1200 B = 0.0920 Δ = 0.0280x = -1 A = 0.1080 B = 0.0980 Δ = 0.0100x = -0.92 A = 0.1100 B = 0.0860 Δ = 0.0240x = -0.83 A = 0.0760 B = 0.0740 Δ = 0.0020x = -0.75 A = 0.0560 B = 0.0620 Δ = -0.0060x = -0.67 A = 0.0520 B = 0.0460 Δ = 0.0060x = -0.59 A = 0.0300 B = 0.0260 Δ = 0.0040x = -0.50 A = 0.0120 B = 0.0140 Δ = -0.0020x = -0.42 A = 0.0060 B = 0.0160 Δ = -0.0100x = -0.34 A = 0.0060 B = 0.0060 Δ = 0.0000x = -0.25 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.17 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[4]
reference stan24 bins · -1.29 … 0.46
00.070.070.140.14-10-0.46 · 0.142-0.46 · 0.104x = -1.29 A = 0.0040 B = 0.0020 Δ = 0.0020x = -1.22 A = 0.0000 B = 0.0060 Δ = -0.0060x = -1.14 A = 0.0060 B = 0.0120 Δ = -0.0060x = -1.07 A = 0.0100 B = 0.0160 Δ = -0.0060x = -0.99 A = 0.0220 B = 0.0220 Δ = 0.0000x = -0.92 A = 0.0220 B = 0.0380 Δ = -0.0160x = -0.84 A = 0.0320 B = 0.0460 Δ = -0.0140x = -0.76 A = 0.0620 B = 0.0760 Δ = -0.0140x = -0.69 A = 0.0720 B = 0.0620 Δ = 0.0100x = -0.61 A = 0.1040 B = 0.0940 Δ = 0.0100x = -0.53 A = 0.1020 B = 0.0860 Δ = 0.0160x = -0.46 A = 0.1420 B = 0.1040 Δ = 0.0380x = -0.38 A = 0.0860 B = 0.0780 Δ = 0.0080x = -0.31 A = 0.0880 B = 0.0880 Δ = 0.0000x = -0.23 A = 0.0740 B = 0.0720 Δ = 0.0020x = -0.15 A = 0.0540 B = 0.0640 Δ = -0.0100x = -0.08 A = 0.0300 B = 0.0460 Δ = -0.0160x = -0.00 A = 0.0300 B = 0.0420 Δ = -0.0120x = 0.07 A = 0.0280 B = 0.0180 Δ = 0.0100x = 0.15 A = 0.0120 B = 0.0140 Δ = -0.0020x = 0.23 A = 0.0100 B = 0.0040 Δ = 0.0060x = 0.30 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.38 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.46 A = 0.0000 B = 0.0040 Δ = -0.0040
beta[5]
reference stan24 bins · -1.57 … 0.18
00.060.060.130.13-10-0.73 · 0.126-0.73 · 0.104x = -1.57 A = 0.0000 B = 0.0040 Δ = -0.0040x = -1.49 A = 0.0020 B = 0.0020 Δ = 0.0000x = -1.42 A = 0.0040 B = 0.0140 Δ = -0.0100x = -1.34 A = 0.0200 B = 0.0260 Δ = -0.0060x = -1.26 A = 0.0160 B = 0.0180 Δ = -0.0020x = -1.19 A = 0.0240 B = 0.0320 Δ = -0.0080x = -1.11 A = 0.0580 B = 0.0500 Δ = 0.0080x = -1.03 A = 0.0440 B = 0.0620 Δ = -0.0180x = -0.96 A = 0.0700 B = 0.0660 Δ = 0.0040x = -0.88 A = 0.0800 B = 0.0840 Δ = -0.0040x = -0.81 A = 0.1060 B = 0.0980 Δ = 0.0080x = -0.73 A = 0.1260 B = 0.1040 Δ = 0.0220x = -0.65 A = 0.1140 B = 0.0900 Δ = 0.0240x = -0.58 A = 0.0940 B = 0.0880 Δ = 0.0060x = -0.50 A = 0.0640 B = 0.0640 Δ = 0.0000x = -0.42 A = 0.0600 B = 0.0640 Δ = -0.0040x = -0.35 A = 0.0360 B = 0.0520 Δ = -0.0160x = -0.27 A = 0.0260 B = 0.0280 Δ = -0.0020x = -0.20 A = 0.0260 B = 0.0180 Δ = 0.0080x = -0.12 A = 0.0120 B = 0.0180 Δ = -0.0060x = -0.04 A = 0.0100 B = 0.0020 Δ = 0.0080x = 0.03 A = 0.0040 B = 0.0140 Δ = -0.0100x = 0.11 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.18 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[6]
reference stan24 bins · -1.72 … 0.47
00.070.070.140.14-10-0.57 · 0.126-0.57 · 0.136x = -1.72 A = 0.0000 B = 0.0020 Δ = -0.0020x = -1.62 A = 0.0000 B = 0.0000 Δ = 0.0000x = -1.52 A = 0.0000 B = 0.0020 Δ = -0.0020x = -1.43 A = 0.0020 B = 0.0040 Δ = -0.0020x = -1.33 A = 0.0020 B = 0.0020 Δ = 0.0000x = -1.24 A = 0.0060 B = 0.0080 Δ = -0.0020x = -1.14 A = 0.0080 B = 0.0080 Δ = 0.0000x = -1.05 A = 0.0160 B = 0.0360 Δ = -0.0200x = -0.95 A = 0.0420 B = 0.0340 Δ = 0.0080x = -0.86 A = 0.0800 B = 0.0660 Δ = 0.0140x = -0.76 A = 0.0940 B = 0.0820 Δ = 0.0120x = -0.67 A = 0.1000 B = 0.0900 Δ = 0.0100x = -0.57 A = 0.1260 B = 0.1360 Δ = -0.0100x = -0.48 A = 0.0980 B = 0.1180 Δ = -0.0200x = -0.38 A = 0.1080 B = 0.1100 Δ = -0.0020x = -0.29 A = 0.0840 B = 0.0760 Δ = 0.0080x = -0.19 A = 0.0800 B = 0.0900 Δ = -0.0100x = -0.10 A = 0.0580 B = 0.0360 Δ = 0.0220x = -0.00 A = 0.0380 B = 0.0500 Δ = -0.0120x = 0.09 A = 0.0260 B = 0.0200 Δ = 0.0060x = 0.19 A = 0.0120 B = 0.0140 Δ = -0.0020x = 0.28 A = 0.0080 B = 0.0060 Δ = 0.0020x = 0.38 A = 0.0100 B = 0.0080 Δ = 0.0020x = 0.47 A = 0.0020 B = 0.0020 Δ = 0.0000
beta[7]
reference stan24 bins · -0.07 … 0.59
00.060.060.120.1200.500.22 · 0.1160.28 · 0.116x = -0.07 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.04 A = 0.0060 B = 0.0060 Δ = 0.0000x = -0.01 A = 0.0060 B = 0.0060 Δ = 0.0000x = 0.02 A = 0.0200 B = 0.0120 Δ = 0.0080x = 0.04 A = 0.0200 B = 0.0120 Δ = 0.0080x = 0.07 A = 0.0280 B = 0.0220 Δ = 0.0060x = 0.10 A = 0.0360 B = 0.0400 Δ = -0.0040x = 0.13 A = 0.0780 B = 0.0620 Δ = 0.0160x = 0.16 A = 0.0860 B = 0.1100 Δ = -0.0240x = 0.19 A = 0.0880 B = 0.0940 Δ = -0.0060x = 0.22 A = 0.1160 B = 0.1040 Δ = 0.0120x = 0.25 A = 0.1100 B = 0.1100 Δ = 0.0000x = 0.28 A = 0.0980 B = 0.1160 Δ = -0.0180x = 0.30 A = 0.0820 B = 0.0700 Δ = 0.0120x = 0.33 A = 0.0500 B = 0.0620 Δ = -0.0120x = 0.36 A = 0.0500 B = 0.0620 Δ = -0.0120x = 0.39 A = 0.0440 B = 0.0520 Δ = -0.0080x = 0.42 A = 0.0380 B = 0.0280 Δ = 0.0100x = 0.45 A = 0.0200 B = 0.0120 Δ = 0.0080x = 0.48 A = 0.0160 B = 0.0100 Δ = 0.0060x = 0.51 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.53 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.56 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.59 A = 0.0020 B = 0.0040 Δ = -0.0020
beta[8]
reference stan24 bins · -0.61 … 0.51
00.060.060.130.13-0.5000.50-0.13 · 0.126-0.03 · 0.112x = -0.61 A = 0.0020 B = 0.0020 Δ = 0.0000x = -0.56 A = 0.0000 B = 0.0020 Δ = -0.0020x = -0.52 A = 0.0080 B = 0.0060 Δ = 0.0020x = -0.47 A = 0.0160 B = 0.0120 Δ = 0.0040x = -0.42 A = 0.0120 B = 0.0180 Δ = -0.0060x = -0.37 A = 0.0380 B = 0.0340 Δ = 0.0040x = -0.32 A = 0.0520 B = 0.0380 Δ = 0.0140x = -0.27 A = 0.0720 B = 0.0800 Δ = -0.0080x = -0.22 A = 0.0820 B = 0.0880 Δ = -0.0060x = -0.17 A = 0.0980 B = 0.1000 Δ = -0.0020x = -0.13 A = 0.1260 B = 0.1060 Δ = 0.0200x = -0.08 A = 0.1140 B = 0.1060 Δ = 0.0080x = -0.03 A = 0.0980 B = 0.1120 Δ = -0.0140x = 0.02 A = 0.0980 B = 0.0880 Δ = 0.0100x = 0.07 A = 0.0560 B = 0.0840 Δ = -0.0280x = 0.12 A = 0.0420 B = 0.0600 Δ = -0.0180x = 0.17 A = 0.0420 B = 0.0260 Δ = 0.0160x = 0.22 A = 0.0180 B = 0.0220 Δ = -0.0040x = 0.27 A = 0.0120 B = 0.0040 Δ = 0.0080x = 0.32 A = 0.0000 B = 0.0060 Δ = -0.0060x = 0.36 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.41 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.46 A = 0.0020 B = 0.0040 Δ = -0.0020x = 0.51 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[9]
reference stan24 bins · -0.04 … 0.49
00.060.060.120.1200.200.400.23 · 0.1140.28 · 0.120x = -0.04 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.02 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.00 A = 0.0040 B = 0.0020 Δ = 0.0020x = 0.03 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.05 A = 0.0120 B = 0.0120 Δ = 0.0000x = 0.07 A = 0.0160 B = 0.0260 Δ = -0.0100x = 0.09 A = 0.0300 B = 0.0260 Δ = 0.0040x = 0.12 A = 0.0380 B = 0.0360 Δ = 0.0020x = 0.14 A = 0.0380 B = 0.0560 Δ = -0.0180x = 0.16 A = 0.0820 B = 0.0700 Δ = 0.0120x = 0.19 A = 0.0920 B = 0.0800 Δ = 0.0120x = 0.21 A = 0.0880 B = 0.0920 Δ = -0.0040x = 0.23 A = 0.1140 B = 0.1080 Δ = 0.0060x = 0.26 A = 0.0940 B = 0.1080 Δ = -0.0140x = 0.28 A = 0.0880 B = 0.1200 Δ = -0.0320x = 0.30 A = 0.1000 B = 0.0720 Δ = 0.0280x = 0.33 A = 0.0680 B = 0.0640 Δ = 0.0040x = 0.35 A = 0.0440 B = 0.0400 Δ = 0.0040x = 0.37 A = 0.0340 B = 0.0340 Δ = -0.0000x = 0.39 A = 0.0240 B = 0.0280 Δ = -0.0040x = 0.42 A = 0.0120 B = 0.0080 Δ = 0.0040x = 0.44 A = 0.0080 B = 0.0080 Δ = 0.0000x = 0.46 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.49 A = 0.0020 B = 0.0000 Δ = 0.0020
sigma
reference stan24 bins · 1.63 … 1.98
00.060.060.120.121.801.78 · 0.1221.79 · 0.112x = 1.63 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.64 A = 0.0060 B = 0.0020 Δ = 0.0040x = 1.66 A = 0.0060 B = 0.0060 Δ = 0.0000x = 1.67 A = 0.0120 B = 0.0160 Δ = -0.0040x = 1.69 A = 0.0220 B = 0.0080 Δ = 0.0140x = 1.70 A = 0.0260 B = 0.0480 Δ = -0.0220x = 1.72 A = 0.0700 B = 0.0680 Δ = 0.0020x = 1.73 A = 0.0620 B = 0.0600 Δ = 0.0020x = 1.75 A = 0.1160 B = 0.0880 Δ = 0.0280x = 1.76 A = 0.0940 B = 0.1020 Δ = -0.0080x = 1.78 A = 0.1220 B = 0.1000 Δ = 0.0220x = 1.79 A = 0.0880 B = 0.1120 Δ = -0.0240x = 1.81 A = 0.0860 B = 0.1060 Δ = -0.0200x = 1.83 A = 0.0780 B = 0.1100 Δ = -0.0320x = 1.84 A = 0.0700 B = 0.0520 Δ = 0.0180x = 1.86 A = 0.0480 B = 0.0500 Δ = -0.0020x = 1.87 A = 0.0400 B = 0.0260 Δ = 0.0140x = 1.89 A = 0.0120 B = 0.0100 Δ = 0.0020x = 1.90 A = 0.0160 B = 0.0200 Δ = -0.0040x = 1.92 A = 0.0080 B = 0.0080 Δ = 0.0000x = 1.93 A = 0.0080 B = 0.0040 Δ = 0.0040x = 1.95 A = 0.0000 B = 0.0040 Δ = -0.0040x = 1.97 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.98 A = 0.0060 B = 0.0000 Δ = 0.0060
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0223 ≤ tol 0.0797 · floors 0.0398/0.0326
posteriordb-nes_logit_data / nes_logit_model
answer record(alpha, beta[1]) stan pass 0.0070
00 statement source: posteriordb/nes_logit_data-nes_logit_model
given

Survey data from N = 1179 respondents from the National Election Study are provided. For each respondent, the income category income_i (a real-valued predictor, standardized) and the binary vote indicator vote_i (1 = voted Republican, 0 = otherwise) are recorded. The intercept alpha has an implicit improper flat prior (no explicit prior statement in the model). The income coefficient beta[1] has an implicit improper flat prior.

model

The probability that respondent i voted Republican is inv_logit(alpha + beta[1] * income_i). Each binary vote outcome is Bernoulli with that probability, independently across respondents.

query

The marginal posterior distribution of each parameter given the data: the intercept alpha and the income coefficient beta[1].

answer spec record(alpha, beta[1])
{
  "kind": "record",
  "fields": {
    "alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.007
stan
1data {
2 int<lower=0> N;
3 vector[N] income;
4 array[N] int<lower=0, upper=1> vote;
5}
6transformed data {
7 matrix[N, 1] x = [income']';
8}
9parameters {
10 real alpha;
11 vector[1] beta;
12}
13model {
14 vote ~ bernoulli_logit_glm(x, alpha, beta);
15}
16
17//@ DATA { income: [1179 values], N: 1179, vote: [1179 values] } // values supplied at runtime
18//@ PARAMS ["alpha","beta[1]"]
19//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
20
02answer overlay — reference vs stanrecord(alpha, beta[1])
alpha
reference stan24 bins · -1.95 … -0.74
00.060.060.130.13-1.50-1-1.47 · 0.128x = -1.95 A = 0.0020 B = 0.0000 Δ = 0.0020x = -1.89 A = 0.0040 B = 0.0000 Δ = 0.0040x = -1.84 A = 0.0060 B = 0.0000 Δ = 0.0060x = -1.79 A = 0.0160 B = 0.0000 Δ = 0.0160x = -1.74 A = 0.0180 B = 0.0000 Δ = 0.0180x = -1.68 A = 0.0320 B = 0.0000 Δ = 0.0320x = -1.63 A = 0.0560 B = 0.0000 Δ = 0.0560x = -1.58 A = 0.0780 B = 0.0000 Δ = 0.0780x = -1.53 A = 0.0800 B = 0.0000 Δ = 0.0800x = -1.47 A = 0.1280 B = 0.0000 Δ = 0.1280x = -1.42 A = 0.1020 B = 0.0000 Δ = 0.1020x = -1.37 A = 0.0960 B = 0.0000 Δ = 0.0960x = -1.32 A = 0.0980 B = 0.0000 Δ = 0.0980x = -1.26 A = 0.0880 B = 0.0000 Δ = 0.0880x = -1.21 A = 0.0760 B = 0.0000 Δ = 0.0760x = -1.16 A = 0.0440 B = 0.0000 Δ = 0.0440x = -1.11 A = 0.0220 B = 0.0000 Δ = 0.0220x = -1.05 A = 0.0300 B = 0.0000 Δ = 0.0300x = -1.00 A = 0.0120 B = 0.0000 Δ = 0.0120x = -0.95 A = 0.0060 B = 0.0000 Δ = 0.0060x = -0.90 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.84 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.79 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.74 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[1]
reference stan24 bins · 0.15 … 0.51
00.070.070.140.140.200.400.33 · 0.138x = 0.15 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.16 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.18 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.19 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.21 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.22 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.24 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.26 A = 0.0600 B = 0.0000 Δ = 0.0600x = 0.27 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.29 A = 0.1000 B = 0.0000 Δ = 0.1000x = 0.30 A = 0.0920 B = 0.0000 Δ = 0.0920x = 0.32 A = 0.1240 B = 0.0000 Δ = 0.1240x = 0.33 A = 0.1380 B = 0.0000 Δ = 0.1380x = 0.35 A = 0.0840 B = 0.0000 Δ = 0.0840x = 0.37 A = 0.0940 B = 0.0000 Δ = 0.0940x = 0.38 A = 0.0680 B = 0.0000 Δ = 0.0680x = 0.40 A = 0.0480 B = 0.0000 Δ = 0.0480x = 0.41 A = 0.0340 B = 0.0000 Δ = 0.0340x = 0.43 A = 0.0160 B = 0.0000 Δ = 0.0160x = 0.44 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.46 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.48 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.49 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.51 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0070 ≤ tol 0.0329 · floors 0.0096/0.0144
posteriordb-one_comp_mm_elim_abs / one_comp_mm_elim_abs
answer record(k_a, K_m, V_m, sigma) stan pass 0.4413
00 statement source: posteriordb/one_comp_mm_elim_abs-one_comp_mm_elim_abs
given

For each of N_t = 20 measurement times, the data provide the observed concentration C_hat in mg/L at that time in days. The pharmacokinetic model is fully specified by four inputs: an initial time t0 (fixed at 0 days), a single administered dose D in mg, and a compartment volume V in liters. The four model parameters are the absorption rate constant k_a (units: 1/day), the Michaelis-Menten half-saturation constant K_m (units: mg/L), the maximum elimination rate V_m (units: 1/day), and the measurement error standard deviation sigma (units: mg/L, all strictly positive). Each of k_a, K_m, V_m, and sigma has a half-Cauchy prior with location 0 and scale 1.

model

A one-compartment pharmacokinetic model with first-order absorption and saturable Michaelis-Menten elimination. The concentration in the compartment evolves according to an ordinary differential equation. At each time point, the rate of change of concentration depends on two processes: absorption, a first-order term with rate constant k_a that decays exponentially with the administered dose D and compartment volume V; and elimination, a saturable Michaelis-Menten process where the elimination rate equals (V_m / V) times the concentration divided by (K_m plus the concentration), so the rate increases with concentration but approaches the maximum V_m/V asymptotically. The initial concentration at time t0 is zero. For each measurement time, the observed concentration is generated from a lognormal distribution with log-mean equal to the natural logarithm of the ODE-predicted concentration and standard deviation sigma.

query

The marginal posterior distributions of the four parameters: k_a (the absorption rate constant), K_m (the Michaelis-Menten half-saturation constant), V_m (the maximum elimination rate), and sigma (the measurement error standard deviation).

answer spec record(k_a, K_m, V_m, sigma)
{
  "kind": "record",
  "fields": {
    "k_a": {
      "kind": "dist",
      "domain": "real"
    },
    "K_m": {
      "kind": "dist",
      "domain": "real"
    },
    "V_m": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.441
stan
1functions {
2 array[] real one_comp_mm_elim_abs(real t, array[] real y,
3 array[] real theta, array[] real x_r,
4 array[] int x_i) {
5 array[1] real dydt;
6 real k_a = theta[1]; // Dosing rate in 1/day
7 real K_m = theta[2]; // Michaelis-Menten constant in mg/L
8 real V_m = theta[3]; // Maximum elimination rate in 1/day
9 real D = x_r[1];
10 real V = x_r[2];
11 real dose = 0;
12 real elim = (V_m / V) * y[1] / (K_m + y[1]);
13
14 if (t > 0) {
15 dose = exp(-k_a * t) * D * k_a / V;
16 }
17
18 dydt[1] = dose - elim;
19
20 return dydt;
21 }
22}
23data {
24 real t0; // Initial time in days;
25 // This is currently hardcoded in data transformations
26 // Uncomment this line to get original model
27 // real C0[1]; // Initial concentration at t0 in mg/L
28
29 real D; // Total dosage in mg
30 real V; // Compartment volume in L
31
32 int<lower=1> N_t;
33 array[N_t] real times; // Measurement times in days
34
35 // Measured concentrations in effect compartment in mg/L
36 array[N_t] real C_hat;
37}
38transformed data {
39 // Comment out the next line to get the original model
40 array[1] real C0 = {0.0};
41 array[2] real x_r = {D, V};
42 array[0] int x_i;
43}
44parameters {
45 real<lower=0> k_a; // Dosing rate in 1/day
46 real<lower=0> K_m; // Michaelis-Menten constant in mg/L
47 real<lower=0> V_m; // Maximum elimination rate in 1/day
48 real<lower=0> sigma;
49}
50transformed parameters {
51 array[N_t, 1] real C;
52 {
53 array[3] real theta = {k_a, K_m, V_m};
54 C = integrate_ode_bdf(one_comp_mm_elim_abs, C0, t0, times, theta, x_r,
55 x_i);
56 }
57}
58model {
59 // Priors
60 k_a ~ cauchy(0, 1);
61 K_m ~ cauchy(0, 1);
62 V_m ~ cauchy(0, 1);
63 sigma ~ cauchy(0, 1);
64
65 // Likelihood
66 for (n in 1 : N_t) {
67 C_hat[n] ~ lognormal(log(C[n, 1]), sigma);
68 }
69}
70generated quantities {
71 array[N_t] real C_ppc;
72 for (n in 1 : N_t) {
73 C_ppc[n] = lognormal_rng(log(C[n, 1]), sigma);
74 }
75}
76
77//@ DATA { t0: 0, D: 30, V: 2, times: [20 values], N_t: 20, C_hat: [20 values] } // values supplied at runtime
78//@ PARAMS ["k_a","K_m","V_m","sigma"]
79//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
80
02answer overlay — reference vs stanrecord(k_a, K_m, V_m, sigma)
k_a
reference stan24 bins · 0.53 … 1.05
00.070.070.140.140.600.8010.73 · 0.1380.76 · 0.136x = 0.53 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.55 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.57 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.60 A = 0.0100 B = 0.0100 Δ = 0.0000x = 0.62 A = 0.0140 B = 0.0160 Δ = -0.0020x = 0.64 A = 0.0260 B = 0.0460 Δ = -0.0200x = 0.67 A = 0.0680 B = 0.0660 Δ = 0.0020x = 0.69 A = 0.0600 B = 0.0900 Δ = -0.0300x = 0.71 A = 0.1240 B = 0.1000 Δ = 0.0240x = 0.73 A = 0.1380 B = 0.1360 Δ = 0.0020x = 0.76 A = 0.1340 B = 0.1360 Δ = -0.0020x = 0.78 A = 0.1180 B = 0.0920 Δ = 0.0260x = 0.80 A = 0.0880 B = 0.0940 Δ = -0.0060x = 0.82 A = 0.0780 B = 0.0540 Δ = 0.0240x = 0.85 A = 0.0520 B = 0.0480 Δ = 0.0040x = 0.87 A = 0.0240 B = 0.0340 Δ = -0.0100x = 0.89 A = 0.0200 B = 0.0360 Δ = -0.0160x = 0.92 A = 0.0140 B = 0.0120 Δ = 0.0020x = 0.94 A = 0.0120 B = 0.0160 Δ = -0.0040x = 0.96 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.98 A = 0.0060 B = 0.0020 Δ = 0.0040x = 1.00 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.03 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.05 A = 0.0000 B = 0.0020 Δ = -0.0020
K_m
reference stan24 bins · 0.90 … 42.1
00.360.360.730.7320400.90 · 0.7020.90 · 0.728x = 0.90 A = 0.7020 B = 0.7280 Δ = -0.0260x = 2.70 A = 0.1460 B = 0.1480 Δ = -0.0020x = 4.50 A = 0.0680 B = 0.0580 Δ = 0.0100x = 6.30 A = 0.0340 B = 0.0200 Δ = 0.0140x = 8.10 A = 0.0140 B = 0.0200 Δ = -0.0060x = 9.90 A = 0.0060 B = 0.0060 Δ = 0.0000x = 11.6 A = 0.0080 B = 0.0020 Δ = 0.0060x = 13.4 A = 0.0060 B = 0.0060 Δ = 0.0000x = 15.2 A = 0.0040 B = 0.0000 Δ = 0.0040x = 17 A = 0.0000 B = 0.0060 Δ = -0.0060x = 18.8 A = 0.0020 B = 0.0000 Δ = 0.0020x = 20.6 A = 0.0000 B = 0.0020 Δ = -0.0020x = 22.4 A = 0.0040 B = 0.0000 Δ = 0.0040x = 24.2 A = 0.0000 B = 0.0020 Δ = -0.0020x = 26 A = 0.0000 B = 0.0000 Δ = 0.0000x = 27.8 A = 0.0020 B = 0.0020 Δ = 0.0000x = 29.6 A = 0.0000 B = 0.0000 Δ = 0.0000x = 31.3 A = 0.0000 B = 0.0000 Δ = 0.0000x = 33.1 A = 0.0000 B = 0.0000 Δ = 0.0000x = 34.9 A = 0.0000 B = 0.0000 Δ = 0.0000x = 36.7 A = 0.0020 B = 0.0000 Δ = 0.0020x = 38.5 A = 0.0000 B = 0.0000 Δ = 0.0000x = 40.3 A = 0.0000 B = 0.0000 Δ = 0.0000x = 42.1 A = 0.0020 B = 0.0000 Δ = 0.0020
V_m
reference stan24 bins · 0.38 … 3.74
00.170.170.340.3420.82 · 0.3240.82 · 0.342x = 0.38 A = 0.0040 B = 0.0040 Δ = 0.0000x = 0.53 A = 0.0220 B = 0.0300 Δ = -0.0080x = 0.67 A = 0.1460 B = 0.1600 Δ = -0.0140x = 0.82 A = 0.3240 B = 0.3420 Δ = -0.0180x = 0.96 A = 0.2700 B = 0.2420 Δ = 0.0280x = 1.11 A = 0.1120 B = 0.1280 Δ = -0.0160x = 1.26 A = 0.0600 B = 0.0560 Δ = 0.0040x = 1.40 A = 0.0160 B = 0.0140 Δ = 0.0020x = 1.55 A = 0.0200 B = 0.0060 Δ = 0.0140x = 1.69 A = 0.0020 B = 0.0060 Δ = -0.0040x = 1.84 A = 0.0080 B = 0.0000 Δ = 0.0080x = 1.99 A = 0.0040 B = 0.0000 Δ = 0.0040x = 2.13 A = 0.0000 B = 0.0000 Δ = 0.0000x = 2.28 A = 0.0000 B = 0.0000 Δ = 0.0000x = 2.42 A = 0.0000 B = 0.0080 Δ = -0.0080x = 2.57 A = 0.0020 B = 0.0020 Δ = 0.0000x = 2.72 A = 0.0000 B = 0.0020 Δ = -0.0020x = 2.86 A = 0.0020 B = 0.0000 Δ = 0.0020x = 3.01 A = 0.0040 B = 0.0000 Δ = 0.0040x = 3.15 A = 0.0000 B = 0.0000 Δ = 0.0000x = 3.30 A = 0.0000 B = 0.0000 Δ = 0.0000x = 3.45 A = 0.0020 B = 0.0000 Δ = 0.0020x = 3.59 A = 0.0000 B = 0.0000 Δ = 0.0000x = 3.74 A = 0.0020 B = 0.0000 Δ = 0.0020
sigma
reference stan24 bins · 0.08 … 0.24
00.070.070.150.150.100.200.12 · 0.1300.13 · 0.148x = 0.08 A = 0.0060 B = 0.0020 Δ = 0.0040x = 0.09 A = 0.0200 B = 0.0080 Δ = 0.0120x = 0.09 A = 0.0380 B = 0.0300 Δ = 0.0080x = 0.10 A = 0.0620 B = 0.0640 Δ = -0.0020x = 0.11 A = 0.0860 B = 0.0940 Δ = -0.0080x = 0.11 A = 0.1180 B = 0.1180 Δ = 0.0000x = 0.12 A = 0.1300 B = 0.1080 Δ = 0.0220x = 0.13 A = 0.1080 B = 0.1480 Δ = -0.0400x = 0.13 A = 0.0900 B = 0.1020 Δ = -0.0120x = 0.14 A = 0.1060 B = 0.0720 Δ = 0.0340x = 0.15 A = 0.0680 B = 0.0560 Δ = 0.0120x = 0.15 A = 0.0480 B = 0.0620 Δ = -0.0140x = 0.16 A = 0.0400 B = 0.0360 Δ = 0.0040x = 0.17 A = 0.0200 B = 0.0260 Δ = -0.0060x = 0.17 A = 0.0180 B = 0.0200 Δ = -0.0020x = 0.18 A = 0.0140 B = 0.0220 Δ = -0.0080x = 0.19 A = 0.0060 B = 0.0080 Δ = -0.0020x = 0.19 A = 0.0040 B = 0.0060 Δ = -0.0020x = 0.20 A = 0.0120 B = 0.0120 Δ = 0.0000x = 0.21 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.22 A = 0.0020 B = 0.0020 Δ = 0.0000x = 0.22 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.23 A = 0.0000 B = 0.0020 Δ = -0.0020x = 0.24 A = 0.0000 B = 0.0020 Δ = -0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.4413 ≤ tol 1.8806 · floors 0.9403/0.5151
posteriordb-radon_mn / radon_county_intercept
answer record(alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85], beta, sigma_y) stan
00 statement source: posteriordb/radon_mn-radon_county_intercept
given

Household radon measurements from 919 homes across 85 Minnesota counties are analyzed. For each measurement i the data provide the log radon level log_radon_i, a floor indicator floor_measure_i (1 if the measurement was taken on the first floor rather than the basement, 0 otherwise), and the county index county_idx_i (1..85). Each county j has its own intercept alpha_j with a Normal(mean 0, sd 10) prior. The floor coefficient beta has a Normal(mean 0, sd 10) prior, and the positive residual standard deviation sigma_y has a half-Normal(0, 1) prior.

model

The log radon level for measurement i is Normal-distributed with mean alpha[county_idx_i] + beta * floor_measure_i and standard deviation sigma_y.

query

The marginal posterior distribution of each parameter given the data: the 85 county intercepts alpha_1..alpha_85, the floor coefficient beta, and the residual standard deviation sigma_y.

answer spec record(alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85], beta, sigma_y)
{
  "kind": "record",
  "fields": {
    "alpha[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[40]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[41]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[42]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[43]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[44]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[45]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[46]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[47]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[48]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[49]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[50]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[51]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[52]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[53]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[54]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[55]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[56]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[57]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[58]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[59]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[60]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[61]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[62]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[63]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[64]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[65]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[66]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[67]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[68]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[69]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[70]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[71]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[72]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[73]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[74]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[75]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[76]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[77]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[78]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[79]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[80]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[81]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[82]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[83]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[84]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[85]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_y": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization
stan
1data {
2 int<lower=0> N;
3 int<lower=0> J;
4 array[N] int<lower=1, upper=J> county_idx;
5 vector[N] floor_measure;
6 vector[N] log_radon;
7}
8parameters {
9 vector[J] alpha;
10 real beta;
11 real<lower=0> sigma_y;
12}
13model {
14 vector[N] mu;
15 // Prior
16 sigma_y ~ normal(0, 1);
17 alpha ~ normal(0, 10);
18 beta ~ normal(0, 10);
19
20 // Likelihood
21 for (n in 1 : N) {
22 mu[n] = alpha[county_idx[n]] + beta * floor_measure[n];
23 target += normal_lpdf(log_radon[n] | mu[n], sigma_y);
24 }
25}
26
27//@ DATA { N: 919, J: 85, floor_measure: [919 values], log_radon: [919 values], county_idx: [919 values] } // values supplied at runtime
28//@ PARAMS ["alpha[1]","alpha[2]","alpha[3]","alpha[4]","alpha[5]","alpha[6]","alpha[7]","alpha[8]","alpha[9]","alpha[10]","alpha[11]","alpha[12]","alpha[13]","alpha[14]","alpha[15]","alpha[16]","alpha[17]","alpha[18]","alpha[19]","alpha[20]","alpha[21]","alpha[22]","alpha[23]","alpha[24]","alpha[25]","alpha[26]","alpha[27]","alpha[28]","alpha[29]","alpha[30]","alpha[31]","alpha[32]","alpha[33]","alpha[34]","alpha[35]","alpha[36]","alpha[37]","alpha[38]","alpha[39]","alpha[40]","alpha[41]","alpha[42]","alpha[43]","alpha[44]","alpha[45]","alpha[46]","alpha[47]","alpha[48]","alpha[49]","alpha[50]","alpha[51]","alpha[52]","alpha[53]","alpha[54]","alpha[55]","alpha[56]","alpha[57]","alpha[58]","alpha[59]","alpha[60]","alpha[61]","alpha[62]","alpha[63]","alpha[64]","alpha[65]","alpha[66]","alpha[67]","alpha[68]","alpha[69]","alpha[70]","alpha[71]","alpha[72]","alpha[73]","alpha[74]","alpha[75]","alpha[76]","alpha[77]","alpha[78]","alpha[79]","alpha[80]","alpha[81]","alpha[82]","alpha[83]","alpha[84]","alpha[85]","beta","sigma_y"]
29//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
30
02answer overlay — reference vs stanrecord(alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85], beta, sigma_y)
parameterreference mean±sdstan mean±sd
alpha[1]0.881 ± 0.370
alpha[2]0.932 ± 0.097
alpha[3]1.55 ± 0.426
alpha[4]1.58 ± 0.284
alpha[5]1.47 ± 0.362
alpha[6]1.55 ± 0.423
alpha[7]2.03 ± 0.190
alpha[8]1.99 ± 0.367
alpha[9]1.02 ± 0.236
alpha[10]1.59 ± 0.290
alpha[11]1.45 ± 0.333
alpha[12]1.75 ± 0.358
alpha[13]1.09 ± 0.289
alpha[14]2.00 ± 0.190
alpha[15]1.37 ± 0.369
alpha[16]0.715 ± 0.495
alpha[17]1.27 ± 0.368
alpha[18]1.16 ± 0.219
alpha[19]1.37 ± 0.090
alpha[20]1.79 ± 0.411
alpha[21]1.74 ± 0.248
alpha[22]0.778 ± 0.317
alpha[23]1.46 ± 0.520
alpha[24]2.12 ± 0.250
alpha[25]1.97 ± 0.189
alpha[26]1.39 ± 0.070
alpha[27]1.78 ± 0.301
alpha[28]1.27 ± 0.336
alpha[29]1.07 ± 0.413
alpha[30]0.970 ± 0.219
alpha[31]2.03 ± 0.327
alpha[32]1.27 ± 0.370
alpha[33]2.06 ± 0.369
alpha[34]1.63 ± 0.410
alpha[35]0.844 ± 0.276
alpha[36]2.94 ± 0.511
alpha[37]0.475 ± 0.245
alpha[38]1.89 ± 0.373
alpha[39]1.77 ± 0.321
alpha[40]2.33 ± 0.349
alpha[41]1.97 ± 0.252
alpha[42]1.35 ± 0.729
alpha[43]1.64 ± 0.238
alpha[44]1.11 ± 0.263
alpha[45]1.32 ± 0.194
alpha[46]1.25 ± 0.308
alpha[47]0.955 ± 0.496
alpha[48]1.19 ± 0.242
alpha[49]1.72 ± 0.192
alpha[50]2.48 ± 0.742
alpha[51]2.15 ± 0.367
alpha[52]1.90 ± 0.415
alpha[53]1.26 ± 0.439
alpha[54]1.33 ± 0.144
alpha[55]1.64 ± 0.266
alpha[56]1.21 ± 0.417
alpha[57]0.811 ± 0.302
alpha[58]1.87 ± 0.377
alpha[59]1.73 ± 0.376
alpha[60]1.33 ± 0.506
alpha[61]1.20 ± 0.128
alpha[62]2.03 ± 0.323
alpha[63]1.69 ± 0.408
alpha[64]1.88 ± 0.215
alpha[65]1.32 ± 0.497
alpha[66]1.68 ± 0.197
alpha[67]1.81 ± 0.209
alpha[68]1.10 ± 0.254
alpha[69]1.27 ± 0.356
alpha[70]0.918 ± 0.072
alpha[71]1.51 ± 0.146
alpha[72]1.61 ± 0.225
alpha[73]1.78 ± 0.531
alpha[74]1.03 ± 0.366
alpha[75]1.77 ± 0.420
alpha[76]2.02 ± 0.348
alpha[77]1.86 ± 0.278
alpha[78]1.32 ± 0.318
alpha[79]0.692 ± 0.355
alpha[80]1.36 ± 0.112
alpha[81]2.66 ± 0.412
alpha[82]2.17 ± 0.721
alpha[83]1.67 ± 0.206
alpha[84]1.65 ± 0.198
alpha[85]1.22 ± 0.498
beta-0.687 ± 0.072
sigma_y0.727 ± 0.018
03 verification
checkstatusevidence
cross-language (stan vs reference)
posteriordb-radon_mn / radon_hierarchical_intercept_noncentered
answer record(beta[1], beta[2], mu_alpha, sigma_alpha, sigma_y, alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85]) stan
00 statement source: posteriordb/radon_mn-radon_hierarchical_intercept_noncentered
given

Household radon measurements from 919 homes across 85 Minnesota counties are analyzed. For each measurement i the data provide the log radon level log_radon_i, a floor indicator floor_measure_i (1 if first floor, 0 if basement), a county-level log uranium predictor log_uppm_i, and the county index county_idx_i (1..85). The county intercepts are partially pooled: their shared mean mu_alpha has a Normal(mean 0, sd 10) prior and their between-county standard deviation sigma_alpha has a half-Normal(0, 1) prior. The two coefficients beta_1 (on log uranium) and beta_2 (on floor) have Normal(mean 0, sd 10) priors, and the positive residual standard deviation sigma_y has a half-Normal(0, 1) prior.

model

Each county intercept is drawn as alpha_j ~ Normal(mu_alpha, sigma_alpha). The log radon level for measurement i is Normal-distributed with mean alpha[county_idx_i] + log_uppm_i * beta_1 + floor_measure_i * beta_2 and standard deviation sigma_y.

query

The marginal posterior distribution of each parameter given the data: the 85 county intercepts alpha_1..alpha_85, the uranium coefficient beta_1, the floor coefficient beta_2, the population mean mu_alpha, the between-county standard deviation sigma_alpha, and the residual standard deviation sigma_y.

answer spec record(beta[1], beta[2], mu_alpha, sigma_alpha, sigma_y, alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85])
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "mu_alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_y": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[40]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[41]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[42]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[43]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[44]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[45]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[46]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[47]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[48]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[49]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[50]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[51]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[52]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[53]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[54]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[55]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[56]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[57]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[58]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[59]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[60]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[61]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[62]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[63]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[64]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[65]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[66]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[67]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[68]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[69]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[70]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[71]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[72]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[73]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[74]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[75]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[76]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[77]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[78]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[79]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[80]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[81]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[82]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[83]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[84]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[85]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization
stan
1data {
2 int<lower=0> J;
3 int<lower=0> N;
4 array[N] int<lower=1, upper=J> county_idx;
5 vector[N] log_uppm;
6 vector[N] floor_measure;
7 vector[N] log_radon;
8}
9parameters {
10 vector[J] alpha_raw;
11 vector[2] beta;
12 real mu_alpha;
13 real<lower=0> sigma_alpha;
14 real<lower=0> sigma_y;
15}
16transformed parameters {
17 vector[J] alpha;
18 // implies: alpha ~ normal(mu_alpha, sigma_alpha);
19 alpha = mu_alpha + sigma_alpha * alpha_raw;
20}
21model {
22 vector[N] mu;
23 vector[N] muj;
24
25 sigma_alpha ~ normal(0, 1);
26 sigma_y ~ normal(0, 1);
27 mu_alpha ~ normal(0, 10);
28 beta ~ normal(0, 10);
29 alpha_raw ~ normal(0, 1);
30
31 for (n in 1 : N) {
32 muj[n] = alpha[county_idx[n]] + log_uppm[n] * beta[1];
33 mu[n] = muj[n] + floor_measure[n] * beta[2];
34 target += normal_lpdf(log_radon[n] | mu[n], sigma_y);
35 }
36}
37
38//@ DATA { N: 919, J: 85, floor_measure: [919 values], log_radon: [919 values], log_uppm: [919 values], county_idx: [919 values] } // values supplied at runtime
39//@ PARAMS ["beta[1]","beta[2]","mu_alpha","sigma_alpha","sigma_y","alpha[1]","alpha[2]","alpha[3]","alpha[4]","alpha[5]","alpha[6]","alpha[7]","alpha[8]","alpha[9]","alpha[10]","alpha[11]","alpha[12]","alpha[13]","alpha[14]","alpha[15]","alpha[16]","alpha[17]","alpha[18]","alpha[19]","alpha[20]","alpha[21]","alpha[22]","alpha[23]","alpha[24]","alpha[25]","alpha[26]","alpha[27]","alpha[28]","alpha[29]","alpha[30]","alpha[31]","alpha[32]","alpha[33]","alpha[34]","alpha[35]","alpha[36]","alpha[37]","alpha[38]","alpha[39]","alpha[40]","alpha[41]","alpha[42]","alpha[43]","alpha[44]","alpha[45]","alpha[46]","alpha[47]","alpha[48]","alpha[49]","alpha[50]","alpha[51]","alpha[52]","alpha[53]","alpha[54]","alpha[55]","alpha[56]","alpha[57]","alpha[58]","alpha[59]","alpha[60]","alpha[61]","alpha[62]","alpha[63]","alpha[64]","alpha[65]","alpha[66]","alpha[67]","alpha[68]","alpha[69]","alpha[70]","alpha[71]","alpha[72]","alpha[73]","alpha[74]","alpha[75]","alpha[76]","alpha[77]","alpha[78]","alpha[79]","alpha[80]","alpha[81]","alpha[82]","alpha[83]","alpha[84]","alpha[85]"]
40//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
41
02answer overlay — reference vs stanrecord(beta[1], beta[2], mu_alpha, sigma_alpha, sigma_y, alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85])
parameterreference mean±sdstan mean±sd
beta[1]0.788 ± 0.102
beta[2]-0.643 ± 0.073
mu_alpha1.42 ± 0.038
sigma_alpha0.149 ± 0.047
sigma_y0.730 ± 0.018
alpha[1]1.41 ± 0.151
alpha[2]1.42 ± 0.093
alpha[3]1.44 ± 0.146
alpha[4]1.52 ± 0.147
alpha[5]1.43 ± 0.151
alpha[6]1.39 ± 0.138
alpha[7]1.53 ± 0.138
alpha[8]1.46 ± 0.144
alpha[9]1.35 ± 0.135
alpha[10]1.41 ± 0.130
alpha[11]1.49 ± 0.145
alpha[12]1.42 ± 0.139
alpha[13]1.43 ± 0.137
alpha[14]1.51 ± 0.124
alpha[15]1.41 ± 0.147
alpha[16]1.38 ± 0.155
alpha[17]1.34 ± 0.145
alpha[18]1.45 ± 0.120
alpha[19]1.34 ± 0.079
alpha[20]1.44 ± 0.152
alpha[21]1.46 ± 0.139
alpha[22]1.23 ± 0.154
alpha[23]1.39 ± 0.154
alpha[24]1.54 ± 0.140
alpha[25]1.53 ± 0.132
alpha[26]1.39 ± 0.063
alpha[27]1.40 ± 0.152
alpha[28]1.42 ± 0.138
alpha[29]1.44 ± 0.143
alpha[30]1.39 ± 0.130
alpha[31]1.49 ± 0.146
alpha[32]1.39 ± 0.158
alpha[33]1.49 ± 0.156
alpha[34]1.45 ± 0.137
alpha[35]1.41 ± 0.138
alpha[36]1.52 ± 0.168
alpha[37]1.27 ± 0.144
alpha[38]1.54 ± 0.163
alpha[39]1.45 ± 0.140
alpha[40]1.49 ± 0.156
alpha[41]1.47 ± 0.135
alpha[42]1.42 ± 0.146
alpha[43]1.45 ± 0.137
alpha[44]1.30 ± 0.145
alpha[45]1.32 ± 0.130
alpha[46]1.37 ± 0.138
alpha[47]1.39 ± 0.154
alpha[48]1.35 ± 0.136
alpha[49]1.45 ± 0.131
alpha[50]1.46 ± 0.155
alpha[51]1.50 ± 0.147
alpha[52]1.42 ± 0.151
alpha[53]1.37 ± 0.147
alpha[54]1.27 ± 0.114
alpha[55]1.49 ± 0.139
alpha[56]1.40 ± 0.144
alpha[57]1.31 ± 0.147
alpha[58]1.44 ± 0.145
alpha[59]1.42 ± 0.148
alpha[60]1.39 ± 0.155
alpha[61]1.41 ± 0.101
alpha[62]1.46 ± 0.142
alpha[63]1.42 ± 0.146
alpha[64]1.50 ± 0.130
alpha[65]1.38 ± 0.147
alpha[66]1.53 ± 0.132
alpha[67]1.51 ± 0.137
alpha[68]1.44 ± 0.134
alpha[69]1.37 ± 0.143
alpha[70]1.23 ± 0.077
alpha[71]1.39 ± 0.105
alpha[72]1.39 ± 0.124
alpha[73]1.42 ± 0.152
alpha[74]1.30 ± 0.148
alpha[75]1.45 ± 0.141
alpha[76]1.44 ± 0.152
alpha[77]1.47 ± 0.139
alpha[78]1.47 ± 0.144
alpha[79]1.28 ± 0.149
alpha[80]1.40 ± 0.087
alpha[81]1.54 ± 0.161
alpha[82]1.44 ± 0.159
alpha[83]1.35 ± 0.127
alpha[84]1.50 ± 0.122
alpha[85]1.37 ± 0.146
03 verification
checkstatusevidence
cross-language (stan vs reference)
posteriordb-radon_mn / radon_partially_pooled_noncentered
answer record(mu_alpha, sigma_alpha, sigma_y, alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85]) stan
00 statement source: posteriordb/radon_mn-radon_partially_pooled_noncentered
given

Household radon measurements from 919 homes across 85 Minnesota counties are analyzed. For each measurement i the data provide the log radon level log_radon_i and the county index county_idx_i (1..85). The county intercepts are partially pooled: their shared mean mu_alpha has a Normal(mean 0, sd 10) prior, their between-county standard deviation sigma_alpha has a half-Normal(0, 1) prior, and the positive residual standard deviation sigma_y has a half-Normal(0, 1) prior.

model

Each county intercept is drawn as alpha_j ~ Normal(mu_alpha, sigma_alpha). The log radon level for measurement i is Normal-distributed with mean alpha[county_idx_i] and standard deviation sigma_y.

query

The marginal posterior distribution of each parameter given the data: the 85 county intercepts alpha_1..alpha_85, the population mean mu_alpha, the between-county standard deviation sigma_alpha, and the residual standard deviation sigma_y.

answer spec record(mu_alpha, sigma_alpha, sigma_y, alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85])
{
  "kind": "record",
  "fields": {
    "mu_alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_y": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[40]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[41]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[42]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[43]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[44]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[45]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[46]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[47]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[48]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[49]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[50]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[51]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[52]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[53]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[54]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[55]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[56]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[57]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[58]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[59]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[60]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[61]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[62]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[63]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[64]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[65]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[66]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[67]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[68]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[69]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[70]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[71]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[72]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[73]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[74]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[75]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[76]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[77]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[78]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[79]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[80]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[81]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[82]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[83]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[84]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[85]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization
stan
1data {
2 int<lower=0> N;
3 int<lower=0> J;
4 array[N] int<lower=1, upper=J> county_idx;
5 vector[N] log_radon;
6}
7parameters {
8 vector[J] alpha_raw;
9 real mu_alpha;
10 real<lower=0> sigma_alpha;
11 real<lower=0> sigma_y;
12}
13transformed parameters {
14 vector[J] alpha;
15 // implies: alpha ~ normal(mu_alpha, sigma_alpha);
16 alpha = mu_alpha + sigma_alpha * alpha_raw;
17}
18model {
19 vector[N] mu;
20
21 // priors
22 sigma_y ~ normal(0, 1);
23 sigma_alpha ~ normal(0, 1);
24 mu_alpha ~ normal(0, 10);
25 alpha_raw ~ normal(0, 1);
26
27 // likelihood
28 for (n in 1 : N) {
29 mu[n] = alpha[county_idx[n]];
30 target += normal_lpdf(log_radon[n] | mu[n], sigma_y);
31 }
32}
33
34//@ DATA { N: 919, J: 85, log_radon: [919 values], county_idx: [919 values] } // values supplied at runtime
35//@ PARAMS ["mu_alpha","sigma_alpha","sigma_y","alpha[1]","alpha[2]","alpha[3]","alpha[4]","alpha[5]","alpha[6]","alpha[7]","alpha[8]","alpha[9]","alpha[10]","alpha[11]","alpha[12]","alpha[13]","alpha[14]","alpha[15]","alpha[16]","alpha[17]","alpha[18]","alpha[19]","alpha[20]","alpha[21]","alpha[22]","alpha[23]","alpha[24]","alpha[25]","alpha[26]","alpha[27]","alpha[28]","alpha[29]","alpha[30]","alpha[31]","alpha[32]","alpha[33]","alpha[34]","alpha[35]","alpha[36]","alpha[37]","alpha[38]","alpha[39]","alpha[40]","alpha[41]","alpha[42]","alpha[43]","alpha[44]","alpha[45]","alpha[46]","alpha[47]","alpha[48]","alpha[49]","alpha[50]","alpha[51]","alpha[52]","alpha[53]","alpha[54]","alpha[55]","alpha[56]","alpha[57]","alpha[58]","alpha[59]","alpha[60]","alpha[61]","alpha[62]","alpha[63]","alpha[64]","alpha[65]","alpha[66]","alpha[67]","alpha[68]","alpha[69]","alpha[70]","alpha[71]","alpha[72]","alpha[73]","alpha[74]","alpha[75]","alpha[76]","alpha[77]","alpha[78]","alpha[79]","alpha[80]","alpha[81]","alpha[82]","alpha[83]","alpha[84]","alpha[85]"]
36//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
37
02answer overlay — reference vs stanrecord(mu_alpha, sigma_alpha, sigma_y, alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85])
parameterreference mean±sdstan mean±sd
mu_alpha1.35 ± 0.047
sigma_alpha0.304 ± 0.047
sigma_y0.767 ± 0.020
alpha[1]1.08 ± 0.244
alpha[2]0.937 ± 0.102
alpha[3]1.27 ± 0.244
alpha[4]1.26 ± 0.218
alpha[5]1.31 ± 0.248
alpha[6]1.41 ± 0.262
alpha[7]1.74 ± 0.176
alpha[8]1.45 ± 0.242
alpha[9]1.13 ± 0.190
alpha[10]1.28 ± 0.213
alpha[11]1.38 ± 0.220
alpha[12]1.49 ± 0.235
alpha[13]1.22 ± 0.218
alpha[14]1.67 ± 0.165
alpha[15]1.22 ± 0.251
alpha[16]1.20 ± 0.267
alpha[17]1.10 ± 0.243
alpha[18]1.11 ± 0.183
alpha[19]1.33 ± 0.094
alpha[20]1.50 ± 0.256
alpha[21]1.54 ± 0.207
alpha[22]1.03 ± 0.223
alpha[23]1.29 ± 0.269
alpha[24]1.70 ± 0.197
alpha[25]1.71 ± 0.176
alpha[26]1.33 ± 0.070
alpha[27]1.44 ± 0.217
alpha[28]1.14 ± 0.246
alpha[29]1.24 ± 0.252
alpha[30]1.12 ± 0.183
alpha[31]1.65 ± 0.220
alpha[32]1.29 ± 0.239
alpha[33]1.62 ± 0.241
alpha[34]1.28 ± 0.248
alpha[35]0.905 ± 0.224
alpha[36]1.65 ± 0.279
alpha[37]0.808 ± 0.205
alpha[38]1.41 ± 0.236
alpha[39]1.47 ± 0.228
alpha[40]1.65 ± 0.254
alpha[41]1.64 ± 0.202
alpha[42]1.35 ± 0.284
alpha[43]1.29 ± 0.200
alpha[44]1.17 ± 0.217
alpha[45]1.19 ± 0.177
alpha[46]1.31 ± 0.223
alpha[47]1.18 ± 0.269
alpha[48]1.20 ± 0.199
alpha[49]1.54 ± 0.174
alpha[50]1.51 ± 0.300
alpha[51]1.65 ± 0.237
alpha[52]1.54 ± 0.245
alpha[53]1.25 ± 0.258
alpha[54]1.26 ± 0.140
alpha[55]1.38 ± 0.197
alpha[56]1.14 ± 0.256
alpha[57]1.04 ± 0.223
alpha[58]1.50 ± 0.245
alpha[59]1.37 ± 0.238
alpha[60]1.33 ± 0.263
alpha[61]1.17 ± 0.120
alpha[62]1.58 ± 0.231
alpha[63]1.36 ± 0.250
alpha[64]1.63 ± 0.198
alpha[65]1.36 ± 0.267
alpha[66]1.31 ± 0.168
alpha[67]1.51 ± 0.173
alpha[68]1.23 ± 0.199
alpha[69]1.32 ± 0.240
alpha[70]0.855 ± 0.067
alpha[71]1.40 ± 0.135
alpha[72]1.51 ± 0.190
alpha[73]1.45 ± 0.265
alpha[74]1.20 ± 0.247
alpha[75]1.39 ± 0.257
alpha[76]1.54 ± 0.244
alpha[77]1.55 ± 0.206
alpha[78]1.22 ± 0.226
alpha[79]1.05 ± 0.245
alpha[80]1.29 ± 0.107
alpha[81]1.65 ± 0.267
alpha[82]1.50 ± 0.297
alpha[83]1.44 ± 0.170
alpha[84]1.53 ± 0.180
alpha[85]1.32 ± 0.253
03 verification
checkstatusevidence
cross-language (stan vs reference)
posteriordb-radon_mn / radon_pooled
answer record(alpha, beta, sigma_y) stan pass 0.0023
00 statement source: posteriordb/radon_mn-radon_pooled
given

Log radon measurements log_radon_i and floor indicators floor_measure_i are available for N = 919 Minnesota homes (i = 1..N), where floor_measure_i = 0 for basement measurements and 1 for first-floor measurements; both arrays are provided as data. The intercept alpha has a Normal(mean 0, sd 10) prior. The floor coefficient beta has a Normal(mean 0, sd 10) prior. The observation noise standard deviation sigma_y is constrained to be positive and has a half-Normal(mean 0, sd 1) prior (a Normal(0, 1) truncated to the positive reals).

model

The expected log radon for home i is a linear function of its floor indicator: mu_i = alpha + beta * floor_measure_i. The observed log radon log_radon_i is drawn from a Normal distribution with mean mu_i and standard deviation sigma_y, independently across homes.

query

The marginal posterior distribution of each parameter given the data: the intercept alpha, the floor coefficient beta, and the noise standard deviation sigma_y.

answer spec record(alpha, beta, sigma_y)
{
  "kind": "record",
  "fields": {
    "alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "beta": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_y": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.002
stan
1data {
2 int<lower=0> N;
3 vector[N] floor_measure;
4 vector[N] log_radon;
5}
6parameters {
7 real alpha;
8 real beta;
9 real<lower=0> sigma_y;
10}
11model {
12 vector[N] mu;
13
14 // priors
15 sigma_y ~ normal(0, 1);
16 alpha ~ normal(0, 10);
17 beta ~ normal(0, 10);
18
19 // likelihood
20 mu = alpha + beta * floor_measure;
21 for (n in 1 : N) {
22 target += normal_lpdf(log_radon[n] | mu[n], sigma_y);
23 }
24}
25
26//@ DATA { N: 919, floor_measure: [919 values], log_radon: [919 values] } // values supplied at runtime
27//@ PARAMS ["alpha","beta","sigma_y"]
28//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
29
02answer overlay — reference vs stanrecord(alpha, beta, sigma_y)
alpha
reference stan24 bins · 1.27 … 1.45
00.060.060.130.131.301.401.37 · 0.128x = 1.27 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.28 A = 0.0040 B = 0.0000 Δ = 0.0040x = 1.28 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.29 A = 0.0060 B = 0.0000 Δ = 0.0060x = 1.30 A = 0.0100 B = 0.0000 Δ = 0.0100x = 1.31 A = 0.0080 B = 0.0000 Δ = 0.0080x = 1.32 A = 0.0220 B = 0.0000 Δ = 0.0220x = 1.32 A = 0.0400 B = 0.0000 Δ = 0.0400x = 1.33 A = 0.0480 B = 0.0000 Δ = 0.0480x = 1.34 A = 0.0600 B = 0.0000 Δ = 0.0600x = 1.35 A = 0.1140 B = 0.0000 Δ = 0.1140x = 1.35 A = 0.1040 B = 0.0000 Δ = 0.1040x = 1.36 A = 0.1160 B = 0.0000 Δ = 0.1160x = 1.37 A = 0.1280 B = 0.0000 Δ = 0.1280x = 1.38 A = 0.0800 B = 0.0000 Δ = 0.0800x = 1.39 A = 0.0780 B = 0.0000 Δ = 0.0780x = 1.39 A = 0.0580 B = 0.0000 Δ = 0.0580x = 1.40 A = 0.0520 B = 0.0000 Δ = 0.0520x = 1.41 A = 0.0220 B = 0.0000 Δ = 0.0220x = 1.42 A = 0.0160 B = 0.0000 Δ = 0.0160x = 1.42 A = 0.0060 B = 0.0000 Δ = 0.0060x = 1.43 A = 0.0080 B = 0.0000 Δ = 0.0080x = 1.44 A = 0.0140 B = 0.0000 Δ = 0.0140x = 1.45 A = 0.0020 B = 0.0000 Δ = 0.0020
beta
reference stan24 bins · -0.81 … -0.35
00.060.060.130.13-0.80-0.60-0.40-0.59 · 0.126x = -0.81 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.79 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.77 A = 0.0080 B = 0.0000 Δ = 0.0080x = -0.75 A = 0.0060 B = 0.0000 Δ = 0.0060x = -0.73 A = 0.0180 B = 0.0000 Δ = 0.0180x = -0.71 A = 0.0280 B = 0.0000 Δ = 0.0280x = -0.69 A = 0.0400 B = 0.0000 Δ = 0.0400x = -0.67 A = 0.0600 B = 0.0000 Δ = 0.0600x = -0.65 A = 0.0740 B = 0.0000 Δ = 0.0740x = -0.63 A = 0.1100 B = 0.0000 Δ = 0.1100x = -0.61 A = 0.0880 B = 0.0000 Δ = 0.0880x = -0.59 A = 0.1260 B = 0.0000 Δ = 0.1260x = -0.57 A = 0.1040 B = 0.0000 Δ = 0.1040x = -0.55 A = 0.0760 B = 0.0000 Δ = 0.0760x = -0.53 A = 0.0880 B = 0.0000 Δ = 0.0880x = -0.51 A = 0.0700 B = 0.0000 Δ = 0.0700x = -0.49 A = 0.0320 B = 0.0000 Δ = 0.0320x = -0.47 A = 0.0240 B = 0.0000 Δ = 0.0240x = -0.45 A = 0.0220 B = 0.0000 Δ = 0.0220x = -0.43 A = 0.0140 B = 0.0000 Δ = 0.0140x = -0.41 A = 0.0040 B = 0.0000 Δ = 0.0040x = -0.39 A = 0.0000 B = 0.0000 Δ = 0.0000x = -0.37 A = 0.0020 B = 0.0000 Δ = 0.0020x = -0.35 A = 0.0020 B = 0.0000 Δ = 0.0020
sigma_y
reference stan24 bins · 0.74 … 0.84
00.050.050.110.110.750.800.79 · 0.110x = 0.74 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.75 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.75 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.75 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.76 A = 0.0280 B = 0.0000 Δ = 0.0280x = 0.76 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.77 A = 0.0380 B = 0.0000 Δ = 0.0380x = 0.77 A = 0.0580 B = 0.0000 Δ = 0.0580x = 0.78 A = 0.0700 B = 0.0000 Δ = 0.0700x = 0.78 A = 0.0760 B = 0.0000 Δ = 0.0760x = 0.78 A = 0.0840 B = 0.0000 Δ = 0.0840x = 0.79 A = 0.0820 B = 0.0000 Δ = 0.0820x = 0.79 A = 0.1100 B = 0.0000 Δ = 0.1100x = 0.80 A = 0.0780 B = 0.0000 Δ = 0.0780x = 0.80 A = 0.0840 B = 0.0000 Δ = 0.0840x = 0.80 A = 0.0620 B = 0.0000 Δ = 0.0620x = 0.81 A = 0.0500 B = 0.0000 Δ = 0.0500x = 0.81 A = 0.0440 B = 0.0000 Δ = 0.0440x = 0.82 A = 0.0380 B = 0.0000 Δ = 0.0380x = 0.82 A = 0.0260 B = 0.0000 Δ = 0.0260x = 0.83 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.83 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.83 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.84 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0023 ≤ tol 0.0085 · floors 0.0031/0.0032
posteriordb-radon_mn / radon_variable_intercept_noncentered
answer record(beta, mu_alpha, sigma_alpha, sigma_y, alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85]) stan
00 statement source: posteriordb/radon_mn-radon_variable_intercept_noncentered
given

Household radon measurements from 919 homes across 85 Minnesota counties are analyzed. For each measurement i the data provide the log radon level log_radon_i, a floor indicator floor_measure_i (1 if first floor, 0 if basement), and the county index county_idx_i (1..85). The county intercepts are partially pooled: their shared mean mu_alpha has a Normal(mean 0, sd 10) prior and their between-county standard deviation sigma_alpha has a half-Normal(0, 1) prior. The global floor coefficient beta has a Normal(mean 0, sd 10) prior, and the positive residual standard deviation sigma_y has a half-Normal(0, 1) prior.

model

Each county intercept is drawn as alpha_j ~ Normal(mu_alpha, sigma_alpha). The log radon level for measurement i is Normal-distributed with mean alpha[county_idx_i] + floor_measure_i * beta and standard deviation sigma_y.

query

The marginal posterior distribution of each parameter given the data: the 85 county intercepts alpha_1..alpha_85, the floor coefficient beta, the population mean mu_alpha, the between-county standard deviation sigma_alpha, and the residual standard deviation sigma_y.

answer spec record(beta, mu_alpha, sigma_alpha, sigma_y, alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85])
{
  "kind": "record",
  "fields": {
    "beta": {
      "kind": "dist",
      "domain": "real"
    },
    "mu_alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_y": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[40]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[41]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[42]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[43]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[44]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[45]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[46]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[47]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[48]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[49]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[50]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[51]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[52]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[53]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[54]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[55]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[56]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[57]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[58]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[59]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[60]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[61]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[62]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[63]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[64]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[65]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[66]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[67]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[68]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[69]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[70]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[71]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[72]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[73]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[74]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[75]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[76]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[77]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[78]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[79]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[80]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[81]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[82]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[83]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[84]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[85]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization
stan
1data {
2 int<lower=0> J;
3 int<lower=0> N;
4 array[N] int<lower=1, upper=J> county_idx;
5 vector[N] floor_measure;
6 vector[N] log_radon;
7}
8parameters {
9 vector[J] alpha_raw;
10 real beta;
11 real mu_alpha;
12 real<lower=0> sigma_alpha;
13 real<lower=0> sigma_y;
14}
15transformed parameters {
16 vector[J] alpha;
17 // implies: alpha ~ normal(mu_alpha, sigma_alpha);
18 alpha = mu_alpha + sigma_alpha * alpha_raw;
19}
20model {
21 vector[N] mu;
22
23 // Prior
24 sigma_y ~ normal(0, 1);
25 sigma_alpha ~ normal(0, 1);
26 mu_alpha ~ normal(0, 10);
27 beta ~ normal(0, 10);
28 alpha_raw ~ normal(0, 1);
29
30 for (n in 1 : N) {
31 mu[n] = alpha[county_idx[n]] + floor_measure[n] * beta;
32 target += normal_lpdf(log_radon[n] | mu[n], sigma_y);
33 }
34}
35
36//@ DATA { N: 919, J: 85, floor_measure: [919 values], log_radon: [919 values], county_idx: [919 values] } // values supplied at runtime
37//@ PARAMS ["beta","mu_alpha","sigma_alpha","sigma_y","alpha[1]","alpha[2]","alpha[3]","alpha[4]","alpha[5]","alpha[6]","alpha[7]","alpha[8]","alpha[9]","alpha[10]","alpha[11]","alpha[12]","alpha[13]","alpha[14]","alpha[15]","alpha[16]","alpha[17]","alpha[18]","alpha[19]","alpha[20]","alpha[21]","alpha[22]","alpha[23]","alpha[24]","alpha[25]","alpha[26]","alpha[27]","alpha[28]","alpha[29]","alpha[30]","alpha[31]","alpha[32]","alpha[33]","alpha[34]","alpha[35]","alpha[36]","alpha[37]","alpha[38]","alpha[39]","alpha[40]","alpha[41]","alpha[42]","alpha[43]","alpha[44]","alpha[45]","alpha[46]","alpha[47]","alpha[48]","alpha[49]","alpha[50]","alpha[51]","alpha[52]","alpha[53]","alpha[54]","alpha[55]","alpha[56]","alpha[57]","alpha[58]","alpha[59]","alpha[60]","alpha[61]","alpha[62]","alpha[63]","alpha[64]","alpha[65]","alpha[66]","alpha[67]","alpha[68]","alpha[69]","alpha[70]","alpha[71]","alpha[72]","alpha[73]","alpha[74]","alpha[75]","alpha[76]","alpha[77]","alpha[78]","alpha[79]","alpha[80]","alpha[81]","alpha[82]","alpha[83]","alpha[84]","alpha[85]"]
38//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
39
02answer overlay — reference vs stanrecord(beta, mu_alpha, sigma_alpha, sigma_y, alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85])
parameterreference mean±sdstan mean±sd
beta-0.663 ± 0.066
mu_alpha1.49 ± 0.050
sigma_alpha0.320 ± 0.043
sigma_y0.728 ± 0.018
alpha[1]1.22 ± 0.232
alpha[2]0.988 ± 0.099
alpha[3]1.52 ± 0.262
alpha[4]1.54 ± 0.211
alpha[5]1.46 ± 0.250
alpha[6]1.49 ± 0.270
alpha[7]1.86 ± 0.164
alpha[8]1.70 ± 0.247
alpha[9]1.20 ± 0.181
alpha[10]1.53 ± 0.223
alpha[11]1.45 ± 0.226
alpha[12]1.59 ± 0.241
alpha[13]1.27 ± 0.204
alpha[14]1.87 ± 0.174
alpha[15]1.43 ± 0.240
alpha[16]1.29 ± 0.275
alpha[17]1.40 ± 0.238
alpha[18]1.26 ± 0.176
alpha[19]1.38 ± 0.086
alpha[20]1.60 ± 0.264
alpha[21]1.66 ± 0.196
alpha[22]1.12 ± 0.229
alpha[23]1.49 ± 0.270
alpha[24]1.88 ± 0.208
alpha[25]1.84 ± 0.168
alpha[26]1.40 ± 0.066
alpha[27]1.64 ± 0.227
alpha[28]1.36 ± 0.239
alpha[29]1.35 ± 0.248
alpha[30]1.15 ± 0.182
alpha[31]1.74 ± 0.237
alpha[32]1.38 ± 0.251
alpha[33]1.75 ± 0.252
alpha[34]1.53 ± 0.261
alpha[35]1.13 ± 0.220
alpha[36]1.89 ± 0.290
alpha[37]0.860 ± 0.204
alpha[38]1.63 ± 0.243
alpha[39]1.62 ± 0.240
alpha[40]1.84 ± 0.237
alpha[41]1.78 ± 0.194
alpha[42]1.47 ± 0.302
alpha[43]1.58 ± 0.191
alpha[44]1.28 ± 0.216
alpha[45]1.36 ± 0.172
alpha[46]1.39 ± 0.223
alpha[47]1.36 ± 0.288
alpha[48]1.29 ± 0.205
alpha[49]1.67 ± 0.166
alpha[50]1.68 ± 0.290
alpha[51]1.79 ± 0.240
alpha[52]1.66 ± 0.257
alpha[53]1.40 ± 0.255
alpha[54]1.37 ± 0.129
alpha[55]1.59 ± 0.193
alpha[56]1.37 ± 0.275
alpha[57]1.12 ± 0.223
alpha[58]1.67 ± 0.238
alpha[59]1.61 ± 0.236
alpha[60]1.44 ± 0.275
alpha[61]1.25 ± 0.119
alpha[62]1.75 ± 0.236
alpha[63]1.56 ± 0.266
alpha[64]1.73 ± 0.183
alpha[65]1.47 ± 0.282
alpha[66]1.61 ± 0.174
alpha[67]1.72 ± 0.166
alpha[68]1.28 ± 0.210
alpha[69]1.41 ± 0.242
alpha[70]0.942 ± 0.066
alpha[71]1.50 ± 0.129
alpha[72]1.57 ± 0.187
alpha[73]1.59 ± 0.289
alpha[74]1.28 ± 0.235
alpha[75]1.58 ± 0.257
alpha[76]1.73 ± 0.238
alpha[77]1.69 ± 0.208
alpha[78]1.41 ± 0.231
alpha[79]1.13 ± 0.248
alpha[80]1.38 ± 0.105
alpha[81]1.94 ± 0.266
alpha[82]1.61 ± 0.314
alpha[83]1.61 ± 0.163
alpha[84]1.60 ± 0.177
alpha[85]1.44 ± 0.276
03 verification
checkstatusevidence
cross-language (stan vs reference)
posteriordb-radon_mn / radon_variable_intercept_slope_noncentered
answer record(sigma_y, sigma_alpha, sigma_beta, mu_alpha, mu_beta, alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85], beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], beta[10], beta[11], beta[12], beta[13], beta[14], beta[15], beta[16], beta[17], beta[18], beta[19], beta[20], beta[21], beta[22], beta[23], beta[24], beta[25], beta[26], beta[27], beta[28], beta[29], beta[30], beta[31], beta[32], beta[33], beta[34], beta[35], beta[36], beta[37], beta[38], beta[39], beta[40], beta[41], beta[42], beta[43], beta[44], beta[45], beta[46], beta[47], beta[48], beta[49], beta[50], beta[51], beta[52], beta[53], beta[54], beta[55], beta[56], beta[57], beta[58], beta[59], beta[60], beta[61], beta[62], beta[63], beta[64], beta[65], beta[66], beta[67], beta[68], beta[69], beta[70], beta[71], beta[72], beta[73], beta[74], beta[75], beta[76], beta[77], beta[78], beta[79], beta[80], beta[81], beta[82], beta[83], beta[84], beta[85]) stan
00 statement source: posteriordb/radon_mn-radon_variable_intercept_slope_noncentered
given

Household radon measurements from 919 homes across 85 Minnesota counties are analyzed. For each measurement i the data provide the log radon level log_radon_i, a floor indicator floor_measure_i (1 if first floor, 0 if basement), and the county index county_idx_i (1..85). Both the county intercepts and the county floor slopes are partially pooled. The intercept mean mu_alpha and the slope mean mu_beta each have a Normal(mean 0, sd 10) prior. The between-county standard deviations sigma_alpha and sigma_beta, and the residual standard deviation sigma_y, each have a half-Normal(0, 1) prior.

model

Each county intercept is drawn as alpha_j ~ Normal(mu_alpha, sigma_alpha) and each county floor slope as beta_j ~ Normal(mu_beta, sigma_beta). The log radon level for measurement i is Normal-distributed with mean alpha[county_idx_i] + floor_measure_i * beta[county_idx_i] and standard deviation sigma_y.

query

The marginal posterior distribution of each parameter given the data: the 85 county intercepts alpha_1..alpha_85, the 85 county floor slopes beta_1..beta_85, the population means mu_alpha and mu_beta, the between-county standard deviations sigma_alpha and sigma_beta, and the residual standard deviation sigma_y.

answer spec record(sigma_y, sigma_alpha, sigma_beta, mu_alpha, mu_beta, alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85], beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], beta[10], beta[11], beta[12], beta[13], beta[14], beta[15], beta[16], beta[17], beta[18], beta[19], beta[20], beta[21], beta[22], beta[23], beta[24], beta[25], beta[26], beta[27], beta[28], beta[29], beta[30], beta[31], beta[32], beta[33], beta[34], beta[35], beta[36], beta[37], beta[38], beta[39], beta[40], beta[41], beta[42], beta[43], beta[44], beta[45], beta[46], beta[47], beta[48], beta[49], beta[50], beta[51], beta[52], beta[53], beta[54], beta[55], beta[56], beta[57], beta[58], beta[59], beta[60], beta[61], beta[62], beta[63], beta[64], beta[65], beta[66], beta[67], beta[68], beta[69], beta[70], beta[71], beta[72], beta[73], beta[74], beta[75], beta[76], beta[77], beta[78], beta[79], beta[80], beta[81], beta[82], beta[83], beta[84], beta[85])
{
  "kind": "record",
  "fields": {
    "sigma_y": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_beta": {
      "kind": "dist",
      "domain": "real"
    },
    "mu_alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "mu_beta": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[40]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[41]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[42]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[43]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[44]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[45]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[46]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[47]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[48]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[49]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[50]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[51]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[52]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[53]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[54]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[55]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[56]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[57]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[58]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[59]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[60]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[61]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[62]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[63]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[64]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[65]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[66]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[67]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[68]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[69]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[70]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[71]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[72]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[73]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[74]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[75]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[76]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[77]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[78]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[79]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[80]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[81]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[82]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[83]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[84]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[85]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[40]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[41]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[42]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[43]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[44]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[45]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[46]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[47]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[48]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[49]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[50]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[51]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[52]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[53]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[54]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[55]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[56]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[57]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[58]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[59]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[60]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[61]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[62]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[63]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[64]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[65]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[66]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[67]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[68]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[69]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[70]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[71]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[72]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[73]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[74]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[75]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[76]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[77]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[78]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[79]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[80]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[81]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[82]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[83]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[84]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[85]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization
stan
1data {
2 int<lower=0> N;
3 int<lower=0> J;
4 array[N] int<lower=1, upper=J> county_idx;
5 vector[N] floor_measure;
6 vector[N] log_radon;
7}
8parameters {
9 real<lower=0> sigma_y;
10 real<lower=0> sigma_alpha;
11 real<lower=0> sigma_beta;
12 vector[J] alpha_raw;
13 vector[J] beta_raw;
14 real mu_alpha;
15 real mu_beta;
16}
17transformed parameters {
18 vector[J] alpha;
19 vector[J] beta;
20 // implies: alpha ~ normal(mu_alpha, sigma_alpha);
21 alpha = mu_alpha + sigma_alpha * alpha_raw;
22 // implies: beta ~ normal(mu_beta, sigma_beta);
23 beta = mu_beta + sigma_beta * beta_raw;
24}
25model {
26 vector[N] mu;
27 // Prior
28 sigma_y ~ normal(0, 1);
29 sigma_beta ~ normal(0, 1);
30 sigma_alpha ~ normal(0, 1);
31 mu_alpha ~ normal(0, 10);
32 mu_beta ~ normal(0, 10);
33 alpha_raw ~ normal(0, 1);
34 beta_raw ~ normal(0, 1);
35
36 // Likelihood
37 for (n in 1 : N) {
38 mu[n] = alpha[county_idx[n]] + floor_measure[n] * beta[county_idx[n]];
39 target += normal_lpdf(log_radon[n] | mu[n], sigma_y);
40 }
41}
42
43//@ DATA { N: 919, J: 85, floor_measure: [919 values], log_radon: [919 values], county_idx: [919 values] } // values supplied at runtime
44//@ PARAMS ["sigma_y","sigma_alpha","sigma_beta","mu_alpha","mu_beta","alpha[1]","alpha[2]","alpha[3]","alpha[4]","alpha[5]","alpha[6]","alpha[7]","alpha[8]","alpha[9]","alpha[10]","alpha[11]","alpha[12]","alpha[13]","alpha[14]","alpha[15]","alpha[16]","alpha[17]","alpha[18]","alpha[19]","alpha[20]","alpha[21]","alpha[22]","alpha[23]","alpha[24]","alpha[25]","alpha[26]","alpha[27]","alpha[28]","alpha[29]","alpha[30]","alpha[31]","alpha[32]","alpha[33]","alpha[34]","alpha[35]","alpha[36]","alpha[37]","alpha[38]","alpha[39]","alpha[40]","alpha[41]","alpha[42]","alpha[43]","alpha[44]","alpha[45]","alpha[46]","alpha[47]","alpha[48]","alpha[49]","alpha[50]","alpha[51]","alpha[52]","alpha[53]","alpha[54]","alpha[55]","alpha[56]","alpha[57]","alpha[58]","alpha[59]","alpha[60]","alpha[61]","alpha[62]","alpha[63]","alpha[64]","alpha[65]","alpha[66]","alpha[67]","alpha[68]","alpha[69]","alpha[70]","alpha[71]","alpha[72]","alpha[73]","alpha[74]","alpha[75]","alpha[76]","alpha[77]","alpha[78]","alpha[79]","alpha[80]","alpha[81]","alpha[82]","alpha[83]","alpha[84]","alpha[85]","beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","beta[8]","beta[9]","beta[10]","beta[11]","beta[12]","beta[13]","beta[14]","beta[15]","beta[16]","beta[17]","beta[18]","beta[19]","beta[20]","beta[21]","beta[22]","beta[23]","beta[24]","beta[25]","beta[26]","beta[27]","beta[28]","beta[29]","beta[30]","beta[31]","beta[32]","beta[33]","beta[34]","beta[35]","beta[36]","beta[37]","beta[38]","beta[39]","beta[40]","beta[41]","beta[42]","beta[43]","beta[44]","beta[45]","beta[46]","beta[47]","beta[48]","beta[49]","beta[50]","beta[51]","beta[52]","beta[53]","beta[54]","beta[55]","beta[56]","beta[57]","beta[58]","beta[59]","beta[60]","beta[61]","beta[62]","beta[63]","beta[64]","beta[65]","beta[66]","beta[67]","beta[68]","beta[69]","beta[70]","beta[71]","beta[72]","beta[73]","beta[74]","beta[75]","beta[76]","beta[77]","beta[78]","beta[79]","beta[80]","beta[81]","beta[82]","beta[83]","beta[84]","beta[85]"]
45//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
46
02answer overlay — reference vs stanrecord(sigma_y, sigma_alpha, sigma_beta, mu_alpha, mu_beta, alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], alpha[31], alpha[32], alpha[33], alpha[34], alpha[35], alpha[36], alpha[37], alpha[38], alpha[39], alpha[40], alpha[41], alpha[42], alpha[43], alpha[44], alpha[45], alpha[46], alpha[47], alpha[48], alpha[49], alpha[50], alpha[51], alpha[52], alpha[53], alpha[54], alpha[55], alpha[56], alpha[57], alpha[58], alpha[59], alpha[60], alpha[61], alpha[62], alpha[63], alpha[64], alpha[65], alpha[66], alpha[67], alpha[68], alpha[69], alpha[70], alpha[71], alpha[72], alpha[73], alpha[74], alpha[75], alpha[76], alpha[77], alpha[78], alpha[79], alpha[80], alpha[81], alpha[82], alpha[83], alpha[84], alpha[85], beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], beta[10], beta[11], beta[12], beta[13], beta[14], beta[15], beta[16], beta[17], beta[18], beta[19], beta[20], beta[21], beta[22], beta[23], beta[24], beta[25], beta[26], beta[27], beta[28], beta[29], beta[30], beta[31], beta[32], beta[33], beta[34], beta[35], beta[36], beta[37], beta[38], beta[39], beta[40], beta[41], beta[42], beta[43], beta[44], beta[45], beta[46], beta[47], beta[48], beta[49], beta[50], beta[51], beta[52], beta[53], beta[54], beta[55], beta[56], beta[57], beta[58], beta[59], beta[60], beta[61], beta[62], beta[63], beta[64], beta[65], beta[66], beta[67], beta[68], beta[69], beta[70], beta[71], beta[72], beta[73], beta[74], beta[75], beta[76], beta[77], beta[78], beta[79], beta[80], beta[81], beta[82], beta[83], beta[84], beta[85])
parameterreference mean±sdstan mean±sd
sigma_y0.721 ± 0.018
sigma_alpha0.322 ± 0.045
sigma_beta0.251 ± 0.130
mu_alpha1.49 ± 0.052
mu_beta-0.652 ± 0.083
alpha[1]1.22 ± 0.258
alpha[2]0.994 ± 0.098
alpha[3]1.49 ± 0.263
alpha[4]1.55 ± 0.217
alpha[5]1.47 ± 0.231
alpha[6]1.49 ± 0.263
alpha[7]1.85 ± 0.175
alpha[8]1.67 ± 0.252
alpha[9]1.18 ± 0.194
alpha[10]1.52 ± 0.212
alpha[11]1.45 ± 0.225
alpha[12]1.61 ± 0.254
alpha[13]1.26 ± 0.228
alpha[14]1.88 ± 0.178
alpha[15]1.43 ± 0.264
alpha[16]1.27 ± 0.274
alpha[17]1.43 ± 0.260
alpha[18]1.22 ± 0.182
alpha[19]1.39 ± 0.087
alpha[20]1.61 ± 0.258
alpha[21]1.64 ± 0.188
alpha[22]1.10 ± 0.230
alpha[23]1.44 ± 0.282
alpha[24]1.88 ± 0.184
alpha[25]1.81 ± 0.179
alpha[26]1.40 ± 0.076
alpha[27]1.65 ± 0.220
alpha[28]1.37 ± 0.237
alpha[29]1.34 ± 0.250
alpha[30]1.14 ± 0.192
alpha[31]1.76 ± 0.245
alpha[32]1.38 ± 0.240
alpha[33]1.76 ± 0.233
alpha[34]1.51 ± 0.275
alpha[35]1.10 ± 0.226
alpha[36]1.88 ± 0.300
alpha[37]0.854 ± 0.205
alpha[38]1.64 ± 0.244
alpha[39]1.63 ± 0.230
alpha[40]1.87 ± 0.238
alpha[41]1.78 ± 0.196
alpha[42]1.48 ± 0.295
alpha[43]1.68 ± 0.226
alpha[44]1.27 ± 0.209
alpha[45]1.38 ± 0.177
alpha[46]1.34 ± 0.237
alpha[47]1.36 ± 0.277
alpha[48]1.28 ± 0.200
alpha[49]1.68 ± 0.176
alpha[50]1.66 ± 0.298
alpha[51]1.78 ± 0.231
alpha[52]1.65 ± 0.245
alpha[53]1.42 ± 0.265
alpha[54]1.38 ± 0.134
alpha[55]1.55 ± 0.219
alpha[56]1.41 ± 0.254
alpha[57]1.12 ± 0.241
alpha[58]1.68 ± 0.250
alpha[59]1.58 ± 0.259
alpha[60]1.43 ± 0.266
alpha[61]1.22 ± 0.128
alpha[62]1.71 ± 0.231
alpha[63]1.55 ± 0.263
alpha[64]1.73 ± 0.194
alpha[65]1.44 ± 0.266
alpha[66]1.61 ± 0.202
alpha[67]1.68 ± 0.179
alpha[68]1.27 ± 0.187
alpha[69]1.40 ± 0.244
alpha[70]0.936 ± 0.067
alpha[71]1.51 ± 0.134
alpha[72]1.57 ± 0.185
alpha[73]1.61 ± 0.291
alpha[74]1.27 ± 0.254
alpha[75]1.57 ± 0.252
alpha[76]1.73 ± 0.252
alpha[77]1.71 ± 0.204
alpha[78]1.43 ± 0.233
alpha[79]1.13 ± 0.238
alpha[80]1.39 ± 0.104
alpha[81]1.88 ± 0.268
alpha[82]1.60 ± 0.296
alpha[83]1.65 ± 0.176
alpha[84]1.62 ± 0.177
alpha[85]1.43 ± 0.276
beta[1]-0.603 ± 0.278
beta[2]-0.785 ± 0.242
beta[3]-0.635 ± 0.259
beta[4]-0.684 ± 0.238
beta[5]-0.603 ± 0.249
beta[6]-0.670 ± 0.282
beta[7]-0.433 ± 0.310
beta[8]-0.622 ± 0.247
beta[9]-0.506 ± 0.291
beta[10]-0.715 ± 0.242
beta[11]-0.654 ± 0.285
beta[12]-0.654 ± 0.305
beta[13]-0.648 ± 0.310
beta[14]-0.721 ± 0.224
beta[15]-0.646 ± 0.255
beta[16]-0.649 ± 0.311
beta[17]-0.766 ± 0.268
beta[18]-0.520 ± 0.271
beta[19]-0.742 ± 0.228
beta[20]-0.645 ± 0.285
beta[21]-0.604 ± 0.282
beta[22]-0.651 ± 0.258
beta[23]-0.624 ± 0.272
beta[24]-0.633 ± 0.238
beta[25]-0.440 ± 0.285
beta[26]-0.723 ± 0.162
beta[27]-0.606 ± 0.263
beta[28]-0.633 ± 0.235
beta[29]-0.657 ± 0.286
beta[30]-0.630 ± 0.300
beta[31]-0.649 ± 0.299
beta[32]-0.644 ± 0.283
beta[33]-0.653 ± 0.303
beta[34]-0.675 ± 0.260
beta[35]-0.598 ± 0.237
beta[36]-0.510 ± 0.290
beta[37]-0.632 ± 0.259
beta[38]-0.585 ± 0.264
beta[39]-0.584 ± 0.278
beta[40]-0.639 ± 0.253
beta[41]-0.547 ± 0.300
beta[42]-0.674 ± 0.294
beta[43]-0.956 ± 0.286
beta[44]-0.779 ± 0.265
beta[45]-0.750 ± 0.226
beta[46]-0.675 ± 0.298
beta[47]-0.786 ± 0.287
beta[48]-0.598 ± 0.268
beta[49]-0.828 ± 0.272
beta[50]-0.642 ± 0.289
beta[51]-0.654 ± 0.280
beta[52]-0.647 ± 0.287
beta[53]-0.694 ± 0.266
beta[54]-0.825 ± 0.266
beta[55]-0.569 ± 0.243
beta[56]-0.768 ± 0.243
beta[57]-0.677 ± 0.271
beta[58]-0.611 ± 0.259
beta[59]-0.708 ± 0.249
beta[60]-0.639 ± 0.286
beta[61]-0.467 ± 0.259
beta[62]-0.404 ± 0.334
beta[63]-0.553 ± 0.265
beta[64]-0.662 ± 0.266
beta[65]-0.654 ± 0.290
beta[66]-0.625 ± 0.203
beta[67]-0.445 ± 0.259
beta[68]-0.660 ± 0.283
beta[69]-0.649 ± 0.290
beta[70]-0.606 ± 0.153
beta[71]-0.740 ± 0.231
beta[72]-0.658 ± 0.299
beta[73]-0.622 ± 0.301
beta[74]-0.653 ± 0.268
beta[75]-0.562 ± 0.257
beta[76]-0.656 ± 0.252
beta[77]-0.744 ± 0.277
beta[78]-0.707 ± 0.245
beta[79]-0.722 ± 0.251
beta[80]-0.772 ± 0.222
beta[81]-0.476 ± 0.281
beta[82]-0.676 ± 0.307
beta[83]-0.940 ± 0.290
beta[84]-0.667 ± 0.242
beta[85]-0.653 ± 0.289
03 verification
checkstatusevidence
cross-language (stan vs reference)
posteriordb-radon_mn / radon_variable_slope_noncentered
answer record(alpha, mu_beta, sigma_beta, sigma_y, beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], beta[10], beta[11], beta[12], beta[13], beta[14], beta[15], beta[16], beta[17], beta[18], beta[19], beta[20], beta[21], beta[22], beta[23], beta[24], beta[25], beta[26], beta[27], beta[28], beta[29], beta[30], beta[31], beta[32], beta[33], beta[34], beta[35], beta[36], beta[37], beta[38], beta[39], beta[40], beta[41], beta[42], beta[43], beta[44], beta[45], beta[46], beta[47], beta[48], beta[49], beta[50], beta[51], beta[52], beta[53], beta[54], beta[55], beta[56], beta[57], beta[58], beta[59], beta[60], beta[61], beta[62], beta[63], beta[64], beta[65], beta[66], beta[67], beta[68], beta[69], beta[70], beta[71], beta[72], beta[73], beta[74], beta[75], beta[76], beta[77], beta[78], beta[79], beta[80], beta[81], beta[82], beta[83], beta[84], beta[85]) stan
00 statement source: posteriordb/radon_mn-radon_variable_slope_noncentered
given

Household radon measurements from 919 homes across 85 Minnesota counties are analyzed. For each measurement i the data provide the log radon level log_radon_i, a floor indicator floor_measure_i (1 if first floor, 0 if basement), and the county index county_idx_i (1..85). The global intercept alpha has a Normal(mean 0, sd 10) prior. The county-varying floor slopes are partially pooled: their shared mean mu_beta has a Normal(mean 0, sd 10) prior, their between-county standard deviation sigma_beta has a half-Normal(0, 1) prior, and the positive residual standard deviation sigma_y has a half-Normal(0, 1) prior.

model

Each county floor slope is drawn as beta_j ~ Normal(mu_beta, sigma_beta). The log radon level for measurement i is Normal-distributed with mean alpha + floor_measure_i * beta[county_idx_i] and standard deviation sigma_y.

query

The marginal posterior distribution of each parameter given the data: the global intercept alpha, the 85 county floor slopes beta_1..beta_85, the population slope mean mu_beta, the between-county standard deviation sigma_beta, and the residual standard deviation sigma_y.

answer spec record(alpha, mu_beta, sigma_beta, sigma_y, beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], beta[10], beta[11], beta[12], beta[13], beta[14], beta[15], beta[16], beta[17], beta[18], beta[19], beta[20], beta[21], beta[22], beta[23], beta[24], beta[25], beta[26], beta[27], beta[28], beta[29], beta[30], beta[31], beta[32], beta[33], beta[34], beta[35], beta[36], beta[37], beta[38], beta[39], beta[40], beta[41], beta[42], beta[43], beta[44], beta[45], beta[46], beta[47], beta[48], beta[49], beta[50], beta[51], beta[52], beta[53], beta[54], beta[55], beta[56], beta[57], beta[58], beta[59], beta[60], beta[61], beta[62], beta[63], beta[64], beta[65], beta[66], beta[67], beta[68], beta[69], beta[70], beta[71], beta[72], beta[73], beta[74], beta[75], beta[76], beta[77], beta[78], beta[79], beta[80], beta[81], beta[82], beta[83], beta[84], beta[85])
{
  "kind": "record",
  "fields": {
    "alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "mu_beta": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_beta": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_y": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[31]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[32]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[33]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[34]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[35]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[36]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[37]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[38]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[39]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[40]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[41]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[42]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[43]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[44]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[45]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[46]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[47]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[48]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[49]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[50]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[51]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[52]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[53]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[54]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[55]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[56]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[57]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[58]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[59]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[60]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[61]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[62]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[63]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[64]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[65]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[66]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[67]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[68]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[69]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[70]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[71]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[72]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[73]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[74]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[75]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[76]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[77]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[78]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[79]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[80]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[81]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[82]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[83]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[84]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[85]": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization
stan
1data {
2 int<lower=0> J;
3 int<lower=0> N;
4 array[N] int<lower=1, upper=J> county_idx;
5 vector[N] floor_measure;
6 vector[N] log_radon;
7}
8parameters {
9 real alpha;
10 vector[J] beta_raw;
11 real mu_beta;
12 real<lower=0> sigma_beta;
13 real<lower=0> sigma_y;
14}
15transformed parameters {
16 vector[J] beta;
17 // implies: beta ~ normal(mu_beta, sigma_beta);
18 beta = mu_beta + sigma_beta * beta_raw;
19}
20model {
21 vector[N] mu;
22 // Prior
23 alpha ~ normal(0, 10);
24 sigma_y ~ normal(0, 1);
25 sigma_beta ~ normal(0, 1);
26 mu_beta ~ normal(0, 10);
27 beta_raw ~ normal(0, 1);
28
29 for (n in 1 : N) {
30 mu[n] = alpha + floor_measure[n] * beta[county_idx[n]];
31 target += normal_lpdf(log_radon[n] | mu[n], sigma_y);
32 }
33}
34
35//@ DATA { N: 919, J: 85, floor_measure: [919 values], log_radon: [919 values], county_idx: [919 values] } // values supplied at runtime
36//@ PARAMS ["alpha","mu_beta","sigma_beta","sigma_y","beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","beta[8]","beta[9]","beta[10]","beta[11]","beta[12]","beta[13]","beta[14]","beta[15]","beta[16]","beta[17]","beta[18]","beta[19]","beta[20]","beta[21]","beta[22]","beta[23]","beta[24]","beta[25]","beta[26]","beta[27]","beta[28]","beta[29]","beta[30]","beta[31]","beta[32]","beta[33]","beta[34]","beta[35]","beta[36]","beta[37]","beta[38]","beta[39]","beta[40]","beta[41]","beta[42]","beta[43]","beta[44]","beta[45]","beta[46]","beta[47]","beta[48]","beta[49]","beta[50]","beta[51]","beta[52]","beta[53]","beta[54]","beta[55]","beta[56]","beta[57]","beta[58]","beta[59]","beta[60]","beta[61]","beta[62]","beta[63]","beta[64]","beta[65]","beta[66]","beta[67]","beta[68]","beta[69]","beta[70]","beta[71]","beta[72]","beta[73]","beta[74]","beta[75]","beta[76]","beta[77]","beta[78]","beta[79]","beta[80]","beta[81]","beta[82]","beta[83]","beta[84]","beta[85]"]
37//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
38
02answer overlay — reference vs stanrecord(alpha, mu_beta, sigma_beta, sigma_y, beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], beta[10], beta[11], beta[12], beta[13], beta[14], beta[15], beta[16], beta[17], beta[18], beta[19], beta[20], beta[21], beta[22], beta[23], beta[24], beta[25], beta[26], beta[27], beta[28], beta[29], beta[30], beta[31], beta[32], beta[33], beta[34], beta[35], beta[36], beta[37], beta[38], beta[39], beta[40], beta[41], beta[42], beta[43], beta[44], beta[45], beta[46], beta[47], beta[48], beta[49], beta[50], beta[51], beta[52], beta[53], beta[54], beta[55], beta[56], beta[57], beta[58], beta[59], beta[60], beta[61], beta[62], beta[63], beta[64], beta[65], beta[66], beta[67], beta[68], beta[69], beta[70], beta[71], beta[72], beta[73], beta[74], beta[75], beta[76], beta[77], beta[78], beta[79], beta[80], beta[81], beta[82], beta[83], beta[84], beta[85])
parameterreference mean±sdstan mean±sd
alpha1.36 ± 0.028
mu_beta-0.537 ± 0.086
sigma_beta0.299 ± 0.115
sigma_y0.782 ± 0.019
beta[1]-0.562 ± 0.285
beta[2]-0.806 ± 0.265
beta[3]-0.534 ± 0.275
beta[4]-0.536 ± 0.233
beta[5]-0.520 ± 0.299
beta[6]-0.551 ± 0.330
beta[7]-0.216 ± 0.334
beta[8]-0.444 ± 0.256
beta[9]-0.404 ± 0.313
beta[10]-0.600 ± 0.252
beta[11]-0.515 ± 0.333
beta[12]-0.552 ± 0.319
beta[13]-0.541 ± 0.335
beta[14]-0.458 ± 0.245
beta[15]-0.538 ± 0.279
beta[16]-0.556 ± 0.319
beta[17]-0.691 ± 0.260
beta[18]-0.483 ± 0.244
beta[19]-0.649 ± 0.249
beta[20]-0.556 ± 0.338
beta[21]-0.466 ± 0.291
beta[22]-0.595 ± 0.288
beta[23]-0.524 ± 0.293
beta[24]-0.420 ± 0.306
beta[25]-0.207 ± 0.323
beta[26]-0.670 ± 0.180
beta[27]-0.441 ± 0.283
beta[28]-0.577 ± 0.251
beta[29]-0.534 ± 0.334
beta[30]-0.536 ± 0.333
beta[31]-0.503 ± 0.322
beta[32]-0.537 ± 0.321
beta[33]-0.527 ± 0.359
beta[34]-0.551 ± 0.283
beta[35]-0.661 ± 0.235
beta[36]-0.296 ± 0.353
beta[37]-0.601 ± 0.319
beta[38]-0.432 ± 0.276
beta[39]-0.480 ± 0.305
beta[40]-0.467 ± 0.281
beta[41]-0.394 ± 0.331
beta[42]-0.539 ± 0.326
beta[43]-0.822 ± 0.268
beta[44]-0.721 ± 0.298
beta[45]-0.688 ± 0.229
beta[46]-0.540 ± 0.343
beta[47]-0.712 ± 0.297
beta[48]-0.502 ± 0.277
beta[49]-0.675 ± 0.286
beta[50]-0.528 ± 0.329
beta[51]-0.542 ± 0.332
beta[52]-0.533 ± 0.355
beta[53]-0.597 ± 0.293
beta[54]-0.745 ± 0.261
beta[55]-0.457 ± 0.255
beta[56]-0.679 ± 0.268
beta[57]-0.603 ± 0.284
beta[58]-0.453 ± 0.313
beta[59]-0.578 ± 0.281
beta[60]-0.553 ± 0.327
beta[61]-0.404 ± 0.255
beta[62]-0.248 ± 0.346
beta[63]-0.407 ± 0.320
beta[64]-0.537 ± 0.298
beta[65]-0.561 ± 0.337
beta[66]-0.425 ± 0.206
beta[67]-0.250 ± 0.279
beta[68]-0.561 ± 0.341
beta[69]-0.559 ± 0.316
beta[70]-0.835 ± 0.177
beta[71]-0.608 ± 0.247
beta[72]-0.531 ± 0.327
beta[73]-0.542 ± 0.326
beta[74]-0.545 ± 0.335
beta[75]-0.392 ± 0.320
beta[76]-0.503 ± 0.300
beta[77]-0.618 ± 0.294
beta[78]-0.608 ± 0.263
beta[79]-0.637 ± 0.303
beta[80]-0.711 ± 0.242
beta[81]-0.250 ± 0.312
beta[82]-0.555 ± 0.328
beta[83]-0.803 ± 0.279
beta[84]-0.521 ± 0.301
beta[85]-0.538 ± 0.317
03 verification
checkstatusevidence
cross-language (stan vs reference)
posteriordb-rats_data / rats_model
answer record(alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], beta[10], beta[11], beta[12], beta[13], beta[14], beta[15], beta[16], beta[17], beta[18], beta[19], beta[20], beta[21], beta[22], beta[23], beta[24], beta[25], beta[26], beta[27], beta[28], beta[29], beta[30], mu_alpha, mu_beta, sigma_y, sigma_alpha, sigma_beta, alpha0) stan
00 statement source: posteriordb/rats_data-rats_model
given

Thirty young rats had their weights measured at five time points as they aged. The data provide, for each of the 150 measurements, the rat index (1..30), the age x in days, and the measured weight y; the centering age xbar = 22 is also given. Each rat j has its own intercept alpha_j and slope beta_j. The population intercept mean mu_alpha and population slope mean mu_beta each have a Normal(mean 0, sd 100) prior. The three positive standard deviations sigma_y, sigma_alpha, and sigma_beta have improper uniform (flat) priors.

model

The per-rat intercepts are drawn independently as alpha_j ~ Normal(mu_alpha, sigma_alpha) and the per-rat slopes as beta_j ~ Normal(mu_beta, sigma_beta). Each weight measurement y for rat j at age x is Normal-distributed with mean alpha_j + beta_j * (x - xbar) and standard deviation sigma_y. The intercept at zero age is the derived quantity alpha0 = mu_alpha - xbar * mu_beta.

query

The marginal posterior distribution of each parameter given the data: the per-rat intercepts alpha_1..alpha_30 and slopes beta_1..beta_30, the population means mu_alpha and mu_beta, the standard deviations sigma_y, sigma_alpha, and sigma_beta, and the derived zero-age intercept alpha0.

answer spec record(alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], beta[10], beta[11], beta[12], beta[13], beta[14], beta[15], beta[16], beta[17], beta[18], beta[19], beta[20], beta[21], beta[22], beta[23], beta[24], beta[25], beta[26], beta[27], beta[28], beta[29], beta[30], mu_alpha, mu_beta, sigma_y, sigma_alpha, sigma_beta, alpha0)
{
  "kind": "record",
  "fields": {
    "alpha[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[22]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[23]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[24]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[25]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[26]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[27]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[28]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[29]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[30]": {
      "kind": "dist",
      "domain": "real"
    },
    "mu_alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "mu_beta": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_y": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_alpha": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma_beta": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha0": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization
stan
1// Model simplified
2data {
3 int<lower=0> N; // Number of rats
4 int<lower=0> Npts; // Number of data points
5 array[Npts] int<lower=0> rat; // Lookup index -> rat
6 array[Npts] real x;
7 array[Npts] real y;
8 real xbar;
9}
10parameters {
11 array[N] real alpha;
12 array[N] real beta;
13
14 real mu_alpha;
15 real mu_beta; // beta.c in original bugs model
16 real<lower=0> sigma_y; // sigma in original bugs model
17 real<lower=0> sigma_alpha;
18 real<lower=0> sigma_beta;
19}
20model {
21 mu_alpha ~ normal(0, 100);
22 mu_beta ~ normal(0, 100);
23 // sigma_y, sigma_alpha, sigma_beta : flat
24 alpha ~ normal(mu_alpha, sigma_alpha); // vectorized
25 beta ~ normal(mu_beta, sigma_beta); // vectorized
26 for (n in 1 : Npts) {
27 int irat;
28 irat = rat[n];
29 y[n] ~ normal(alpha[irat] + beta[irat] * (x[n] - xbar), sigma_y);
30 }
31}
32generated quantities {
33 real alpha0;
34 alpha0 = mu_alpha - xbar * mu_beta;
35}
36
37//@ DATA { N: 30, Npts: 150, rat: [150 values], x: [150 values], y: [150 values], xbar: 22 } // values supplied at runtime
38//@ PARAMS ["alpha[1]","alpha[2]","alpha[3]","alpha[4]","alpha[5]","alpha[6]","alpha[7]","alpha[8]","alpha[9]","alpha[10]","alpha[11]","alpha[12]","alpha[13]","alpha[14]","alpha[15]","alpha[16]","alpha[17]","alpha[18]","alpha[19]","alpha[20]","alpha[21]","alpha[22]","alpha[23]","alpha[24]","alpha[25]","alpha[26]","alpha[27]","alpha[28]","alpha[29]","alpha[30]","beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","beta[6]","beta[7]","beta[8]","beta[9]","beta[10]","beta[11]","beta[12]","beta[13]","beta[14]","beta[15]","beta[16]","beta[17]","beta[18]","beta[19]","beta[20]","beta[21]","beta[22]","beta[23]","beta[24]","beta[25]","beta[26]","beta[27]","beta[28]","beta[29]","beta[30]","mu_alpha","mu_beta","sigma_y","sigma_alpha","sigma_beta","alpha0"]
39//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
40
02answer overlay — reference vs stanrecord(alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6], alpha[7], alpha[8], alpha[9], alpha[10], alpha[11], alpha[12], alpha[13], alpha[14], alpha[15], alpha[16], alpha[17], alpha[18], alpha[19], alpha[20], alpha[21], alpha[22], alpha[23], alpha[24], alpha[25], alpha[26], alpha[27], alpha[28], alpha[29], alpha[30], beta[1], beta[2], beta[3], beta[4], beta[5], beta[6], beta[7], beta[8], beta[9], beta[10], beta[11], beta[12], beta[13], beta[14], beta[15], beta[16], beta[17], beta[18], beta[19], beta[20], beta[21], beta[22], beta[23], beta[24], beta[25], beta[26], beta[27], beta[28], beta[29], beta[30], mu_alpha, mu_beta, sigma_y, sigma_alpha, sigma_beta, alpha0)
parameterreference mean±sdstan mean±sd
alpha[1]239.7 ± 2.74
alpha[2]247.7 ± 2.60
alpha[3]252.4 ± 2.70
alpha[4]232.5 ± 2.69
alpha[5]231.7 ± 2.86
alpha[6]249.6 ± 2.59
alpha[7]228.4 ± 2.79
alpha[8]248.2 ± 2.64
alpha[9]283.3 ± 2.53
alpha[10]219.1 ± 2.76
alpha[11]258.1 ± 2.58
alpha[12]228.2 ± 2.70
alpha[13]242.2 ± 2.77
alpha[14]268.2 ± 2.76
alpha[15]242.9 ± 2.76
alpha[16]245.4 ± 2.62
alpha[17]232.0 ± 2.82
alpha[18]240.5 ± 2.61
alpha[19]253.9 ± 2.65
alpha[20]241.8 ± 2.58
alpha[21]248.5 ± 2.76
alpha[22]225.2 ± 2.65
alpha[23]228.4 ± 2.64
alpha[24]245.1 ± 2.64
alpha[25]234.6 ± 2.72
alpha[26]254.0 ± 2.75
alpha[27]254.5 ± 2.57
alpha[28]243.0 ± 2.74
alpha[29]217.9 ± 2.75
alpha[30]241.6 ± 2.69
beta[1]6.06 ± 0.237
beta[2]7.04 ± 0.252
beta[3]6.48 ± 0.248
beta[4]5.34 ± 0.268
beta[5]6.59 ± 0.247
beta[6]6.18 ± 0.241
beta[7]5.98 ± 0.229
beta[8]6.40 ± 0.242
beta[9]7.04 ± 0.261
beta[10]5.86 ± 0.250
beta[11]6.80 ± 0.252
beta[12]6.14 ± 0.229
beta[13]6.16 ± 0.234
beta[14]6.68 ± 0.242
beta[15]5.40 ± 0.252
beta[16]5.93 ± 0.235
beta[17]6.27 ± 0.249
beta[18]5.83 ± 0.245
beta[19]6.42 ± 0.258
beta[20]6.06 ± 0.248
beta[21]6.38 ± 0.234
beta[22]5.85 ± 0.240
beta[23]5.74 ± 0.252
beta[24]5.89 ± 0.243
beta[25]6.91 ± 0.257
beta[26]6.54 ± 0.253
beta[27]5.91 ± 0.244
beta[28]5.83 ± 0.241
beta[29]5.66 ± 0.247
beta[30]6.12 ± 0.227
mu_alpha242.2 ± 2.80
mu_beta6.19 ± 0.112
sigma_y6.13 ± 0.464
sigma_alpha14.85 ± 2.12
sigma_beta0.530 ± 0.099
alpha0106.1 ± 3.59
03 verification
checkstatusevidence
cross-language (stan vs reference)
posteriordb-sblrc / blr
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], sigma) stan pass 0.0035
00 statement source: posteriordb/sblrc-blr
given

For each of N observations, the data provide D predictors (real-valued) and a response variable (real-valued). The regression has D coefficients, one for each predictor, each with a Normal(0, 10) prior with mean 0 and standard deviation 10. The error standard deviation sigma, constrained positive, has a flat improper uniform prior over the positive reals (equivalent to a normal(0, 10) prior applied to the positive reals).

model

Each observation's response is Normal-distributed with a mean equal to the linear combination of the D predictors and their coefficients, and a common standard deviation sigma across all observations.

query

The marginal posterior distributions of each of the D+1 parameters: the D regression coefficients beta[1], beta[2], beta[3], beta[4], beta[5], and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.004
stan
1data {
2 int<lower=0> N;
3 int<lower=0> D;
4 matrix[N, D] X;
5 vector[N] y;
6}
7parameters {
8 vector[D] beta;
9 real<lower=0> sigma;
10}
11model {
12 // prior
13 target += normal_lpdf(beta | 0, 10);
14 target += normal_lpdf(sigma | 0, 10);
15 // likelihood
16 target += normal_lpdf(y | X * beta, sigma);
17}
18
19//@ DATA { y: [100 values], X: [100×5 matrix], D: 5, N: 100 } // values supplied at runtime
20//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","sigma"]
21//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
22
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], sigma)
beta[1]
reference stan8 bins · 1.00 … 1.00
00.190.190.380.380.996 A = 0.000 B = 0.0040.996 A = 0.000 B = 0.0040.9960.997 A = 0.008 B = 0.0160.997 A = 0.008 B = 0.0160.010.020.9970.998 A = 0.110 B = 0.1180.998 A = 0.110 B = 0.1180.110.120.9980.999 A = 0.312 B = 0.2740.999 A = 0.312 B = 0.2740.310.270.9991 A = 0.376 B = 0.3421 A = 0.376 B = 0.3420.380.3411.001 A = 0.166 B = 0.2021.001 A = 0.166 B = 0.2020.170.201.0011.002 A = 0.024 B = 0.0441.002 A = 0.024 B = 0.0440.020.041.0021.003 A = 0.004 B = 0.0001.003 A = 0.004 B = 0.0001.003
beta[2]
reference stan8 bins · 0.99 … 1.00
00.190.190.380.380.995 A = 0.002 B = 0.0000.995 A = 0.002 B = 0.0000.9950.996 A = 0.012 B = 0.0200.996 A = 0.012 B = 0.0200.010.020.9960.997 A = 0.100 B = 0.0940.997 A = 0.100 B = 0.0940.100.090.9970.998 A = 0.278 B = 0.2560.998 A = 0.278 B = 0.2560.280.260.9980.999 A = 0.372 B = 0.3820.999 A = 0.372 B = 0.3820.370.380.9991 A = 0.204 B = 0.1861 A = 0.204 B = 0.1860.200.1911.001 A = 0.030 B = 0.0581.001 A = 0.030 B = 0.0580.030.061.0011.002 A = 0.002 B = 0.0041.002 A = 0.002 B = 0.0041.002
beta[3]
reference stan9 bins · 0.99 … 1.00
00.180.180.370.370.994 A = 0.000 B = 0.0020.994 A = 0.000 B = 0.0020.9940.995 A = 0.008 B = 0.0040.995 A = 0.008 B = 0.0040.996 A = 0.036 B = 0.0680.996 A = 0.036 B = 0.0680.9960.997 A = 0.202 B = 0.1840.997 A = 0.202 B = 0.1840.998 A = 0.370 B = 0.3060.998 A = 0.370 B = 0.3060.9980.999 A = 0.274 B = 0.3080.999 A = 0.274 B = 0.3081 A = 0.096 B = 0.1181 A = 0.096 B = 0.11811.001 A = 0.012 B = 0.0101.001 A = 0.012 B = 0.0101.002 A = 0.002 B = 0.0001.002 A = 0.002 B = 0.0001.002
beta[4]
reference stan8 bins · 0.99 … 1.00
00.190.190.380.380.995 A = 0.000 B = 0.0040.995 A = 0.000 B = 0.0040.9950.996 A = 0.014 B = 0.0100.996 A = 0.014 B = 0.0100.010.010.9960.997 A = 0.094 B = 0.0780.997 A = 0.094 B = 0.0780.090.080.9970.998 A = 0.250 B = 0.2660.998 A = 0.250 B = 0.2660.250.270.9980.999 A = 0.378 B = 0.3400.999 A = 0.378 B = 0.3400.380.340.9991 A = 0.210 B = 0.2341 A = 0.210 B = 0.2340.210.2311.001 A = 0.050 B = 0.0641.001 A = 0.050 B = 0.0640.050.061.0011.002 A = 0.004 B = 0.0041.002 A = 0.004 B = 0.0041.002
beta[5]
reference stan8 bins · 0.99 … 1.00
00.190.190.380.380.995 A = 0.002 B = 0.0040.995 A = 0.002 B = 0.0040.9950.996 A = 0.016 B = 0.0080.996 A = 0.016 B = 0.0080.020.010.9960.997 A = 0.110 B = 0.1240.997 A = 0.110 B = 0.1240.110.120.9970.998 A = 0.332 B = 0.2700.998 A = 0.332 B = 0.2700.330.270.9980.999 A = 0.366 B = 0.3800.999 A = 0.366 B = 0.3800.370.380.9991 A = 0.164 B = 0.1981 A = 0.164 B = 0.1980.160.2011.001 A = 0.010 B = 0.0141.001 A = 0.010 B = 0.0140.010.011.0011.002 A = 0.000 B = 0.0021.002 A = 0.000 B = 0.0021.002
sigma
reference stan24 bins · 0.86 … 1.30
00.060.060.120.1211.201.02 · 0.1201.05 · 0.110x = 0.86 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.88 A = 0.0060 B = 0.0040 Δ = 0.0020x = 0.90 A = 0.0220 B = 0.0120 Δ = 0.0100x = 0.92 A = 0.0360 B = 0.0200 Δ = 0.0160x = 0.94 A = 0.0400 B = 0.0480 Δ = -0.0080x = 0.96 A = 0.0580 B = 0.0580 Δ = -0.0000x = 0.98 A = 0.0800 B = 0.0920 Δ = -0.0120x = 1.00 A = 0.0940 B = 0.0940 Δ = 0.0000x = 1.02 A = 0.1200 B = 0.0900 Δ = 0.0300x = 1.03 A = 0.1000 B = 0.0840 Δ = 0.0160x = 1.05 A = 0.1060 B = 0.1100 Δ = -0.0040x = 1.07 A = 0.1000 B = 0.0960 Δ = 0.0040x = 1.09 A = 0.0500 B = 0.1000 Δ = -0.0500x = 1.11 A = 0.0400 B = 0.0520 Δ = -0.0120x = 1.13 A = 0.0320 B = 0.0460 Δ = -0.0140x = 1.15 A = 0.0420 B = 0.0280 Δ = 0.0140x = 1.17 A = 0.0300 B = 0.0240 Δ = 0.0060x = 1.19 A = 0.0120 B = 0.0220 Δ = -0.0100x = 1.21 A = 0.0160 B = 0.0040 Δ = 0.0120x = 1.23 A = 0.0100 B = 0.0100 Δ = 0.0000x = 1.25 A = 0.0000 B = 0.0040 Δ = -0.0040x = 1.26 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.28 A = 0.0000 B = 0.0020 Δ = -0.0020x = 1.30 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0035 ≤ tol 0.0186 · floors 0.0093/0.0041
posteriordb-sblri / blr
answer record(beta[1], beta[2], beta[3], beta[4], beta[5], sigma) stan pass 0.0036
00 statement source: posteriordb/sblri-blr
given

For each of N = 100 observations, the data provide a response variable y and D = 5 predictor values arranged in a design matrix X (100 rows by 5 columns). The five regression coefficients beta[1], beta[2], beta[3], beta[4], beta[5] each have an improper flat (uniform) prior over the real line. The error standard deviation sigma, constrained positive, has a normal(0, 10) prior.

model

Each observation's response y[i] is normally distributed with a mean equal to the linear combination of the five predictors weighted by their corresponding coefficients (beta[1] through beta[5]), and a common standard deviation sigma across all observations.

query

The marginal posterior distributions of the six parameters: the five regression coefficients (beta[1], beta[2], beta[3], beta[4], beta[5]) and the error standard deviation sigma.

answer spec record(beta[1], beta[2], beta[3], beta[4], beta[5], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.004
stan
1data {
2 int<lower=0> N;
3 int<lower=0> D;
4 matrix[N, D] X;
5 vector[N] y;
6}
7parameters {
8 vector[D] beta;
9 real<lower=0> sigma;
10}
11model {
12 // prior
13 target += normal_lpdf(beta | 0, 10);
14 target += normal_lpdf(sigma | 0, 10);
15 // likelihood
16 target += normal_lpdf(y | X * beta, sigma);
17}
18
19//@ DATA { y: [100 values], X: [100×5 matrix], D: 5, N: 100 } // values supplied at runtime
20//@ PARAMS ["beta[1]","beta[2]","beta[3]","beta[4]","beta[5]","sigma"]
21//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
22
02answer overlay — reference vs stanrecord(beta[1], beta[2], beta[3], beta[4], beta[5], sigma)
beta[1]
reference stan7 bins · 1.00 … 1.00
00.180.180.360.360.996 A = 0.000 B = 0.0020.996 A = 0.000 B = 0.0020.9960.997 A = 0.022 B = 0.0220.997 A = 0.022 B = 0.0220.020.020.9970.998 A = 0.130 B = 0.1580.998 A = 0.130 B = 0.1580.130.160.9980.999 A = 0.362 B = 0.3340.999 A = 0.362 B = 0.3340.360.330.9991 A = 0.348 B = 0.3521 A = 0.348 B = 0.3520.350.3511.001 A = 0.120 B = 0.1261.001 A = 0.120 B = 0.1260.120.131.0011.002 A = 0.018 B = 0.0061.002 A = 0.018 B = 0.0060.020.011.002
beta[2]
reference stan9 bins · 1.00 … 1.00
00.170.170.340.340.996 A = 0.002 B = 0.0000.996 A = 0.002 B = 0.0000.9960.997 A = 0.010 B = 0.0020.997 A = 0.010 B = 0.0020.998 A = 0.050 B = 0.0560.998 A = 0.050 B = 0.0560.9980.999 A = 0.162 B = 0.2000.999 A = 0.162 B = 0.2001 A = 0.342 B = 0.3401 A = 0.342 B = 0.34011.001 A = 0.278 B = 0.2681.001 A = 0.278 B = 0.2681.002 A = 0.140 B = 0.1181.002 A = 0.140 B = 0.1181.0021.003 A = 0.014 B = 0.0161.003 A = 0.014 B = 0.0161.004 A = 0.002 B = 0.0001.004 A = 0.002 B = 0.0001.004
beta[3]
reference stan6 bins · 1.00 … 1.00
00.190.190.390.390.998 A = 0.028 B = 0.0160.998 A = 0.028 B = 0.0160.030.020.9980.999 A = 0.140 B = 0.1380.999 A = 0.140 B = 0.1380.140.140.9991 A = 0.388 B = 0.3781 A = 0.388 B = 0.3780.390.3811.001 A = 0.328 B = 0.3381.001 A = 0.328 B = 0.3380.330.341.0011.002 A = 0.102 B = 0.1221.002 A = 0.102 B = 0.1220.100.121.0021.003 A = 0.014 B = 0.0081.003 A = 0.014 B = 0.0080.010.011.003
beta[4]
reference stan7 bins · 1.00 … 1.00
00.180.180.360.360.998 A = 0.010 B = 0.0040.998 A = 0.010 B = 0.0040.010.9980.999 A = 0.052 B = 0.0600.999 A = 0.052 B = 0.0600.050.060.9991 A = 0.196 B = 0.2281 A = 0.196 B = 0.2280.200.2311.001 A = 0.364 B = 0.3481.001 A = 0.364 B = 0.3480.360.351.0011.002 A = 0.276 B = 0.2501.002 A = 0.276 B = 0.2500.280.251.0021.003 A = 0.096 B = 0.0921.003 A = 0.096 B = 0.0920.100.091.0031.004 A = 0.006 B = 0.0181.004 A = 0.006 B = 0.0180.010.021.004
beta[5]
reference stan9 bins · 1.00 … 1.01
00.170.170.340.340.998 A = 0.002 B = 0.0060.998 A = 0.002 B = 0.0060.9980.999 A = 0.024 B = 0.0360.999 A = 0.024 B = 0.0361 A = 0.122 B = 0.1221 A = 0.122 B = 0.12211.001 A = 0.324 B = 0.3121.001 A = 0.324 B = 0.3121.002 A = 0.342 B = 0.3241.002 A = 0.342 B = 0.3241.0021.003 A = 0.154 B = 0.1641.003 A = 0.154 B = 0.1641.004 A = 0.026 B = 0.0261.004 A = 0.026 B = 0.0261.0041.005 A = 0.004 B = 0.0101.005 A = 0.004 B = 0.0101.006 A = 0.002 B = 0.0001.006 A = 0.002 B = 0.0001.006
sigma
reference stan24 bins · 0.79 … 1.28
00.060.060.130.130.8011.200.92 · 0.1280.92 · 0.120x = 0.79 A = 0.0040 B = 0.0120 Δ = -0.0080x = 0.81 A = 0.0100 B = 0.0160 Δ = -0.0060x = 0.83 A = 0.0200 B = 0.0180 Δ = 0.0020x = 0.85 A = 0.0480 B = 0.0360 Δ = 0.0120x = 0.88 A = 0.0640 B = 0.0760 Δ = -0.0120x = 0.90 A = 0.0760 B = 0.0600 Δ = 0.0160x = 0.92 A = 0.1280 B = 0.1200 Δ = 0.0080x = 0.94 A = 0.1080 B = 0.1140 Δ = -0.0060x = 0.96 A = 0.1120 B = 0.1080 Δ = 0.0040x = 0.98 A = 0.1000 B = 0.1020 Δ = -0.0020x = 1.00 A = 0.0900 B = 0.1000 Δ = -0.0100x = 1.02 A = 0.0660 B = 0.0920 Δ = -0.0260x = 1.04 A = 0.0700 B = 0.0480 Δ = 0.0220x = 1.07 A = 0.0360 B = 0.0440 Δ = -0.0080x = 1.09 A = 0.0280 B = 0.0140 Δ = 0.0140x = 1.11 A = 0.0200 B = 0.0140 Δ = 0.0060x = 1.13 A = 0.0120 B = 0.0080 Δ = 0.0040x = 1.15 A = 0.0040 B = 0.0060 Δ = -0.0020x = 1.17 A = 0.0000 B = 0.0120 Δ = -0.0120x = 1.19 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.21 A = 0.0020 B = 0.0000 Δ = 0.0020x = 1.24 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.26 A = 0.0000 B = 0.0000 Δ = 0.0000x = 1.28 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0036 ≤ tol 0.0165 · floors 0.0082/0.0034
posteriordb-seeds_data / seeds_model
answer record(alpha0, alpha1, alpha12, alpha2, tau, b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20], b[21], sigma) stan
00 statement source: posteriordb/seeds_data-seeds_model
given

A seed-germination experiment recorded, for each of 21 plates, the number of seeds that germinated (n) out of the total number planted (N). Two binary plate-level covariates are provided: x1, the seed type, and x2, the root-extract type. The four regression coefficients alpha0, alpha1, alpha2, and alpha12 each have a Normal(mean 0, sd 1000) prior. The precision tau has a Gamma(shape 0.001, rate 0.001) prior, and the random-effect standard deviation is sigma = 1 / sqrt(tau).

model

Each plate i has a random effect b_i drawn from a Normal(0, sigma) distribution. The number germinated n_i is Binomial with N_i trials and success probability given by the inverse logit of alpha0 + alpha1 * x1_i + alpha2 * x2_i + alpha12 * x1_i * x2_i + b_i.

query

The marginal posterior distribution of each parameter given the data: the coefficients alpha0, alpha1, alpha2, and alpha12, the per-plate random effects b_1..b_21, the precision tau, and the random-effect standard deviation sigma.

answer spec record(alpha0, alpha1, alpha12, alpha2, tau, b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20], b[21], sigma)
{
  "kind": "record",
  "fields": {
    "alpha0": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha1": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha12": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha2": {
      "kind": "dist",
      "domain": "real"
    },
    "tau": {
      "kind": "dist",
      "domain": "real"
    },
    "b[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization
stan
1data {
2 int<lower=0> I;
3 array[I] int<lower=0> n;
4 array[I] int<lower=0> N;
5 vector[I] x1;
6 vector[I] x2;
7}
8transformed data {
9 vector[I] x1x2;
10 x1x2 = x1 .* x2;
11}
12parameters {
13 real alpha0;
14 real alpha1;
15 real alpha12;
16 real alpha2;
17 real<lower=0> tau;
18 vector[I] b;
19}
20transformed parameters {
21 real<lower=0> sigma;
22 sigma = 1.0 / sqrt(tau);
23}
24model {
25 alpha0 ~ normal(0.0, 1.0E3);
26 alpha1 ~ normal(0.0, 1.0E3);
27 alpha2 ~ normal(0.0, 1.0E3);
28 alpha12 ~ normal(0.0, 1.0E3);
29 tau ~ gamma(1.0E-3, 1.0E-3);
30
31 b ~ normal(0.0, sigma);
32 n ~ binomial_logit(N,
33 alpha0 + alpha1 * x1 + alpha2 * x2 + alpha12 * x1x2 + b);
34}
35
36//@ DATA { I: 21, n: [21 values], N: [21 values], x1: [21 values], x2: [21 values] } // values supplied at runtime
37//@ PARAMS ["alpha0","alpha1","alpha12","alpha2","tau","b[1]","b[2]","b[3]","b[4]","b[5]","b[6]","b[7]","b[8]","b[9]","b[10]","b[11]","b[12]","b[13]","b[14]","b[15]","b[16]","b[17]","b[18]","b[19]","b[20]","b[21]","sigma"]
38//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
39
02answer overlay — reference vs stanrecord(alpha0, alpha1, alpha12, alpha2, tau, b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20], b[21], sigma)
parameterreference mean±sdstan mean±sd
alpha0-0.537 ± 0.198
alpha10.084 ± 0.312
alpha12-0.829 ± 0.416
alpha21.34 ± 0.275
tau69.12 ± 187.7
b[1]-0.192 ± 0.258
b[2]0.011 ± 0.222
b[3]-0.228 ± 0.234
b[4]0.249 ± 0.252
b[5]0.089 ± 0.244
b[6]0.098 ± 0.291
b[7]0.057 ± 0.216
b[8]0.177 ± 0.229
b[9]-0.128 ± 0.232
b[10]-0.262 ± 0.254
b[11]0.091 ± 0.295
b[12]0.105 ± 0.292
b[13]-0.087 ± 0.235
b[14]-0.134 ± 0.255
b[15]0.215 ± 0.256
b[16]-0.154 ± 0.320
b[17]-0.223 ± 0.336
b[18]0.044 ± 0.233
b[19]-0.020 ± 0.228
b[20]0.213 ± 0.276
b[21]-0.033 ± 0.284
sigma0.281 ± 0.144
03 verification
checkstatusevidence
cross-language (stan vs reference)
posteriordb-seeds_data / seeds_stanified_model
answer record(alpha0, alpha1, alpha12, alpha2, b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20], b[21], sigma) stan
00 statement source: posteriordb/seeds_data-seeds_stanified_model
given

A seed-germination experiment recorded, for each of 21 plates, the number of seeds that germinated (n) out of the total number planted (N). Two binary plate-level covariates are provided: x1, the seed type, and x2, the root-extract type. The four regression coefficients alpha0, alpha1, alpha2, and alpha12 each have a Normal(mean 0, sd 1) prior. The random-effect standard deviation sigma, constrained positive, has a half-Cauchy(location 0, scale 1) prior.

model

Each plate i has a random effect b_i drawn from a Normal(0, sigma) distribution. The number germinated n_i is Binomial with N_i trials and success probability given by the inverse logit of alpha0 + alpha1 * x1_i + alpha2 * x2_i + alpha12 * x1_i * x2_i + b_i.

query

The marginal posterior distribution of each parameter given the data: the coefficients alpha0, alpha1, alpha2, and alpha12, the per-plate random effects b_1..b_21, and the random-effect standard deviation sigma.

answer spec record(alpha0, alpha1, alpha12, alpha2, b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20], b[21], sigma)
{
  "kind": "record",
  "fields": {
    "alpha0": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha1": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha12": {
      "kind": "dist",
      "domain": "real"
    },
    "alpha2": {
      "kind": "dist",
      "domain": "real"
    },
    "b[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[13]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[14]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[15]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[16]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[17]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[18]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[19]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[20]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[21]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization
stan
1data {
2 int<lower=0> I;
3 array[I] int<lower=0> n;
4 array[I] int<lower=0> N;
5 vector[I] x1; // seed type
6 vector[I] x2; // root extract
7}
8transformed data {
9 vector[I] x1x2;
10 x1x2 = x1 .* x2;
11}
12parameters {
13 real alpha0;
14 real alpha1;
15 real alpha12;
16 real alpha2;
17 vector[I] b;
18 real<lower=0> sigma;
19}
20model {
21 alpha0 ~ normal(0.0, 1.0); // Narrower priors
22 alpha1 ~ normal(0.0, 1.0);
23 alpha2 ~ normal(0.0, 1.0);
24 alpha12 ~ normal(0.0, 1.0);
25 sigma ~ cauchy(0, 1);
26
27 b ~ normal(0.0, sigma);
28 n ~ binomial_logit(N,
29 alpha0 + alpha1 * x1 + alpha2 * x2 + alpha12 * x1x2 + b);
30}
31
32//@ DATA { I: 21, n: [21 values], N: [21 values], x1: [21 values], x2: [21 values] } // values supplied at runtime
33//@ PARAMS ["alpha0","alpha1","alpha12","alpha2","b[1]","b[2]","b[3]","b[4]","b[5]","b[6]","b[7]","b[8]","b[9]","b[10]","b[11]","b[12]","b[13]","b[14]","b[15]","b[16]","b[17]","b[18]","b[19]","b[20]","b[21]","sigma"]
34//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
35
02answer overlay — reference vs stanrecord(alpha0, alpha1, alpha12, alpha2, b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20], b[21], sigma)
parameterreference mean±sdstan mean±sd
alpha0-0.448 ± 0.194
alpha1-0.076 ± 0.303
alpha12-0.583 ± 0.408
alpha21.19 ± 0.260
b[1]-0.295 ± 0.289
b[2]-0.066 ± 0.243
b[3]-0.318 ± 0.257
b[4]0.283 ± 0.246
b[5]0.082 ± 0.235
b[6]0.133 ± 0.363
b[7]0.118 ± 0.240
b[8]0.254 ± 0.256
b[9]-0.111 ± 0.240
b[10]-0.250 ± 0.248
b[11]0.101 ± 0.320
b[12]0.192 ± 0.313
b[13]-0.065 ± 0.284
b[14]-0.133 ± 0.280
b[15]0.308 ± 0.305
b[16]-0.166 ± 0.347
b[17]-0.259 ± 0.333
b[18]0.043 ± 0.274
b[19]-0.029 ± 0.277
b[20]0.242 ± 0.280
b[21]-0.059 ± 0.315
sigma0.344 ± 0.135
03 verification
checkstatusevidence
cross-language (stan vs reference)
posteriordb-sesame_data / sesame_one_pred_a
answer record(beta[1], beta[2], sigma) stan
00 statement source: posteriordb/sesame_data-sesame_one_pred_a
given

In a study of the television program Sesame Street, 240 children were each either encouraged or not encouraged to watch the program, and it was recorded whether each child actually watched. For each child i (i = 1..240) two binary indicators are provided as data: encouraged_i, equal to 1 if the child was encouraged and 0 otherwise, and watched_i, equal to 1 if the child watched and 0 otherwise. The regression coefficients beta_1 and beta_2 and the positive residual standard deviation sigma are all given improper uniform (flat) priors.

model

The watched indicator for child i is modeled as a linear regression on the encouragement indicator: watched_i is Normal-distributed with mean beta_1 + beta_2 * encouraged_i and standard deviation sigma.

query

The marginal posterior distribution of each parameter given the data: the intercept beta_1, the encouragement coefficient beta_2, and the residual standard deviation sigma.

answer spec record(beta[1], beta[2], sigma)
{
  "kind": "record",
  "fields": {
    "beta[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "beta[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization
stan
1data {
2 int<lower=0> N;
3 vector[N] encouraged;
4 vector[N] watched;
5}
6parameters {
7 vector[2] beta;
8 real<lower=0> sigma;
9}
10model {
11 watched ~ normal(beta[1] + beta[2] * encouraged, sigma);
12}
13
14//@ DATA { watched: [240 values], encouraged: [240 values], N: 240 } // values supplied at runtime
15//@ PARAMS ["beta[1]","beta[2]","sigma"]
16//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
17
02answer overlay — reference vs stanrecord(beta[1], beta[2], sigma)
beta[1]
reference stan24 bins · 0.42 … 0.67
00.060.060.110.110.500.600.53 · 0.114x = 0.42 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.43 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.44 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.46 A = 0.0200 B = 0.0000 Δ = 0.0200x = 0.47 A = 0.0200 B = 0.0000 Δ = 0.0200x = 0.48 A = 0.0140 B = 0.0000 Δ = 0.0140x = 0.49 A = 0.0300 B = 0.0000 Δ = 0.0300x = 0.50 A = 0.0540 B = 0.0000 Δ = 0.0540x = 0.51 A = 0.0720 B = 0.0000 Δ = 0.0720x = 0.52 A = 0.0600 B = 0.0000 Δ = 0.0600x = 0.53 A = 0.1140 B = 0.0000 Δ = 0.1140x = 0.54 A = 0.0940 B = 0.0000 Δ = 0.0940x = 0.55 A = 0.1060 B = 0.0000 Δ = 0.1060x = 0.56 A = 0.0900 B = 0.0000 Δ = 0.0900x = 0.57 A = 0.0960 B = 0.0000 Δ = 0.0960x = 0.58 A = 0.0820 B = 0.0000 Δ = 0.0820x = 0.60 A = 0.0440 B = 0.0000 Δ = 0.0440x = 0.61 A = 0.0400 B = 0.0000 Δ = 0.0400x = 0.62 A = 0.0220 B = 0.0000 Δ = 0.0220x = 0.63 A = 0.0140 B = 0.0000 Δ = 0.0140x = 0.64 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.65 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.66 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.67 A = 0.0020 B = 0.0000 Δ = 0.0020
beta[2]
reference stan24 bins · 0.20 … 0.52
00.050.050.110.110.200.400.35 · 0.106x = 0.20 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.21 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.23 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.24 A = 0.0040 B = 0.0000 Δ = 0.0040x = 0.26 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.27 A = 0.0300 B = 0.0000 Δ = 0.0300x = 0.28 A = 0.0340 B = 0.0000 Δ = 0.0340x = 0.30 A = 0.0480 B = 0.0000 Δ = 0.0480x = 0.31 A = 0.0640 B = 0.0000 Δ = 0.0640x = 0.32 A = 0.0960 B = 0.0000 Δ = 0.0960x = 0.34 A = 0.0700 B = 0.0000 Δ = 0.0700x = 0.35 A = 0.1060 B = 0.0000 Δ = 0.1060x = 0.36 A = 0.1020 B = 0.0000 Δ = 0.1020x = 0.38 A = 0.0780 B = 0.0000 Δ = 0.0780x = 0.39 A = 0.0840 B = 0.0000 Δ = 0.0840x = 0.41 A = 0.0880 B = 0.0000 Δ = 0.0880x = 0.42 A = 0.0600 B = 0.0000 Δ = 0.0600x = 0.43 A = 0.0320 B = 0.0000 Δ = 0.0320x = 0.45 A = 0.0360 B = 0.0000 Δ = 0.0360x = 0.46 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.47 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.49 A = 0.0120 B = 0.0000 Δ = 0.0120x = 0.50 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.52 A = 0.0020 B = 0.0000 Δ = 0.0020
sigma
reference stan24 bins · 0.33 … 0.44
00.060.060.110.110.350.400.39 · 0.112x = 0.33 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.34 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.34 A = 0.0080 B = 0.0000 Δ = 0.0080x = 0.35 A = 0.0100 B = 0.0000 Δ = 0.0100x = 0.35 A = 0.0220 B = 0.0000 Δ = 0.0220x = 0.36 A = 0.0440 B = 0.0000 Δ = 0.0440x = 0.36 A = 0.0560 B = 0.0000 Δ = 0.0560x = 0.37 A = 0.0940 B = 0.0000 Δ = 0.0940x = 0.37 A = 0.1020 B = 0.0000 Δ = 0.1020x = 0.38 A = 0.0940 B = 0.0000 Δ = 0.0940x = 0.38 A = 0.1100 B = 0.0000 Δ = 0.1100x = 0.39 A = 0.1120 B = 0.0000 Δ = 0.1120x = 0.39 A = 0.0880 B = 0.0000 Δ = 0.0880x = 0.40 A = 0.0800 B = 0.0000 Δ = 0.0800x = 0.40 A = 0.0520 B = 0.0000 Δ = 0.0520x = 0.41 A = 0.0460 B = 0.0000 Δ = 0.0460x = 0.41 A = 0.0340 B = 0.0000 Δ = 0.0340x = 0.41 A = 0.0240 B = 0.0000 Δ = 0.0240x = 0.42 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.42 A = 0.0060 B = 0.0000 Δ = 0.0060x = 0.43 A = 0.0020 B = 0.0000 Δ = 0.0020x = 0.43 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.44 A = 0.0000 B = 0.0000 Δ = 0.0000x = 0.44 A = 0.0020 B = 0.0000 Δ = 0.0020
03 verification
checkstatusevidence
cross-language (stan vs reference)
posteriordb-surgical_data / surgical_model
answer record(mu, sigmasq, b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], sigma, p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], pop_mean) stan pass 0.0158
00 statement source: posteriordb/surgical_data-surgical_model
given

Surgical mortality records are available for N = 12 hospitals; for each hospital i (i = 1..12) the number of operations n_i and the number of deaths r_i are provided as data arrays. The population mean log-odds mu has a Normal(mean 0, sd 1000) prior. The log-odds variance sigmasq is constrained to be positive and has an InverseGamma(shape 0.001, scale 0.001) prior.

model

Each hospital has an unknown log-odds of death b_i drawn independently from a Normal distribution with mean mu and standard deviation sigma = sqrt(sigmasq). The hospital's true failure probability is p_i = inv_logit(b_i). The observed number of deaths r_i follows a Binomial distribution with count n_i and probability p_i. A population-level derived quantity is the mean failure probability pop_mean = inv_logit(mu).

query

The marginal posterior distribution of each parameter and derived quantity given the data: the population log-odds mean mu, the log-odds variance sigmasq, the 12 hospital log-odds b_1, ..., b_12, the log-odds standard deviation sigma, the 12 hospital failure probabilities p_1, ..., p_12, and the population mean failure probability pop_mean.

answer spec record(mu, sigmasq, b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], sigma, p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], pop_mean)
{
  "kind": "record",
  "fields": {
    "mu": {
      "kind": "dist",
      "domain": "real"
    },
    "sigmasq": {
      "kind": "dist",
      "domain": "real"
    },
    "b[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "b[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "sigma": {
      "kind": "dist",
      "domain": "real"
    },
    "p[1]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[2]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[3]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[4]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[5]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[6]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[7]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[8]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[9]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[10]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[11]": {
      "kind": "dist",
      "domain": "real"
    },
    "p[12]": {
      "kind": "dist",
      "domain": "real"
    },
    "pop_mean": {
      "kind": "dist",
      "domain": "real"
    }
  }
}
system prompt constant across problems
(system prompt loads here)
01 realizations comparing reference vs stan
ground truth
stored ground truth

Gold reference posterior draws from posteriordb (10 NUTS chains, R-hat ≈ 1). Not program code — the realized marginals are the answer overlay below.

realization0.016
stan
1data {
2 int<lower=0> N;
3 array[N] int r;
4 array[N] int n;
5}
6parameters {
7 real mu;
8 real<lower=0> sigmasq;
9 array[N] real b;
10}
11transformed parameters {
12 real<lower=0> sigma;
13 array[N] real<lower=0, upper=1> p;
14 sigma = sqrt(sigmasq);
15 for (i in 1 : N) {
16 p[i] = inv_logit(b[i]);
17 }
18}
19model {
20 mu ~ normal(0.0, 1000.0);
21 sigmasq ~ inv_gamma(0.001, 0.001);
22 b ~ normal(mu, sigma);
23 r ~ binomial_logit(n, b);
24}
25generated quantities {
26 real pop_mean;
27 pop_mean = inv_logit(mu);
28}
29
30//@ DATA { N: 12, n: [12 values], r: [12 values] } // values supplied at runtime
31//@ PARAMS ["mu","sigmasq","b[1]","b[2]","b[3]","b[4]","b[5]","b[6]","b[7]","b[8]","b[9]","b[10]","b[11]","b[12]","sigma","p[1]","p[2]","p[3]","p[4]","p[5]","p[6]","p[7]","p[8]","p[9]","p[10]","p[11]","p[12]","pop_mean"]
32//@ SAMPLING {"chains":4,"iter_warmup":1000,"iter_sampling":1000}
33
02answer overlay — reference vs stanrecord(mu, sigmasq, b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], sigma, p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], pop_mean)
parameterreference mean±sdstan mean±sd
mu-2.54 ± 0.154
sigmasq0.186 ± 0.144
b[1]-2.95 ± 0.453
b[2]-2.18 ± 0.231
b[3]-2.61 ± 0.266
b[4]-2.78 ± 0.145
b[5]-2.94 ± 0.277
b[6]-2.60 ± 0.244
b[7]-2.65 ± 0.255
b[8]-1.98 ± 0.213
b[9]-2.61 ± 0.227
b[10]-2.48 ± 0.284
b[11]-2.18 ± 0.192
b[12]-2.63 ± 0.178
sigma0.405 ± 0.147
p[1]0.054 ± 0.020
p[2]0.103 ± 0.022
p[3]0.070 ± 0.017
p[4]0.059 ± 0.008
p[5]0.052 ± 0.013
p[6]0.071 ± 0.016
p[7]0.068 ± 0.016
p[8]0.123 ± 0.023
p[9]0.070 ± 0.015
p[10]0.080 ± 0.020
p[11]0.103 ± 0.018
p[12]0.068 ± 0.011
pop_mean0.074 ± 0.010
03 verification
checkstatusevidence
cross-language (stan vs reference) pass d=0.0158 ≤ tol 0.0478 · floors 0.0228/0.0239