R/utils.R
estimate_latent_count.Rd
This function takes a DAG with edgeweights as input and computes the causal effects of all nodes on all direct and indirect children in the DAG. Alternatively see pcalg::causalEffect for pairwise computation.
estimate_latent_count(X1, X2, method = "auto")
data matrix corresponding to the first condition
data matrix corresponding to the second condition
a string indicating the method used for estimating the number of latent variables
estimated number of latent variables
graph1 <- create_random_DAG(node_num = 100, prob = .1)
graph2 <- resample_edge_weights(graph1, tp=0.15)
X1 <- simulate_data(graph1, n=200, latent = 3)
X2 <- simulate_data(graph2, n=200, latent = 3)
estimate_latent_count(X1, X2)
#> [1] 3