Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

A first forecast

Suppose 12 of 40 comparable releases met their deadline. Before considering the current release, the empirical outside view is 0.30. An independently observed readiness signal is assessed as having probability 0.80 for an on-time release and 0.20 for a late one.

Bayes’ rule gives a posterior of approximately 0.632:

extern crate supercast;
use supercast::{Probability, bayes};

let prior = Probability::new(0.30)?;
let posterior = bayes::update(
    prior,
    Probability::new(0.80)?,
    Probability::new(0.20)?,
)?;
assert!((posterior.get() - 12.0 / 19.0).abs() < 1e-12);
Ok::<(), supercast::Error>(())

The computation is conditional on the likelihood estimates and the relevance of the reference class. It does not turn those inputs into measured facts. A useful report might say:

My estimate is about 63%, starting from a 30% reference-class rate. The update assumes the readiness signal is four times as likely for an on-time release. A likelihood-ratio range of two to six gives an assumption envelope of roughly 46% to 72%.

The envelope is not a confidence interval. Its endpoints reflect alternative assumptions chosen by the forecaster.

Run the supplied workflow

From a source checkout:

CARGO_TARGET_DIR=target cargo build -p supercast-agent --locked
python3 examples/agent_demo.py

The demo creates a temporary SQLite database, registers a synthetic question, records a prior, applies a likelihood update, supplies an outcome, and scores the forecast. It restarts the process and retries the update to verify that the original receipt returns without creating another revision.

From a release bundle, use its included executable:

python3 examples/agent_demo.py --binary ./supercast-agent

To retain records, serve the JSON protocol with an explicit database path:

./supercast-agent --db forecasts.sqlite3

Write one JSON request per line. The process writes one response per nonblank input line. The command below is a calculation only; it does not append a forecast to the database.

{"version":1,"id":"first-calculation","command":{"op":"bayes","prior":0.3,"given_h":0.8,"given_not_h":0.2}}

Continue with question design before using a number like this in an actual forecasting record.