Educational mathematical tool

Predictive Processing Simulation Tool

Explore how a prior expectation and new evidence combine in an exact one-dimensional Gaussian model.

Full scientific scope

Educational scalar Gaussian model—not a brain, biological, or clinical simulation.

A scalar, static, identity-observation, linear-Gaussian teaching model with arbitrary units. The analytical posterior is exact; iteration is an optional numerical demonstration, not physical or neural time. Generator truth is simulation-only, trials are independent, and this is not a brain or clinical simulation.

Interface mode

Simple explains the core inference. Advanced preserves every Version 3 control and diagnostic.

Observation route

Set the observation used by the unchanged scalar Gaussian inference model.

Starting expectation40.00 Uprior mean μp
Observation70.00 Unew evidence y
Updated estimate64.00 Uanalytical posterior mean
Updated uncertainty4.47 Uconditional posterior SD

See the resultPanel 1 · Analytical distributions

How the estimate changesPrior, likelihood, and posterior

The same prior, likelihood, and exact posterior shown on one shared scale.True density heights over an expanded real-valued axis. A simulation truth marker is evaluation-only.

Exact
Prior densityLikelihoodPosterior density
Prior SD10.000 U
Observation SD5.000 U
Posterior SD4.472 U

Axis: 0.00 to 110.00 U.

See the result

From expectation to updated estimate

An exact movement from the prior mean to the analytical posterior mean. No optimizer step is shown.

Analytical

Starting expectation 40.00 UObservation 70.00 UUpdated estimate 64.00 U

Understand the weightingPanel 3 · Precision and flow

What influenced the resultRelative precision and update flow

The prior and observation weights sum to 100%. Lower uncertainty produces greater relative influence.Absolute precision uses U⁻². Relative weights are normalized proportions.

Derived

Prior influence 20.0%; observation influence 80.0%. Lower uncertainty corresponds to higher precision and therefore greater relative weight.

Simple interface initialized with the direct observation route.
Model scope, limitations, and sourcesEquations, distinctions, limitations, and sources

One exact target, one numerical update path

Quadratic objective and analytical target

For precision, π is an exact alias of the inherited τ: πp ≡ τp = 1/σp² and πs ≡ τs = 1/σs².

F(μ) = ½πs(y−μ)² + ½πp(μ−μpF′(μ) = πs(μ−y) + πp(μ−μp)F″(μ) = λ = πp + πs > 0μpost = (πpμp + πsy) / (πps)

F is a quadratic negative-log-posterior objective up to an additive constant. Its unique minimizer is the unchanged analytical posterior mean. The numerical estimate approximates that known target; it does not replace the analytical solution.

Normalized precision-weighted gradient descentμk+1 = μk + α/(πps)[πs(y−μk) + πpp−μk)]μk+1 = μk + α(μpost−μk)

The two forms are algebraically equivalent and are cross-checked numerically. The derived raw step η = α/(πps) is displayed but never independently controlled. The public iteration step is restricted to 0.05 ≤ α ≤ 1.

Closed form, stability, and objective contractionμk = μpost + (1−α)k0−μpost)0 < α < 2   ⇔   0 < η < 2/λF(μk)−F* = ½λ(μk−μpostF(μk+1)−F* = (1−α)²[F(μk)−F*]

The full mathematical interval includes sign-alternating overshoot for 1 < α < 2. The interface intentionally excludes that region. Numerical convergence means the inherited dimensionless residual is below 10−6, subject to the 10,000-step safety limit.

Generation, independent trials, and indiceszi ~ N(0,1)   εi = σszi   yi = x* + εiμpost,i|x* ~ N(wpμp + wsx*, ws²σs²)

Trial/draw index i labels independent observations. Numerical iteration k labels optimizer steps for one active observation. Animation cadence is wall-clock display timing only. Batches remain independent analytical one-observation posteriors with no trajectory or shared update state.

Reproducibility boundary

Version 3 preserves the Version 2 PCG32 XSH-RR and Box–Muller sequence exactly. The finite sequence is pseudorandom and deterministic, not exact continuous randomness or a cryptographic facility.

Limitations

  1. One scalar latent variable and one scalar observation.
  2. The model is static, not a temporal world model.
  3. The prior and observation error are Gaussian.
  4. The observation mapping is fixed and identical.
  5. Precisions remain fixed during a trajectory.
  6. Each trajectory begins at the prior mean by convention.
  7. Numerical iteration is not physical or neural time.
  8. The analytical posterior is known, so iteration is demonstrative rather than necessary.
  9. The raw gradient step is normalized by total precision.
  10. The stable oscillatory region 1 < α < 2 is excluded from the interface.
  11. Independent trials do not learn from or update one another.
  12. The model excludes hierarchy, action, active inference, and parameter learning.
  13. It does not establish a neural implementation or biological realism.
  14. It does not represent psychological, psychedelic, or clinical states.
  15. It is educational, not diagnostic, therapeutic, or validated scientific software.
  16. It uses finite-precision deterministic computation and pseudorandom sampling.
Primary and authoritative sources
  1. Murphy, Conjugate Bayesian analysis of the Gaussian distribution — Gaussian conjugacy and precision weighting.
  2. Boyd & Vandenberghe, Convex Optimization — quadratic objectives and gradient descent.
  3. Rao & Ballard (1999) — historical predictive-coding context, not biological validation of this tool.
  4. Bogacz (2017) — mathematical context for error-based optimization.
  5. Friston (2005) — broader theoretical context, not demonstrated implementation.
  6. NIST TN 1900 — observation and measurement-uncertainty models.
  7. Box & Muller (1958) and O’Neill (2014) with the official PCG reference — preserved reproducible generator.
  8. NIST SP 800-22 Rev. 1a — limits of statistical generator tests.
  9. NIST TN 1297 — unbounded Gaussian support.
  10. Ernst & Banks (2002) — task-specific reciprocal-variance integration evidence.
  11. WCAG 2.2 — accessibility conformance target.