79810758

Date: 2025-11-06 01:37:14
Score: 0.5
Natty:
Report link

The author of this package mentioned the difference is due to limited number of times of running simulations. "Note that colMeans(y.samples.post) = point.pred.mean.post in expectation (i.e., in the limit of an infinite number of MCMC iterations); but for any given finite simulation, y.samples.post contains sampled observation noise. Therefore, to obtain a summary of the posterior mean series, we consider the mean of the posterior predictive level, without additional simulated (centered) observation noise". Follow this link to see how the releffect is actually calculated, https://github.com/google/CausalImpact/blob/master/R/impact_inference.R

Below is the snippet of how y.samples is generated, which is essentially the denominator (the post intervention part of y.samples) used in calculating RelEffect

 # Compute point predictions of counterfactual (in standardized space)
  y.samples <- ComputeResponseTrajectories(bsts.model)
  state.samples <- GetPosteriorStateSamples(bsts.model)
  point.pred <- ComputePointPredictions(y.samples, state.samples, alpha)

  # Undo standardization (if any)
  y.samples <- UnStandardize(y.samples)
  point.pred <- UnStandardize(point.pred)
  y.model <- UnStandardize(bsts.model$original.series)
Reasons:
  • Blacklisted phrase (1): this link
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: D. Shao