How would I go about setting up a dlm model, which I eventually would like to apply a Kalman filter on? I tried the following:
y <- # finance or GDP data
myMod = dlmModPoly(order = 1, dV = 0.8, dW = 1.0, C0 = y[1])
# not sure how to set the coefficients but this seems to work, more or less
arima <- auto.arima(y)
myMod <- dlmModARMA(ar= arima$coef, sigma2 = arima$sigma2)
# this one straight up does not work when applied to the filter
output <- dlmFilter(y, myMod) # Kalman Filter