# Clarification in the terms of log-likelihood expression

I am trying to implement Eq(7) given below from Parameter estimation for Linear dynamical system

where Q is a 2 by 2 covariance matrix of the process noise. The model is x which is a 2 by T dimensional and observation vector is 1 by T dimensional for a state space model:

The state space model :

x(t+1) = Ax(t) + u(t)

y(t) = Cx(t) + v(t)

w(t) = N(0,Q)

v(t) = N(0,R)


The answer should be a scalar negative value. On breaking up the equation, till the first three terms I am getting a scalar negative value. But as soon as I include the fourth term (T-1)/2 log (abs(Q)) the value of the log-likelihood becomes a matrix with positive values in the diagonal and off-diagonal elements being infinity. Is my understanding of the notation incorrect? Is | .| not absolute but the determinant of Q? Same for V_1 and R? Thank you for help.

UPDATE: Based on the answer, For the second expression: - 0.5*T*log(det(R)) the answer is coming : -0.5*T*log(0.0100) which becomes positive. How do I mitigate this problem?

It is the determinant. The likelihoods in the first two expression look like multivariate normals. Look up

http://en.wikipedia.org/wiki/Multivariate_normal_distribution

under properties, non-degenerate case they specify that $|\Sigma|$ is the determinant

• Please see the update in my Question. I implemented the determinant which although gives a scalar for the likelihood, but it is a positive value instead of negative. Due to this answer which is a large positive number, the entire value of likelihood is becoming positive. Please help.
– SKM
Mar 17, 2015 at 22:29
• A likelihood has to be positive, because it is proportional to a probability. If you mean the log likelihood, its sign could be either positive or negative.
– whuber
Mar 17, 2015 at 23:15
• Adding to what @whuber mentions noting that (1) the covariance matrix is positive semi-definite and (2) the determinant of a matrix is the product of its eigenvalues the determinant is necessarily positive.
– Sid
Mar 17, 2015 at 23:56
• @Sid:I ran the Kalman filter toolbox by Kevin Murphy. The log-likelihood is negative and it starts from a highly negative number slowly converging to a smaller negative number. From that point of view, the value of the log-likelihood expression must be negative because my implementation does not converge. I wrote my own implementation since it is very difficult to understand the mechanism otherwise. Will it be possible to go through my code? There is no run time error but I cannot figure out what is the problem. I will upload my code if you have time to go through it, please.
– SKM
Mar 18, 2015 at 0:55
• The LOG likelihood can absolutely be negative. The likelihood cannot be negative. The Kalman filter is providing a reasonable probabilistic result. What makes you believe the Kalman filter is not converging? By the sound of things it is converging
– Sid
Mar 18, 2015 at 5:02