A prediction step forecasts the next hidden state before its new measurement arrives. It carries the current filtered belief through a state transition model, answering: “What do we expect next?” section 9.3
A prediction step follows this pattern:
- Start with the current state estimate and its uncertainty. section 9.3
- Apply the state transition model to forecast the next latent state. section 9.15
- Add transition noise to represent increasing uncertainty during propagation. section 9.8
- Predict the next observation, then let the update step correct the forecast when new data arrive. section 9.3
A noisy random walk
Suppose a hidden quantity changes by adding known random noise. Its predicted mean stays equal to the current mean, while its predicted variance becomes the current variance plus the transition-noise variance. The next observation adds observational noise to that variance. In a Gaussian model, these calculations remain closed form. section 9.8
for i in range(1, n):
next_x_mean = x_mean[i - 1]
next_x_var = x_var[i - 1] + S
This NumPy loop implements the random-walk prediction by carrying forward the previous mean and adding transition noise to its variance. section 9.8
y_mean[i] = next_x_mean
y_var[i] = next_x_var + R
These lines turn the predicted hidden-state distribution into a predictive distribution for the next observation by adding observation noise. section 9.8
