I would like to test the suitability of the dynamic linear model which I have fitted to a problem set of data. I have done this using the SS() function in the dse package in R. Are there any ways of testing the fit of the model in R using likelihoods and information tests?
For illustrative purposes, assume that my model is a random walk. The theoretical form of the random walk being X(t) = X(t-1) + e(t)~N(0,1) for state evolution Y(t) = X(t) + w(t)~N(0,1). The code in R being defined by:
kalman.filter=dse::SS(F = matrix(1,1,1),
Q = matrix(1,1,1),
H = matrix(1,1,1),
R = matrix(1,1,1),
z0 = matrix(0,1,1),
P0 = matrix(0,1,1)
)
Assume that the actual observations were then:
simulate.kalman.filter=simulate(kalman.filter, start = 1, freq = 1, sampleT = 100)
Then assume we fit a model called "test":
test=l(kalman.filter, simulate.kalman.filter)
How can I test the fit of the data (simulate.kalman.filter) to the model theoretical model in R? I am looking for function such as the likelihood and the Bayesian Information Criterion.