Package 'PolyTree'

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

Help Index


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.

Description

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.

Usage

condeptree(x)

Arguments

x

The input data matrix.


Creates an outgoing tree from a given undirected treee.

Description

Creates an outgoing tree from a given undirected treee.

Usage

outgoing(tree, dir_tree = NULL, a = NULL, b = 1)

Arguments

tree

Input tree, undirected.

dir_tree

Directionalities that must be present.

a

The node being inspected.

b

The neighbor being inspected.


Causal Polytree Estimation

Description

Estimates directed causal polytree from data, using algorithm developed in Chatterjee and Vidyasagar (2022).

Usage

polytree(x)

Arguments

x

Data matrix, whose rows are i.i.d. data vectors generated from the model.

Value

A directed polytree estimated from the input data, as an igraph object.

References

Sourav Chatterjee and Mathukumalli Vidyasagar (2022). Estimating large causal polytrees from small samples. Available at https://arxiv.org/abs/2209.07028

Examples

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.

Description

This function computes the xi correlation coefficient.

Usage

xicorln(xvec, yvec)

Arguments

xvec

The vector of x values.

yvec

The vector of y values.