polytree | R Documentation |
Estimates directed causal polytree from data, using algorithm developed in Chatterjee and Vidyasagar (2022).
polytree(x)
x |
Data matrix, whose rows are i.i.d. data vectors generated from the model. |
A directed polytree estimated from the input data, as an igraph object.
Sourav Chatterjee and Mathukumalli Vidyasagar (2022). Estimating large causal polytrees from small samples. Available at https://arxiv.org/abs/2209.07028
p <- 10
n <- 200
x <- matrix(nrow = n, ncol = p)
for (i in 1:n) {
x[i,1] = rnorm(1)
for (j in 2:p) {
x[i,j] = (x[i,j-1] + rnorm(1))/sqrt(2)
}
}
p <- polytree(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.