confint.bcdagCE {BCDAG} | R Documentation |
Credible Intervals for bcdagCE Object
Description
Computes credible (not confidence!) intervals for one or more target variables from objects of class bcdagCE
.
Usage
## S3 method for class 'bcdagCE'
confint(object, parm = "all", level = 0.95, ...)
Arguments
object |
a |
parm |
an integer vector indexing the target variables for which credible intervals are computed. If missing, all variables are considered. |
level |
the credible level required. |
... |
additional arguments. |
Value
A matrix with columns giving lower and upper credible limits for each variable.
Examples
q = 8
w = 0.2
set.seed(123)
DAG = rDAG(q = q, w = w)
outDL = rDAGWishart(n = 1, DAG = DAG, a = q, U = diag(1, q))
L = outDL$L; D = outDL$D
Sigma = solve(t(L))%*%D%*%solve(L)
n = 200
# Generate observations from a Gaussian DAG-model
X = mvtnorm::rmvnorm(n = n, sigma = Sigma)
# Run the MCMC (set S = 5000 and burn = 1000 for better results)
out_mcmc = learn_DAG(S = 500, burn = 100, a = q, U = diag(1,q)/n, data = X, w = w,
fast = TRUE, save.memory = FALSE, verbose = FALSE)
out_ce <- get_causaleffect(out_mcmc, targets = c(4,6), response = 1)
confint(out_ce, c(4,6), 0.95)
[Package BCDAG version 1.1.1 Index]