Displaying 1 result from an estimated 1 matches for "sqrtr".
Did you mean:
sqrt
2014 Jan 08
0
Strange behaviour of `dlm` package
...fit$par)
tsdataFilter <- dlmFilter(tsdata, mod=dlmTsdata)
tsdataSmooth <- dlmSmooth(tsdata, mod=dlmTsdata)
plot(tsdata, lwd=2)
for (i in 1:10)
lines(lty=6, col="blue", dropFirst(dlmBSample(tsdataFilter))[,1])
# looks ok!
tsdataForecast <- dlmForecast(tsdataFilter, nAhead=20)
sqrtR <- sapply(tsdataForecast$R, function(x) sqrt(x[1,1]))
pl <- tsdataForecast$a[,1] + qnorm(0.05, sd= sqrtR)
pu <- tsdataForecast$a[,1] + qnorm(0.95, sd= sqrtR)
x <- ts.union(tsdata,tsdataSmooth$s[,1],tsdataForecast$a[,1],pl,pu)
plot(x, plot.type="single", type="l",
co...