How Causal Impact works
masterThe algorithm fits a Bayesian structural time series model on past observed data to predict what future data would look like (the counter-factual). It then compares this prediction against the actual observed data to extract statistical conclusions about an intervention.
To run the model, you need:
y: The observed data.X: Covariates used for linear regression.pre-period: An interval selecting data before the intervention.post-period: An interval selecting data after the intervention.