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.
Simple explains the core inference. Advanced preserves every Version 3 control and diagnostic.
Set the observation used by the unchanged scalar Gaussian inference model.
No observation generated yet.
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.
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.
Starting expectation 40.00 UObservation 70.00 UUpdated estimate 64.00 U
Panel 2 · Numerical state
Prediction errors and estimate movement
Sensory error stays y − mk; generator truth is never its target.
Positive sensory error means the observation is larger than the current predicted observation.
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.
Prior influence 20.0%; observation influence 80.0%. Lower uncertainty corresponds to higher precision and therefore greater relative weight.
| Quantity | Definition | Value |
|---|---|---|
| Prior precision | τp = 1/σp² | 0.010000 U⁻² |
| Observation precision | τs = 1/σs² | 0.040000 U⁻² |
| Prior weight | wp | 20.0% |
| Observation weight | ws | 80.0% |
| Weighted prior error | τpεp,k | 0 U⁻¹ |
| Weighted sensory error | τsεs,k | +1.2 U⁻¹ |
Separate quantities: precision is reciprocal variance; weight is normalized contribution; α controls numerical movement only.
Panel 4 · Normalized objective descent
Numerical convergence
Iteration k is a numerical index, distinct from independent trial index i and display cadence. The analytical posterior remains the exact target.
Estimate by iteration at k = 0. Current estimate 40.000 U; next estimate 46.000 U; analytical target 64.000 U; not yet converged.
Initialized at prior mean.k = 0 · rₖ = 0.8000
| Quantity | Symbol | Value and unit |
|---|---|---|
| Selected view | — | Estimate by iteration |
| Current numerical estimate | μk | 40.000 U |
| Analytical target | μpost | 64.000 U |
| Next estimate | μk+1 | 46.000 U |
| Sensory error | y−μk | +30.000 U |
| Prior error | μp−μk | 0.000 U |
| Weighted sensory contribution | πs(y−μk) | +1.20000 U⁻¹ |
| Weighted prior contribution | πp(μp−μk) | 0 U⁻¹ |
| Negative gradient | −F′(μk) | +1.20000 U⁻¹ |
| Objective derivative | F′(μk) | −1.20000 U⁻¹ |
| Total precision / curvature | λ | 0.050000 U⁻² |
| Iteration step | α | 0.25 |
| Derived raw step | η=α/λ | 5.00000 U² |
| Numerical increment | Δμk | +6.000 U |
| Current objective | F(μk) | 18.0000 |
| Minimum objective | F* | 3.60000 |
| Objective gap | F(μk)−F* | 14.4000 |
| Convergence residual | rk | 0.8000 |
| Convergence state | — | Not yet converged |
Independent repetitions
Independent repeated trials
Every trial starts from the same prior and uses one newly generated observation. Trials are not sequential updates.
Observation sampling distribution
| Summary | Mean | SD |
|---|---|---|
| Theoretical | ||
| Empirical |
Conditional posterior uncertainty: . Across-trial posterior-mean variability: . These are different quantities.
Complete technical readout
- Prior variance
- 100.00 U²
- Observation variance
- 25.00 U²
- Posterior precision / curvature
- 0.050000 U⁻²
- Posterior variance
- 20.000 U²
- Analytical posterior mean
- 64.000 U
- Negative gradient
- +1.20000 U⁻¹
- Derived raw step
- 5.00000 U²
- Seed
- not initialized
- Next normal draw index
- not initialized
- State space
- all finite real values; bounds are display-only
Model scope, limitations, and sourcesEquations, distinctions, limitations, and sources
Mathematics and interpretation
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(μ−μp)²F′(μ) = πs(μ−y) + πp(μ−μp)F″(μ) = λ = πp + πs > 0μpost = (πpμp + πsy) / (πp+πs)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 + α/(πp+πs)[πs(y−μk) + πp(μp−μk)]μk+1 = μk + α(μpost−μk)The two forms are algebraically equivalent and are cross-checked numerically. The derived raw step η = α/(πp+πs) 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−α)k(μ0−μpost)0 < α < 2 ⇔ 0 < η < 2/λF(μk)−F* = ½λ(μk−μpost)²F(μ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 indices
zi ~ 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.
Scope controls
Limitations
- One scalar latent variable and one scalar observation.
- The model is static, not a temporal world model.
- The prior and observation error are Gaussian.
- The observation mapping is fixed and identical.
- Precisions remain fixed during a trajectory.
- Each trajectory begins at the prior mean by convention.
- Numerical iteration is not physical or neural time.
- The analytical posterior is known, so iteration is demonstrative rather than necessary.
- The raw gradient step is normalized by total precision.
- The stable oscillatory region 1 < α < 2 is excluded from the interface.
- Independent trials do not learn from or update one another.
- The model excludes hierarchy, action, active inference, and parameter learning.
- It does not establish a neural implementation or biological realism.
- It does not represent psychological, psychedelic, or clinical states.
- It is educational, not diagnostic, therapeutic, or validated scientific software.
- It uses finite-precision deterministic computation and pseudorandom sampling.
Primary and authoritative sources
- Murphy, Conjugate Bayesian analysis of the Gaussian distribution — Gaussian conjugacy and precision weighting.
- Boyd & Vandenberghe, Convex Optimization — quadratic objectives and gradient descent.
- Rao & Ballard (1999) — historical predictive-coding context, not biological validation of this tool.
- Bogacz (2017) — mathematical context for error-based optimization.
- Friston (2005) — broader theoretical context, not demonstrated implementation.
- NIST TN 1900 — observation and measurement-uncertainty models.
- Box & Muller (1958) and O’Neill (2014) with the official PCG reference — preserved reproducible generator.
- NIST SP 800-22 Rev. 1a — limits of statistical generator tests.
- NIST TN 1297 — unbounded Gaussian support.
- Ernst & Banks (2002) — task-specific reciprocal-variance integration evidence.
- WCAG 2.2 — accessibility conformance target.