Last chance! 50% off unlimited learning
Sale ends in
dlmBSample(modFilt)
dlmFilter
, with elements
m
, U.C
, D.C
, a
, U.R
, D.R
(see
the value returned by dlmFilter
), and mod
m
is a time series then the returned
value is a time series with the same tsp
, otherwise it is
a matrix or vector.dlmFilter
nileMod <- dlmModPoly(1, dV = 15099.8, dW = 1468.4)
nileFilt <- dlmFilter(Nile, nileMod)
nileSmooth <- dlmSmooth(nileFilt) # estimated "true" level
plot(cbind(Nile, nileSmooth$s[-1]), plot.type = "s",
col = c("black", "red"), ylab = "Level",
main = "Nile river", lwd = c(2, 2))
for (i in 1:10) # 10 simulated "true" levels
lines(dlmBSample(nileFilt[-1]), lty=2)
Run the code above in your browser using DataLab