IVC {IVCor} | R Documentation |
Integrated Variance Correlation
Description
This function is used to calculate the integrated variance correlation between two random variables or between a random variable and a multivariate random variable
Usage
IVC(y, x, K, NN = 3, type)
Arguments
y |
is a numeric vector |
x |
is a numeric vector or a data matrix |
K |
is the number of quantile levels |
NN |
is the number of B spline basis, default is 3 |
type |
is an indicator for measuring linear or nonlinear correlation, "linear" represents linear correlation and "nonlinear" represents linear or nonlinear correlation using B splines |
Value
The value of the corresponding sample statistic
Examples
# linear model
n=100
x=rnorm(n)
y=3*x+rnorm(n)
IVC(y,x,K=5,type="linear")
# nonlinear model
n=100
p=3
x=matrix(NA,nrow=n,ncol=p)
for(i in 1:p){
x[,i]=rnorm(n)
}
y=cos(x[,1]+x[,2])+x[,3]^2+rnorm(n)
IVC(y,x,K=5,type="nonlinear")
[Package IVCor version 0.1.0 Index]