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

View source: R/rBAP.R

rBAPR Documentation

Causal discovery with latent confounding and non-Gaussian data

Description

Samples from a linear SEM corresponding to a BAP

Usage

rBAP(
  n,
  p,
  dist,
  d,
  b,
  B = NULL,
  Omega = NULL,
  directLow = 0.6,
  directHigh = 1,
  bidirectLow = 0.3,
  bidirectHigh = 0.5,
  t.df = 13,
  ancestral = F,
  shuffle = T,
  signs = T
)

Arguments

n

number of observations

p

number of variables

dist

the distribution of the errors

  • "gauss" for normal distribution

  • "t" for T distribution with t.df degrees of freedom

  • "gamma" for gamma distribution

  • "unif" for uniform distribution

  • "laplace" for Laplace distribution

  • "lognormal" for lognormal distribution

d

number of directed edges

b

number of bidirected edges

B

the direct effects; leave as null to randomly sample

Omega

the covariance of epsilon; leave as null to randomly sample

directLow

the lower bound for the absolute value of a randomly sampled directed edge weight

directHigh

the upper bound for the absolute value of a randomly sampled directed edge weight

bidirectLow

the lower bound for the absolute value of a randomly sampled bidirected edge weight

bidirectHigh

the upper bound for the absolute value of a randomly sampled bidirected edge weight

t.df

degree of freedom if distribution is T

ancestral

T restricts the graph to be ancestral; F allows for a BAP which may not be ancestral

shuffle

Setting shuffle = T randomly relabels the nodes; if set to F then 1... p will always is a valid causal ordering

signs

Setting signs = F, all parameters are positive; setting signs = F allows both positive and negative values

Value

  • B the directed edge coefficients

  • Omega covariance of varepsilon

  • directEdges the adjacency matrix of the directed edges (support of B)

  • bidirectEdgesthe adjacency matrix of the bidirected edges (support of Omega)

  • errs the sampled epsilon values

  • Y the sampled Y values

  • Sigma the population covariance

  • ord a topological ordering of the nodes


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