Title: | Estimate Causal Polytree from Data |
---|---|
Description: | Given a data matrix with rows representing data vectors and columns representing variables, produces a directed polytree for the underlying causal structure. Based on the algorithm developed in Chatterjee and Vidyasagar (2022) <arxiv:2209.07028>. The method is fully nonparametric, making no use of linearity assumptions, and especially useful when the number of variables is large. |
Authors: | Sourav Chatterjee [aut, cre] |
Maintainer: | Sourav Chatterjee <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.1 |
Built: | 2024-12-21 06:27:56 UTC |
Source: | CRAN |
This is the function that computes the skeletion tree from data. The input is a matrix x whose rows are the data vectors. The sample size n is the number of rows. The number of variables p is the number of columns The function outputs the skeleton tree g.
condeptree(x)
condeptree(x)
x |
The input data matrix. |
Creates an outgoing tree from a given undirected treee.
outgoing(tree, dir_tree = NULL, a = NULL, b = 1)
outgoing(tree, dir_tree = NULL, a = NULL, b = 1)
tree |
Input tree, undirected. |
dir_tree |
Directionalities that must be present. |
a |
The node being inspected. |
b |
The neighbor being inspected. |
Estimates directed causal polytree from data, using algorithm developed in Chatterjee and Vidyasagar (2022).
polytree(x)
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)
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)
This function computes the xi correlation coefficient.
xicorln(xvec, yvec)
xicorln(xvec, yvec)
xvec |
The vector of x values. |
yvec |
The vector of y values. |