Error generated attempting customized model

107 views
Skip to first unread message

Jerry Ratcliffe

unread,
Dec 8, 2014, 12:58:37 PM12/8/14
to causal...@googlegroups.com

Hello,

Love the package and its potential, but having problems extracting coefficient estimates for pre-intervention variables. 

Attempting command: 
bsts.model <- bsts(y ~ x1 +x2 + x3, ss, model.args = list(nseasons = 12, niter = 1000))

But I get the error:
Error in stopifnot(is.numeric(niter)) : 
  argument "niter" is missing, with no default

If I (successfully) run a more standard model, I can only use the command:
plot(impact$model$bsts.model)
But it doesn't parse out any contributions from the individual variables, as I believe the documentation says it should (?)

Has anyone else experienced this? Have tried reloading the package. I'm trying to figure out which relative impact of the predictors in determining the pre-intervention series. 

TIA

 - Jerry


Kay Brodersen

unread,
Dec 12, 2014, 12:37:27 PM12/12/14
to Jerry Ratcliffe, causal...@googlegroups.com
Hi Jerry,

You can plot the contributions of the individual regressors using:

   plot(impact$model$bsts.model, "coefficients")

The colour indicates whether the coefficient itself has a positive or a negative expectation. You can further inspect the posterior distributions over the coefficients by typing:

   names(impact$model$bsts.model)

When using a custom model, to see the syntax of the bsts() command, type:

   ?bsts

For example, the number of iterations is specified using:

   bsts(..., niter = 10000)

I hope this helps in answering your questions.
Kay




--
You received this message because you are subscribed to the Google Groups "CausalImpact" group.
To unsubscribe from this group and stop receiving emails from it, send an email to causalimpact...@googlegroups.com.
To post to this group, send email to causal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/causalimpact/6c1f2779-5b99-4b0a-95f7-7aa6abbfa2bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages