API · 11 operations

Calibration.

How a world is held to account by the real one: answers corrected by a few real ones, intervals that keep their coverage, regions, kin, subgroups, and a world corrected as observations arrive. Stateless; nothing is stored.

POST/calibrate/rectifymember

Correct a model's answers with a small real sample (prediction-powered inference, PPI++): an estimate and interval that stay valid however wrong the model is, beside the real-sample-only answer, and the effective sample size the model adds. Per cell and poststratified with cells and shares. Nothing is stored.

Body

labelled[{y, f}]: real answers y beside the model's f for the same units
unlabelled[f]: the model's answers where no real one exists
sharetrue for a 0/1 outcome (interval kept in [0, 1])
alphadefault 0.05
lambdaweight on the model in [0, 1]; tuned by default
cellsinstead: [{cell, labelled, unlabelled}]
shareswith cells: {cell: population share}
POST/calibrate/allocatemember

Where to spend the next real answers: labels per cell, more where the model is hardest to correct, every cell at least 2, summing to the budget.

Body

cells[{cell, sdResidual, sdClassical?, share?, cost?}]
budgettotal labels
POST/calibrate/intervalsmember

Intervals that keep their coverage (conformal): split; by subgroup, so no cell is covered only on average; or weighted to recent years, so a change of regime widens them instead of hiding.

Body

methodsplit | group | weighted
alphamiscoverage, default 0.1
scoressplit and weighted: past |error| values
predictionssplit and weighted: points to put intervals round
calibrationgroup: [{groups, score}]
pointsgroup: [{groups, prediction}]
timesweighted: when each score was made
nowweighted
halfLifeweighted: years for a score's weight to halve
POST/calibrate/regionsmember

Regions forecast as the nation plus an offset that fades (AR(1)), so a region inherits a national stall instead of its own old slope; gains that taper as life expectancy rises, fitted over many populations; and a score against the truth.

Body

national[{year, e0}]
regions{region: [{year, e0}]}
nationalForecast[{year, e0}]
horizonyears ahead
nationalSdsd of the national forecast
pooled{population: [{year, e0}]} to fit tapered gains
starte0 to project from with the fitted gains
yearsdefault 10
predicted{region: value}
truth{region: value}
POST/calibrate/kinmember

Expected siblings (older, younger, alive) from fertility and survival alone, with their variance, per cell; beside a simulation's counts and a survey's, it says whether the rates or the simulation's linking of births to parents is at fault.

Body

schedules{fertility, survival} by single year of age, or {year: {fertility, survival}}
cells[{cell, birthYear, egoAge}]
birthYearwithout cells
egoAgewithout cells; omit for lifetime
alivetrue to count siblings still alive at egoAge
simulated{cell: count}
survey{cell: count}
tolerancedefault 0.1
POST/calibrate/cellsmember

Subgroups held to the truth: multicalibration over overlapping groups (patches learned and applied to new units), small cells smoothed across ordered age bands, or each cell checked against its own sampling-noise floor.

Body

methodmulticalibrate | smooth | floor
unitsmulticalibrate: [{p, y, groups}]
applymulticalibrate: [{p, groups}] to correct
alphamulticalibrate: tolerance, default 0.02
cellssmooth: [{party, ageIndex, n, mean}]; floor: [{cell, predicted, observed, n}]
priorSdRWsmooth: step between age bands, default 0.05
sharessmooth: {party|age: share}
qfloor: default 0.95
POST/calibrate/assimilatemember

A running world corrected by what it observes (ensemble Kalman filter, or a particle filter for non-Gaussian state), or parameter space ruled out before expensive runs (history matching on Gaussian-process emulators). Seeded: the same body gives the same answer.

Body

methodenkf | particle | history
particlesparticle: particles × state, moved to the observation time
weightsparticle: before this observation
logLikelihoodparticle: one per particle
essThresholdparticle: resample below this share, default 0.5
ensembleenkf: members × parameters
predictedenkf: members × observations
observedenkf
obsSdenkf: one or per observation
inflationenkf: default 1
Xhistory: design points
outputshistory: simulator outputs per design point
targetshistory: [{value, obsSd, modelDiscrepancySd}]
candidateshistory: points to test, or bounds and nCandidates
cutoffhistory: default 3
seeddefault 1
POST/calibrate/trajectoriesmember

One member's path against observed panel paths: how often a category changes by age band and how much more after life events (the switch dynamics to declare, with bootstrap intervals), and each observed start replayed through the population's rules (dimensions given, and the standard life state and events) and scored: change simulated against observed with the gap's 95% interval, the end's Brier score beside nothing changing, and a verdict that calls a trait calibrated only on held-out rows. Nothing is stored.

Body

rows[{id, years, start, end, events?: [{key, at?}], weight?, group?}]
fit{key, ages?, events?, days?} or a list of them
replay{dims?, standard?, keys, draws?, budget?, held_out?}
seeddefault 1
POST/calibrate/recalibratemember

Parameters held with their uncertainty, updated by observations: the one recalibration every model and product calls. Bayesian (the current values and sds are the prior; the posterior mode with Laplace uncertainty comes back), with the latest observations held out and scored before and after, and the band of the data the fit covers. method ensemble updates a black-box simulator's parameter draws from its runs (ensemble Kalman). Nothing is stored.

Body

familygaussian | binomial
params[{name, value, sd (0 holds it fixed), transform?: none | log | logit}]
observations[{y, n? (binomial trials), mean: {param: coefficient}, scale?: {param: coefficient} (gaussian log sigma), offset?, scale_offset?, at?, weight?}]
random_sdbinomial: the param that is a random intercept's sd, integrated out
forget(0, 1]: widen the prior first, for drift
holdoutshare of the latest observations kept out, default 0.2
scoresthe scores that prompted this, kept with the result
methodensemble: then params, theta (members x params), predicted (members x observations), observed, obs_sd, seed?, inflation?
POST/calibrate/scoremember

Forecasts with uncertainty scored properly: CRPS, log score, PIT and coverage of the 50, 80 and 95 percent intervals, and with a reference, paired CRPS skill with a bootstrap interval. Computed as scoringrules computes them. Nothing is stored.

Body

forecasts[{predictive: {kind: gaussian, mu, sigma} | {kind: ensemble, members} | {kind: quantiles, levels, values}, y}]
referenceone predictive per forecast, for skill
levelscoverage levels
seeddefault 1
GET/calibrate/trajectoriesmember

The registered replay on the GSS panels 2006-2010: for each categorical attitude, change on the held-out waves against what the fitted switching gives, and whether it held; the switching prior that gives; and how often the household rules end a household where it really ended after its life events.

A glass tree whose crown holds many small worlds like fruit

Which world will you live in?

What grows here is meant to reach the real world. Start with a world of your own.