[R] Question on KalmanSmooth

Kjetil Brinchmann Halvorsen kjetilbrinchmannhalvorsen at gmail.com
Mon Nov 28 00:21:01 CET 2005


I am trying to use KalmanSmooth to smooth a time series
fitted by arima (and with missing values), but the $smooth component
of the output baffles me.  Look at the following example:

testts <- arima.sim(list(ar=0.9),n=100)
testts[6:14] <- NA
testmod <- arima(testts, c(1,0,0))
testsmooth <- KalmanSmooth(testts, testmod$model)
par(mfrow=c(2,1))
plot(testsmooth$smooth, type="l")
plot(testsmooth$var, type="l")

Look at the lower panel plot, how the uncertainty of the
smoothed values first is lowered, then being the highest
at the end ( of the smoothed part, indexes 6:14).
Anybody can explain this,or is this an error?


Kjetil Halvorsen




More information about the R-help mailing list