cauimp | R Documentation |
This function estimates causal inference through counterfactual predictions from a mixture estimation with state-space components. Multi-step ahead predictions are generated by the Monte Carlo method.
cauimp(object,x.post,y.post,alpha=0.05,n.sim=100)
object |
object of class |
x.post |
|
y.post |
one column |
alpha |
optional, |
n.sim |
optional, |
list
of
$statistics |
|
$significance |
|
$p |
|
$y.hat |
|
$alpha |
|
$n.sim |
|
$y.sim |
|
Brodersen, K. H., Gallusser, F., Koehler, J., Remy, N., Scott, S. L., 2015, Inferring causal impact using Bayesian structural time-series models. Annals of Applied Statistics 9, 247–274.
Morgan, S. L., Winship, C., 2007, Counterfactuals and Causal Inference, Cambridge University Press.
mixest1
, CausalImpact
data(oil)
m1 <- mixest1(y=oil[1:300,1,drop=FALSE],x=oil[1:300,-1,drop=FALSE],ftype=0,V=1,W=1,kappa=0.97)
x.1 <- oil[301:323,-1,drop=FALSE]
y.1 <- oil[301:323,1,drop=FALSE]
ci <- cauimp(object=m1,x.post=x.1,y.post=y.1,alpha=0.05,n.sim=100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.