3
$\begingroup$

I am simulating this model in the paper Brodersen et al. (2015) and found I have difficulties on figuring out how to choose the starting point of Bayesian inference.

To be explicit, to my understanding, if I choose Durbin and Koopman (2002)'s simulation smoother (I think this is what the paper used) to simulate the latent state $\boldsymbol \alpha$ from $p(\boldsymbol \alpha| \boldsymbol y, \theta, \beta, \sigma^2_\epsilon)$, I need to choose the starting points of $\eta_{\mu,t}$, $\eta_{\delta,t}$ and $\eta_{\gamma,t}$ in order to generate a set of new dataset $\boldsymbol w^+$, $\boldsymbol \alpha^+$ $\boldsymbol y^+$. However, I cannot figure out how to choose these values. If I generate a value or use the mean from the prior $1/\sigma^2 \sim Gamma(10^{-2}, 10^{-2} s_y^2)$ suggests in the paper to inference $\theta \sim P(\theta| \boldsymbol y, \boldsymbol \alpha, beta, \sigma^2_\epsilon$, the starting points would be too big.

Another question is how to choose the starting points for $\boldsymbol \beta$ and $\sigma^2$?

Last, I found the main part of R package CausalImpact is being compiled and thus I cannot open the code to see how it works. If anyone has the code or similar, would you help to share it if possible?

Thanks to everyone`s help.

$\endgroup$
2
  • $\begingroup$ CausalImpact code is here github.com/google/CausalImpact $\endgroup$
    – jaradniemi
    Jun 5, 2015 at 16:53
  • $\begingroup$ Thanks to your reply. It is a good resource. If check this code carefully, the core part of this code is being compiled into .so file. So I don`t know how the bayesian inference works exactly. This is the part I am asking for answer. $\endgroup$
    – Po Ning
    Jun 5, 2015 at 17:37

1 Answer 1

2
$\begingroup$

You can either choose the prior mean or, more commonly, actually sample values from the prior, however extreme they might be. The Kalman filter and Durbin and Koopman's algorithm will quickly converge on more sane values as the number of MCMC samples increases.

$\endgroup$
2
  • $\begingroup$ Thanks very much to your advise. I have figured it out yesterday after carefully debugging. However, here is another question. (Forgive me that I have so many questions) I want to replicate the prediction result as you did in AR(2) model, exactly the same setting in the CausalImpact package. From predicting time period t+1 to T, I use the predicted y value at t+1 to predict y value at t+2, and so on until T. What I found is I got the similar prediction value as the package did, but I got a wider confidence interval then yours. Are you using the same way to produce the prediction value? Thank $\endgroup$
    – Po Ning
    Jun 14, 2015 at 3:24
  • $\begingroup$ Hi @PoNing, the package computes posterior predictive smoothing intervals, that is, the interval for time t is computed as p(y_t | y_1, ..., y_n), not as p(y_t | y_1, ..., y_{t-1}). $\endgroup$ Jun 16, 2015 at 20:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.