Description Usage Arguments Details Value Author(s) References
Performs a time series causal analysis using a simulated predictive distribution for the counterfactual.
1 2 3 4 |
object |
An object which inherits class “tsmodel.distribution” representing the forecast distribution in the post intervention period. |
actual |
An xts vector of the actual data series which includes both the pre and post intervention data. |
fitted |
An optional object for the in-sample fitted values which can be either an xts vector or an object of class “tsmodel.distribution”. |
alpha |
The coverage representing the 1-alpha confidence level. |
include_cumulative |
Whether to include cumulative sum analysis. This is only valid if the target represents a flow variable. |
... |
Any additional arguments passed to custom classes. |
The routine calculates the point wise differences between the actual and counterfactual (distribution) to determine the distribution of the lift.
An object of class “tscausal” which can be passed to the print,
report or plot functions.
Alexios Galanos with some supporting code borrowed from the CausalImpact package of Scott.
Brodersen, Kay H and Gallusser, Fabian and Koehler, Jim and Remy, Nicolas and Scott, Steven L and others (2016). Inferring causal impact using Bayesian structural time-series models. The Annals of Applied Statistics, 9 (1), 247-274.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.