validate_study
Check a completed study against real data, as the web app's Validate panel does: pass the split a real survey or poll found on the same question, and get back how far the simulated split was from it. Free. Works on a study with a sentiment split (run_focus_group); a debate or a ranking has none and is refused. The check is saved with the study.
real_distribution takes percentages that sum to 100, or raw respondent counts, for positive, neutral and negative (agree, undecided and disagree when the study had a stance_statement).
Returns: { sim_id, grade (A-F), parity_pct (0-100), mae (mean absolute error, percentage points), rmse, pearson_r, simulated: { positive, neutral, negative }, real: {...}, buckets: [ { bucket, simulated_pct, real_pct, delta_pp } ], real_source, real_sample_size }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sim_id | Yes | The id of a completed study you ran. | |
| real_source | No | Where the real figures come from, e.g. 'Pew, March 2026'. | |
| real_sample_size | No | How many people the real survey asked. | |
| real_distribution | Yes | The real split: percentages summing to 100, or raw counts. Keys: positive, neutral, negative. |