beta.special.pcObj {pcalg} | R Documentation |
This function computes a set of intervention effects of one variable onto another variable in a fast way. The pc-object has to be precomputed.
beta.special.pcObj(x.pos,y.pos,pcObj,mcov=NA,amat=NA,amatSkel=NA,t.amat=NA)
x.pos |
Column of x in dat |
y.pos |
Column of y in dat |
pcObj |
Precomputed pc-object |
mcov |
covariance that was used in the pc-object fit |
amat, amatSkel, t.amat |
matrices that can be precomputed, if needed (see code for details on how to precompute) |
Estimate the intervention effect of x on y; the pcObj has to be precomputed. This method is intended to be a fast version of
beta.special(dat=NA,x.pos,y.pos,verbose=0,a=NA,myDAG=NA,myplot=FALSE, perfect=FALSE,method="local",collTest=TRUE,pcObj=pcObj,all.dags=NA, scaled.data=FALSE,u2pd="relaxed")
Thus, this is a faster version for the local method given a precomputed PC-Algo Object (relaxed udag2pdag, so CPDAG might not be a real CPDAG; this does not matter, since we try not to extend).
If this function is used repeatedly on the same pc-object (e.g. for different values of x and y), the matrices amat, amatSkel and t.amat can be precomputed in order to be more efficient (see the first entry in the code for furhter details).
estimates of intervention effects
Markus Kalisch (kalisch@stat.math.ethz.ch)
M.H. Maathuis, M. Kalisch, P. B"uhlmann (2009), Estimating high-dimensional intervention effects from observational data; Annals of Statistics, 2009.
pcAlgo
,dag2cpdag
,beta.special.pcObj
set.seed(125) p <- 10 n <- 10000 myDAG <- randomDAG(p, prob = 0.4) cov.t <- trueCov(myDAG) pcObj <- pcAlgo.Perfect(cov2cor(cov.t),directed=TRUE) d.mat <- rmvDAG(n, myDAG, errDist = "normal") cov.e <- cov(d.mat) pcObj.est <- pcAlgo(d.mat,alpha=0.01,directed=TRUE) x.pos <- 1 y.pos <- 5 true.eff <- causalEffect(myDAG,y.pos,x.pos) est.eff.p <- beta.special.pcObj(x.pos=x.pos,y.pos=y.pos,pcObj=pcObj,mcov=cov.t) est.eff.e <- beta.special.pcObj(x.pos=x.pos,y.pos=y.pos,pcObj=pcObj.est,mcov=cov.e) true.eff est.eff.p est.eff.e