A Glimpse on Kalman Filter

2025-12-24

How do agents recover the state variables in a world without complete information?

1. Introduction

We live in a world of uncertainty. We hold beliefs regarding objects around us, and we continuously revise those beliefs in response to noisy and ethereal signals we perceive.

The Kalman filter provides an optimal method for estimating the unobserved states of a dynamic system from imperfect information. It is widely used in sensing technologies, robotics, autonomous driving, and related fields. In macroeconomics, the Kalman filter becomes particularly relevant once the assumption of complete information is relaxed. Our interest lies in recovering latent economic states—such as productivity, match quality, or worker ability—when agents must infer them from noisy signals.

This matters because information frictions constitute a fundamental externality that shapes agents’ decisions. Imperfect information affects search behavior, job mobility, wage setting, and investment, and it interacts nontrivially with other economic mechanisms. Understanding how information enters the model, and how beliefs evolve over time, is therefore essential for studying behavior and equilibrium in environments characterized by incomplete information.

2. Discrete Kalman Filter

We start from a simple discrete linear dynamic system. Let the stochastic process of states be:

where is the states matrix, is the determined controlled variables, and are states transition matrix and controlled input matrix, respectively. is the process noise, following a Gaussian process . In reality, we can't directly observe . Instead, we measure it via equipment or other economic indices . The mapping from true states to measurement is:

where is state observation matrix and is measurement noise, arisen from equipment inaccuracy or statistics error, following another Gaussian and is independent in .

Now the question is: given a series of observations and parameters , , we already know, what are the efficient estimates of ? As an econ student, you don't need a second to answer OLS, and yes, they share the same spirit as what we'll do next. In the objective function, we're going to minimize the sum of squared distance between true states and our estimates . The difference is, the series need to align with the difference (I'm trying to make a pun). The process defined by (1) and (2) are restrictions we impose on the estimates . In fact, we are finding the estimators have least squared distance over all unbiased estimators which has this recursive and linear property.

To make it easier, we define an auxiliary term . Technically, is posteriori estimate of states, while is priori estimate. You'll find why: the priori is a naive predictor (conditional mean based on transition rule) of future state, but the posteriori is the best linear predictor of true state given the information set upon time . How to compute the objective distance while incorporating the stochastic process? Since the process is priori knowledge, we can use our priori estimate

to update the states. Equation (3) is whereby called states prediction function. Based on that, we use states update function to bridge the gap between priori and posteriori:

Note that the second term in the RHS of equation (4) is a multiplier times a residual, which is the difference between true measurement and predicted measurement. is called Kalman gain, and is exactly one of our goal of estimation. Any intuition for ? As in OLS, is chosen to minimize the posteriori error covariance. To make mathematical derivation smooth, we summarize some useful notations:

Now we have a well-defined optimality problem, the rest is simple algebra. Don't worry, let's do it together!

First, we rearrange equation (4):

Then we compute the covariance:

The third equation comes from the fact that priori estimate error is uncorrelated with measurement error . Then it's your favorite FOC:

Clearly,

Bring this back to (12) and we have

And don't forget to update . Recall that

Finally,

That's it. Given initial estimates and beliefs, we just need to calculate Kalman gain, update the estimate via measurements, further update states and covariance, and project them into next period.

3. Continuous Kalman Filter: A Simple Example

When it comes to continuous-time, we use Kalman-Bucy filter by analogy of discrete time case. Consider a linear continuous-time stochastic system:

where and are independent Brownian motions with covariance and for respect. Then, the estimates evolve via

Let's use a simple example to illustrate. Suppose workers and firms cannot observe workers' innate ability but a noisy signal . The process can be characterized as

where and is a standard Browninan motion. Let and be the first two moments of posterior of at time . Then we can show

Recall the Kalman gain . Here we have (You may ask that how can we equate to , that's because they are only difference in continuous-time case, and this difference diminishes as approaches to zero), , and . It implies that

As , we have . Thus,

Note that the true state is a constant. In a short time, we have

How about the posterior variance? The updating rule is according to (15). From the Bayesian perspective, it's also a result of an experienced rule: in a Gaussian prior plus Gaussian likelihood case, the variance of posterior is equal to the sum of learned precision (see my another blog):

The last equation relies on the approximation that when is very small. This is exactly the assumption that Baley et al. (2022) made on the evolution of beliefs in their model.

Further Reading

More detailed math derivation: Tutorial: Kalman Filter