Conceptual question on log-likelihood value I am trying to implement the log-likelihood expression Eq(7) from the paper, Parameter Estimation for Linear Dynamical Systems (1996).
Re-writing,
For the model,
$h(t) = \mathbf{A^T} h(t-1) + \eta^h(t)$
$v(t) = \mathbf{B^T}h(t) + \eta^v(t)$
$\eta^h(t) = N(0,Q), \eta^v(t) =N(0,R)$
The log likelihood is $Q= - \sum_{t=1}^{} \big(\frac{1}{2}[v(t) - Bh(t))'R^{-1}[v(t)-Bh(t)] \big) - \frac{T}{2} \log |R| - \sum_{t=2}^T \big( \frac{1}{2} [h(t)' - Ah(t-1)]'Q^{-1}[h(t) - Ah(t-1)]\big) - \frac{T-2}{2} \log |Q| -\frac{1}{2} {[h_1 - \pi_1]}' V_1^{-1}[h_1 - \pi_1] - \frac{1}{2} \log |V_1| - \frac{T(p+2) \log 2 \pi}{2}$
where $\pi_1, V$ is the mean and variance of the initial condition of $h$.
Q1: In the paper, I could not see what $p$ and $k$ is. Can somebody show how this likelihood expression is coming from the joint pdf?
Q2: According to theory, the log-likelihood function is maximized at the true parameter values. I implemented this expression using MATLAB and getting a 2by2 matrix
-13.4165 Inf; 

Inf -13.4165.

Will the log-likelihood be negative and the off-diagonals all infinity? What Is the implication of this?
Shall appreciate an intuitive answer for a beginner level. Thank you.
 A: Question 1. 
The authors do not say what $p$ or $k$ are before introducing them, which is a little cheeky.  You have apparently at some point decided that $k=2$ because that is the difference between your equation and theirs.  That is doubtless correct.  This suggests 
a) these are the dimensions of the state and observation vectors, and 
b) that it doesn't actually matter what they are because they are constants in the log likelihood function, so they can be left out without changing anything. 
Question 2. 
Your matrix output indicates a bug in your code because for any data set, the log likelihood function should output one number for any appropriate values of $A$, $B$, $Q$, $R$, $V_1$ and $\pi_1$.
To be honest, and as the authors observe, this is a very terse note on estimation of linear dynamical systems.  You might do better looking at their main source, Shumway and Stoffer.  The second edition covers this material in chapter 6.  Harvey 1990 also covers the same material.  And there are many more gentle introductions from an engineering perspective on the web, if those are more helpful.
