# Maximum Likelihood using a Kalman filter for two factor model

I'm trying to implement a Kalman Filter for the parameter estimation of a linear gaussian two factor model in Matlab. (Schwartz Smith model for commodity prices) In other words: I try to compute the log-likelihood of the parameters.

My model:

$X_t = A X_{t-1} + \epsilon_X$ , with X beeing two-dimensional.

$Y_t = \begin{pmatrix} 1 \\ 1 \end{pmatrix}^T X_t + \epsilon_Y$ , with Y beeing one-dimensional.

$A$ is time invariant and only depends on the parameters $\theta$, which I would like to determine.

My question:

Whats the variance of $\epsilon_Y$ ? I know, that it normally represents the noise of the measurement process, but I don't know what would be the equivalent in an economic context?

I managed to implement the filter and the results for experimenting with the variance are (mean = 0):

• For high variance: High log-likelihood in unreasonable areas far away from the real values.
• For very (!) small variance: Reasonable results close to real values, but extremly small log-likelihoods around $-10^{12}$. I fear, that this will cause numerical issues in the upcoming maximum likelihood estimation. (I plan to use Metropolis Hastings)

Any help would be appreciated! Thanks!

• Have you considered using R rather than Matlab? In R, there is already an implementation of the Schwartz-Smith model, including parameter estimation: cran.r-project.org/web/packages/schwartz97 – pteetor Nov 29 '13 at 16:57

Usually $var(e_x), var(e_y)$ variances are calibrated by maximum likelihood from data similar as you want to calibrate your parameters $\theta$.
Ratio $var(e_x)/var(e_y)$ tells you what are changes in your time-series
• $var(e_x)/var(e_y)$ is small: changes in time-series of observations are just noise and underlying state doesn't change much;
• $var(e_x)/var(e_y)$ is large: changes are due to change of state and observations data represent states almost exactly, without noise.