steve-the-bayesian / BOOM

A C++ library for Bayesian modeling, mainly through Markov chain Monte Carlo, but with a few other methods supported. BOOM = "Bayesian Object Oriented Modeling". It is also the sound your computer makes when it crashes.
GNU Lesser General Public License v2.1
35 stars 14 forks source link

Dynamic regression throws an error #29

Closed steve-the-bayesian closed 5 years ago

steve-the-bayesian commented 5 years ago

When adding DynamicRegression to the ss, and attempting to run the model, it causes R to crash.

also R doesn't know what to do with this statement:

DynamicRegressionArOptions(lags = 2, sigma.prior = SdPrior(1,1)) - it throws an error.

steve-the-bayesian commented 5 years ago

I have a "zoo" data set with 144 rows (timepoints) and 23 Variables (including one y variable and 22 covariables x1, ..., xN). I tried to run the following code:

ss <- AddSemilocalLinearTrend(list(), y )

ss <- AddSeasonal(ss, y , nseasons = 12)

ss <- AddDynamicRegression(ss, y ~ x1, data = data)

bsts.reg <- bsts(y~ x2, state.specification = ss, data = data, niter = 500, ping=0)

burn <- SuggestBurn(0.1, bsts.reg)

predBSTS <- predict(bsts.reg, newdata = data.frame(dataplan), burn = burn, quantiles = c(.025, .975))

steve-the-bayesian commented 5 years ago

Fixed in bsts v 0.9