search for: dlmcostusd

Displaying 1 result from an estimated 1 matches for "dlmcostusd".

2009 Mar 11
1
Forecasting with dlm
...h as possible) data for example to run code CostUSD <- c(27.24031,32.97051, 38.72474, 22.78394, 28.58938, 49.85973, 42.93949, 35.92468) library(dlm) buildFun <- function(x) { dlmModPoly(1, dV = exp(x[1]), dW = exp(x[2])) } fit <- dlmMLE(CostUSD, parm = c(0,0), build = buildFun) fit$conv dlmCostUSD <- buildFun(fit$par) V(dlmCostUSD) W(dlmCostUSD) #For comparison StructTS(CostUSD, "level") CostUSDFilt <- dlmFilter(CostUSD, dlmCostUSD) CostUSDFore <- dlmForecast(CostUSDFilt, nAhead = 1) after which i return the error message: Error in mod$m[lastObsIndex, ] : incorrect numb...