AI Agents & Econometric Coding

Censored and truncated models

Truncated normal regression

Truncated normal conditional-mean effects.

The task

Task statement

The file contains only observations with y>0 from a population model y*=beta0+beta_x*x+beta_z*z+epsilon, with epsilon normal and constant unknown standard deviation sigma. The observed y equals y*. Fit the left-truncated normal model conditional on y*>0 by maximum likelihood on every supplied row. This is truncation: unobserved units are absent. Include an intercept. The log likelihood for one observed row is log phi((y-mu)/sigma)-log sigma-log Phi(mu/sigma), where mu is the linear index. Report latent_x, the estimated beta_x. Report mean_observed, the average fitted conditional mean E[y*|y*>0,x,z] over the supplied rows. Report ame_x, the average derivative of that same conditional mean with respect to continuous x, holding z fixed. Use each supplied row's covariates and equal weights. Set n_obs to the supplied row count for every result.

Data

Simulated CSV. Columns: y, x, z

Files
input.csv
Seed
2026091700

Required output

Scored estimates: mean_observed, ame_x, latent_x.

Reference output

TermReference estimateSample size
mean_observed0.92388176714
ame_x0.27587437714
latent_x0.724175714

A run succeeds when every scored estimate lies within 1 percent or 0.005 of its reference value, whichever is larger. Sample sizes are not scored.

Task success

Agency conditionClaude Sonnet 4.6GPT-5.6 Luna
Chatbot56.7%65.0%
Self-repair65.0%78.3%
Constrained agent100.0%95.0%
All runs
76.7% of 360 runs
By prompt condition
Zero-shot 73.3%, One-shot 80.0%
By software
Python 82.5%, R 80.0%, Stata 67.5%

About this benchmark task

Method group
Censored and truncated models
Software
Stata, R, and Python
Runs
360 runs, ten in each combination of model, software, prompt, and agency condition

Open every recorded run for this task.