NNS.caus: NNS Causation

Description Usage Arguments Value Author(s) References Examples

View source: R/Causation.R

Description

Returns the causality from observational data between two variables.

Usage

1
NNS.caus(x, y, tau, time.series = FALSE, plot = FALSE)

Arguments

x

a numeric vector, matrix or data frame.

y

NULL (default) or a numeric vector with compatible dimsensions to x.

tau

options: ("cs", "ts", integer); Number of lagged observations to consider (for time series data). Otherwise, set (tau = "cs") for cross-sectional data. (tau = "ts") automatically selects the lag of the time series data, while (tau = [integer]) specifies a time series lag.

time.series

logical; FALSE (default) If analyzing time series data with tau = [integer], select (time.series = TRUE). Not required when (tau = "ts").

plot

logical; FALSE (default) Plots the raw variables, tau normalized, and cross-normalized variables.

Value

Returns the directional causation (x —> y) or (y —> x) and net quantity of association. For causal matrix, directional causation is returned as ([column variable] —> [row variable]). Negative numbers represent causal direction attributed to [row variable].

Author(s)

Fred Viole, OVVO Financial Systems

References

Viole, F. and Nawrocki, D. (2013) "Nonlinear Nonparametric Statistics: Using Partial Moments" http://amzn.com/1490523995

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## x clearly causes y...
set.seed(123)
x <- rnorm(100) ; y <- x ^ 2
NNS.caus(x, y, tau = "cs")

x <- 1:100 ; y <- x^2
NNS.caus(x, y, tau = "ts", time.series = TRUE)

## Causal matrix
## Not run: 
NNS.caus(data.matrix(iris), tau = 0)

## End(Not run)

NNS documentation built on April 15, 2019, 5:05 p.m.