VN Correlation

Share:

Description

Returns the nonlinear correlation coefficient based on partial moment quadrants measured by frequency or area. Degree = 0 is frequency, degree = 1 is area.

Usage

1
VN.cor(x, y, order = 2, degree = ifelse(length(x) < 100, 0, 1))

Arguments

x

Variable 1

y

Variable 2

order

Controls the level of quadrant partitioning. Defualts to order=2. Errors can generally be rectified by setting order=1.

degree

Defaults to 0 for smaller number of observations.

Value

Returns nonlinear correlation coefficient between two variables, or correlation matrix for matrix input.

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
set.seed(123)
## Pairwise Correlation
x<-rnorm(100); y<-rnorm(100)
VN.cor(x,y)

## Correlation Matrix
x<-rnorm(100); y<-rnorm(100); z<-rnorm(100)
B<-cbind(x,y,z)
VN.cor(B)