GitHub

@@ -46,6 +46,12 @@ It is aimed at readers who either

4646

* have heard of the Kalman filter but don't know how it works, or

4747

* know the Kalman filter equations, but don't know where they come from

484849+

Subsequent lectures use the same recursive logic in more applied and more econometric settings.

50+51+

See {doc}`kalman_2` for an economic application in which a firm infers a worker's hidden human capital and effort.

52+53+

See {doc}`kalman_filter_var` for a derivation of the innovations representation and its connection to vector autoregressions.

54+4955

For additional (more advanced) reading on the Kalman filter, see

50565157

* {cite}`Ljungqvist2012`, section 2.7

@@ -258,7 +264,9 @@ and

258264

```

259265260266

```{note}

261-

A proof can be found in {cite}`Bishop2006`. To get from his expressions to the ones used above, you will also need to apply the [Woodbury matrix identity](https://en.wikipedia.org/wiki/Woodbury_matrix_identity).

267+

A proof can be found in {cite}`Bishop2006`.

268+269+

To get from his expressions to the ones used above, you will also need to apply the [Woodbury matrix identity](https://en.wikipedia.org/wiki/Woodbury_matrix_identity).

262270

```

263271264272

Here $\Sigma G^\top (G \Sigma G^\top + R)^{-1}$ is the matrix of population

@@ -457,7 +465,9 @@ Repeating {eq}`kl_mlom0`, the dynamics for $\mu_t$ and $\Sigma_t$ are as follows

457465

These are the standard dynamic equations for the Kalman filter (see, for example, {cite}`Ljungqvist2012`, page 58).

458466459467

```{note}

460-

Here $\mu_t$ is the filter's prediction of the hidden state $X_t$. In much of the Kalman filter literature it is written $\hat x_t$, emphasizing that it is an estimate of $X_t$.

468+

Here $\mu_t$ is the filter's prediction of the hidden state $X_t$.

469+470+

In much of the Kalman filter literature it is written $\hat x_t$, emphasizing that it is an estimate of $X_t$.

461471

```

462472463473

(kalman_convergence)=

@@ -501,7 +511,9 @@ Equation {eq}`kalman_dare` is known as a [discrete-time algebraic Riccati equati

501511502512

Conditions under which a fixed point exists and the sequence $\{\Sigma_t\}$ converges to it are discussed in {cite}`AHMS1996` and {cite}`AndersonMoore2005`, chapter 4.

503513504-

A sufficient (but not necessary) condition is that all the eigenvalues $\lambda_i$ of $A$ satisfy $|\lambda_i| < 1$ (cf. e.g., {cite}`AndersonMoore2005`, p. 77).

514+

A sufficient (but not necessary) condition is that all the eigenvalues $\lambda_i$ of $A$ satisfy $|\lambda_i| < 1$.

515+516+

See, for example, {cite}`AndersonMoore2005`, p. 77.

505517506518

(This strong condition assures that the unconditional distribution of $X_t$ converges as $t \to \infty$.)

507519

@@ -583,6 +595,8 @@ Your figure should -- modulo randomness -- look something like this

583595

:class: dropdown

584596

```

585597598+

Here is one solution:

599+586600

```{code-cell} ipython3

587601

# Parameters

588602

θ = 10 # Constant value of state X_t

@@ -643,6 +657,8 @@ Plot $z_t$ against $t$, setting $\epsilon = 0.1$ and $T = 600$.

643657

:class: dropdown

644658

```

645659660+

Here is one solution:

661+646662

```{code-cell} ipython3

647663

ϵ = 0.1

648664

θ = 10 # Constant value of state X_t

@@ -743,6 +759,8 @@ Finally, set the realized initial state to $x_0 = (0, 0)$.

743759

:class: dropdown

744760

```

745761762+

Here is one solution:

763+746764

```{code-cell} ipython3

747765

# Define A, C, G, H

748766

G = np.identity(2)

Read the original on github.com ↗