search for: dropfirst

Displaying 3 results from an estimated 3 matches for "dropfirst".

2014 Jan 08
0
Strange behaviour of `dlm` package
...cally singular 'V' has been slightly perturbed to make it nonsingular fit$conv dlmTsdata <- buildfun(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(tsdat...
2018 Mar 26
0
"dlm" Package: Calculating State Confidence Intervals
...lowing the example in the documentation and using the commands below, I am attempting to use the function "dlmSvd2var" to implement SVD and calculate the 90% confidence errors for each time-varying state. outF <- dlmFilter(y,mod) v <- unlist(dlmSvd2var(outF$U.C, outF$D.C)) pl <- dropFirst(outF$m) + qnorm(0.05, sd=sqrt(v[-1])) pu <- dropFirst(outF$m) + qnorm(0.95, sd=sqrt(v[-1])) Since the dataset has 100 observations, I end up with a vector v that comprises 3636 atomic components: (1 + 100) x (6 x 6). If I discard the 1st 36 of them, then v comprises 3600 atomic components. Th...
2018 Mar 28
0
"dlm" Package: Calculating State Confidence Intervals
...lowing the example in the documentation and using the commands below, I am attempting to use the function "dlmSvd2var" to implement SVD and calculate the 90% confidence errors for each time-varying state. outF <- dlmFilter(y,mod) v <- unlist(dlmSvd2var(outF$U.C, outF$D.C)) pl <- dropFirst(outF$m) + qnorm(0.05, sd=sqrt(v[-1])) pu <- dropFirst(outF$m) + qnorm(0.95, sd=sqrt(v[-1])) Since the dataset has 100 observations, I end up with a vector v that comprises 3636 atomic components: (1 + 100) x (6 x 6). If I discard the 1st 36 of them, then v comprises 3600 atomic components. Th...