liveBook · Manning

Update rule

As explained in Grokking Bayes

An update rule specifies how an algorithm revises its current state, estimate, or representation using new information or an iteration step.

An update rule adjusts a predicted belief about a hidden state after a new observation arrives. It answers: given what we just measured, how should we revise our estimate? In a state-space model, prediction comes first; the update then uses the observation model and Bayes’ theorem to correct that prediction. section 9.3 section 9.8

A Gaussian update follows this cycle:

  • Predict the next latent-state mean from the previous state. section 9.8
  • Increase the predicted state variance by the state-transition noise variance S. section 9.8
  • Predict the next observation variance by adding observational noise R. section 9.8
  • Compute the Kalman gain, K = next_x_var / (next_x_var + R), to balance model uncertainty against measurement noise. section 9.8 section 9.15
  • Move the state mean toward the observed value by K times the residual, then reduce variance to (1 − K) times the predicted variance. section 9.8

Updating a noisy time-series estimate

For a changing CO₂ concentration, the filter first predicts the next latent concentration and then compares that prediction with the newly measured value. A larger Kalman gain pulls the estimate more strongly toward the measurement; greater measurement noise reduces that pull. In NumPy, the update is represented by: K = next_x_var / (next_x_var + R); x_mean[i] = next_x_mean + K * (y[i] - next_x_mean); x_var[i] = (1 - K) * next_x_var. section 9.3

Figure 9.4 The diagram of a filter algorithm, which alternates between the prediction step and the update step to recursively generate predictions for a time series.

The diagram makes the update rule’s position in the recurring predict-then-correct filter cycle easy to see. section 9.3

How Grokking Bayes covers it

How deep it goes
Derives Gaussian mean, variance, and Kalman-gain updates, while staying within linear Gaussian filtering.
Examples
Uses noisy CO₂ measurements, Gaussian state beliefs, NumPy arrays, and a Kalman-gain update loop.
What it assumes
Assumes state-space prediction and Gaussian distributions while introducing recursive filtering through a predict-and-correct cycle.
What you can do after
Apply via NumPy by implementing a recursive Gaussian update for a time series.
How it connects
Connects Bayesian inference, observation models, prediction steps, state-space models, and Kalman filters.

Also explained in

Compare how 2 books explain update rule →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Bayes. The section links point to the parts of the book it draws on.