cauimp {dynmix} | R Documentation |
Computes Causal Inference through Counterfactual Predictions from a Mixture Estimation with State-Space Components.
Description
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.
Usage
cauimp(object,x.post,y.post,alpha=0.05,n.sim=100)
Arguments
object |
object of class |
x.post |
|
y.post |
one column |
alpha |
optional, |
n.sim |
optional, |
Value
list
of
$statistics |
|
$significance |
|
$p |
|
$y.hat |
|
$alpha |
|
$n.sim |
|
$y.sim |
|
References
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.
See Also
Examples
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)