We will use the following priors:

Since the precision must be positive, but has no theoretical upper bound, we use a Gamma prior:

$$h \sim \text{Gamma}(\alpha_h, \beta_h)$$

to be specific, the density is written:

$$p(h) = \frac{\beta_h^{\alpha_h}}{\Gamma(\alpha)} h^{\alpha_h-1}e^{-\beta_h h}$$

and we set the hyperparameters as $\alpha_h = 2, \beta_h = 2$. In this case, we have $E(h) = \alpha_h / \beta_h = 1$ and also $E(h^{-1}) = E(\sigma_\varepsilon^2) = 1$.

Ratio of variances¶

Similarly, the ratio of variances must be positive, but has no theoretical upper bound, so we again use an (independent) Gamma prior:

$$q \sim \text{Gamma}(\alpha_q, \beta_q)$$

and we set the same hyperparameters, so $\alpha_q = 2, \beta_q = 2$. Since $E(q) = 1$, our prior is of equal variances. We then have $E(\sigma_\eta^2) = E(q h^{-1}) = E(q) E(h^{-1}) = 1$.

Initial state prior¶

As noted above, the Kalman filter must be initialized with $\mu_0 \sim N(m_0, P_0)$. We will use the following approximately diffuse prior:

$$\mu_0 \sim N(0, 10^6)$$