bang: Causal discovery with latent confounding and non-Gaussian...

View source: R/bang.R

bangR Documentation

Causal discovery with latent confounding and non-Gaussian data

Description

Estimates a graph from data generated by a linear SEM with non-Gaussian errors corresponding to a BAP

Usage

bang(Y, K, level = 0.01, verbose = T, restrict = 1)

Arguments

Y

n x p matrix of observations with sample in row, variable in column

K

The degree of the moment which is non-Gaussianity (i.e., this is K in the paper)

level

the nominal level for the empirical likelihood tests

verbose

Print progress updates

restrict

Which moment restrictions to test in empirical likelihood

  • restrict = 1 restricts all moments up to degree K; i.e. gamma_v^k gamma_u and gamma_v gamma_u^k for k < K

  • restrict = 2, tests moments of degree K-1 and 1; i.e. gamma_v^(K-1) gamma_u and gamma_v gamma_u^(K-1)

Value

  • totalEffect estimate of (I-B)^(-1)

  • directEffect estimate of B

  • omega estimate of Omega

  • dEdge estimate of adjacncey matrix corresponding to directed edges

  • bEdge estimate of adjacncey matrix corresponding to bidirected edges

  • errs estimated epsilons

Examples

## Not run: 
dat <- ngBap::rBAP(n = 50000, p = 7, dist = "gamma", d = 3, b = 5, ancestral = F, shuffle = T, signs = T)
Y <- dat$Y
out <- ngBap::bang(Y, K = 3, level = .01, verbose = F, restrict = 1)

## End(Not run)



ysamwang/ngBap documentation built on Nov. 1, 2022, 3:20 a.m.