Kalman_smoother returns X and likelihood. The penalized likelihood is the likelihood minus the sum-of-squares of the measurement update. This is used as the fitness function in genetic algorihm.
penalized_likelihood(y, u, v, theta.vec, lambda)
Observation matrix (may need to be normalized and centered before hand) (q rows, T columns)
Input matrix for the state equation (m_u rows, T columns)
Input matrix for the output equation (m_v rows, T columns)
a vector of parameter elements (i.e, the vectorized version of theta
in Kalman_smoother
)
weight of the penalty
The penalized likelihood (a real number)