From what I've known about Kalman filter, it requires all the parameters of the underlying state space model. Say the state space model is: $$\xi_{t+1} = F\xi_t + v_{t+1}$$ $$y_t = H\xi_t + w_{t}$$ where $v$ and $w$ are disturbances. Kalman filter needs the $F$, $H$, $Q$ (the covariance matrix of $v$) and $R$ (the covariance matrix of $w$) as well as $\xi_1$ as the initial state and the corresponding $P_1$ (the mean squared error of $\xi_1$) to start the recursion. However, these parameters generally have to be estimated by numerical methods. Assume $y_t$ is Gaussian, how can the $H$ be estimated if we don't have any external knowledge about $\xi_t$? Alternatively, if we have some external knowledge of $H$, the estimation of all the parameters can be proceeded as well. What is the general rule to determine the initial parameter values or the state vector if we don't have any external knowledge?

  • $\begingroup$ H is known/set/measured exactly/pre-specified, not estimated; it's part of your model. It's akin to the predictors in a regression model in that sense (and in some state space models, that's what it is). $\endgroup$ – Glen_b -Reinstate Monica May 21 '19 at 23:11
  • $\begingroup$ @Glen_b Hello Glen_b, thank you for your reply. Do you mean that prior knowledge of H is a must for state space model formulation? $\endgroup$ – Seymour May 22 '19 at 5:18
  • $\begingroup$ In the usual state space model, the only things that are to be estimated are the state and its variance-covariance matrix (and, arguably, the error terms); perhaps missing y's if you have some of those. $\endgroup$ – Glen_b -Reinstate Monica May 22 '19 at 6:50
  • $\begingroup$ @Glen_b Thank you very much for the answer! I started to learn the Kalman filter without any prior experience about the state space model. Maybe I have to go it through first. $\endgroup$ – Seymour May 22 '19 at 7:03

Everything you will ever need regarding estimation of parameters in a state space model is in this document:


Kalman Filter/Smoother assumes that the parameters are known in advance so that the unobserved state can be estimated. The initial values for the state can be user supplied or a diffuse initialization approach can be used.

For this the standard reference is:


For the matrix parameters and noise co-variance estimation the standard procedure is Expectation Maximization which is described in detail in the first reference, and also in


chapter 6.

  • $\begingroup$ Hi Cowboy Trader. Thank you for your info. I want to clarify my question a bit. I have read through the Kalman filter chapter of Hamilton (1994)'s textbook. He mentioned the estimation procedure with numerical methods (say Newton). One could firstly assign arbitrary parameter values and iterate the Kalman filter. With the obtained state vector, one then could in turn estimate the parameter values and check the corresponding likelihood. This process ends at the trivially changing parameter values. $\endgroup$ – Seymour May 22 '19 at 15:35
  • $\begingroup$ My questions are: Do you agree with the point that Hamilton's procedure is unrealistic or won't converge in a general sense? If you do, can you explain concisely how to determine the initial values in a general sense (without any external knowledge) if there're any. (Since it is general, I believe it doesn't require too much words to explain it.) Additionally, could you clarify the 'diffuse initialization approach'? $\endgroup$ – Seymour May 22 '19 at 15:35
  • $\begingroup$ Finally, I know EM is a fixed point finding algorithm although I don't fully understand the mathematics behind it. What is the advantage of EM compared with other numerical methods? Just without gradient if say Newton? I am curious because why didn't the classical time series textbooks, for example Hamilton's, Ender's and Lütkepohl's, introduce this particularly useful method? Besides, EM requires initial inputs as well which returns to the essential problem. $H$ and $\xi$, we have to have one of them to start the Kalman filter and estimation. Thank you very much! $\endgroup$ – Seymour May 22 '19 at 15:36
  • $\begingroup$ @Seymour Direct maximization of likelihood works, but on small scales. If your matrices are say 2x2, 3x3. It requires calculation of gradients. EM algorithm for Gaussian models have exact analytical solutions. Therefore iteration is more robust. All parameters can be estimated including starting value of $\xi$. Diffuse initialization is using a very large variance on prior distribution of $\xi$. $\endgroup$ – Cagdas Ozgenc May 22 '19 at 15:55
  • $\begingroup$ So the conclusion is, either I'm using EM or Newton, the initial parameter values have to be arbitrarily assigned or set with some belief right? $\endgroup$ – Seymour May 22 '19 at 16:12

In the usual state space model, the only things that estimated is the state and its variance-covariance matrix (at each time point) - whether filtering or smoothing only changes what information you're conditioning on, but either way you end up with estimates of those things.

The $H$'s (and $F$, $Q$ and $R$ in your notation) are known/set/measured exactly/pre-specified, not estimated; it's part of your model for how observations are related to the state vector (and how state vectors evolve over time, etc).

$H$ is akin to the predictors in a regression model in that sense (i.e. that you don't estimate the $X$ matrix in regression)

  • $\begingroup$ "The 𝐻's (and 𝐹, 𝑄 and 𝑅 in your notation) are known/set/measured exactly/pre-specified, not estimated" <- this isn't always true. $\endgroup$ – Taylor May 30 '19 at 19:50
  • $\begingroup$ It may be that we're interpreting "Kalman Filter" differently, but as I see it, if they're unspecified, you're not dealing with the Kalman Filter algorithm, because in that they are definitely being treated as known quantities. If they were estimated, there are terms (relating to that estimation error) missing from the variance updates. The unknowns are in the state. I have no doubt that you could write a valuable answer that expands on what exceptions specifically you mean (and - terminology aside - I expect that when we both talk about the same thing we won't substantively disagree). $\endgroup$ – Glen_b -Reinstate Monica May 31 '19 at 0:32

As mentioned in other answers, you need values for the parameters in all system matrices ($F$, $H$, $Q$) in order to run the Kalman filter. However, you may have a state-space model with unknown parameters that you need to estimate.

In order to do that, you may use the Kalman filter: running the Kalman filter with arbitrary values of the parameters will produce, as a byproduct, the likelihood. You can then embed the Kalman filter in an optimizing routine which tries different values so that the likelihood is maximized. Answering to other queries I have given detailed examples using package dlm in R. (Alternatives are packages MARSS and KFAS, among others.)

  • 1
    $\begingroup$ @Cowboy Trader: I think it very much depends on the problem at hand (and the OM gives no details). I have used gradient-type algorithms many times with good results. EM is generally considered to be slower (and can get stuck in a local optimum, just as a surface climbing algorithm). $\endgroup$ – F. Tusell May 22 '19 at 14:41
  • $\begingroup$ @Cowboy Trader: If that means 4900 parameters unrestricted, I doubt anything will work well, unless you have oodles of data. The Kalman filter itself can cope well with missing data, whichever method you use to maximize the likelihood. $\endgroup$ – F. Tusell May 22 '19 at 14:47
  • $\begingroup$ Yes that's generally what I have learnt in Hamilton's book. However, is it really the case we can just assign arbitrary initial values given the non-robustness of multi-dimensional numerical search methods? I am looking for a general rule to determine the initial parameter values if there're any. $\endgroup$ – Seymour May 22 '19 at 15:48
  • $\begingroup$ @Seymour: I do not think you can go any further than making and educated guess. And of course the model may involve restrictions that you can exploit (like non-negativity constraints for variances, etc.). The initial values problem will exist with either gradient-climbing or EM algorithms. $\endgroup$ – F. Tusell May 22 '19 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.