Title: | Tests of independence based on the Longest Increasing Subsequence |
---|---|
Description: | Tests for independence between X and Y computed from a paired sample (x1,y1),...(xn,yn) of (X,Y), using one of the following statistics (a) the Longest Increasing Subsequence (Ln), (b) JLn, a Jackknife version of Ln or (c) JLMn, a Jackknife version of the longest monotonic subsequence. This family of tests can be applied under the assumption of continuity of X and Y. |
Authors: | J. E. Garcia and V. A. Gonzalez-Lopez |
Maintainer: | J. E. Garcia <[email protected]> |
License: | GPL-2 |
Version: | 2.1 |
Built: | 2024-12-13 06:35:52 UTC |
Source: | CRAN |
Tests for independence between X and Y computed from a paired sample (x1,y1), ..., (xn,yn) of (X,Y), using one of the following statistics (a) the Longest Increasing Subsequence (Ln), (b) JLn, a Jackknife version of Ln or (c) JLMn, a Jackknife version of the longest monotonic subsequence. This family of tests can be applied under the assumption of continuity of X and Y.
Package: | LIStest |
Type: | Package |
Version: | 2.1 |
Date: | 2014-03-12 |
License: | GPL-2 |
J. E. Garcia and V. A. Gonzalez-Lopez Maintainer: J. E. Garcia <[email protected]>
J. E. Garcia, V. A. Gonzalez-Lopez, Independence tests for continuous random variables based on the longest increasing subsequence, Journal of Multivariate Analysis (2014), http://dx.doi.org/10.1016/j.jmva.2014.02.010
It compute the JLMn-statistic, from a bivariate sample of continuous random variables X and Y.
JLMn(x, y)
JLMn(x, y)
x , y
|
numeric vectors of data values. x and y must have the same length. |
See subsection 3.3-Main reference. For sample sizes less than 20, the correction introduced in subsection 3.2 from main reference, with c = 0.4 was avoided.
The value of the JLMn-statistic.
J. E. Garcia, V. A. Gonzalez-Lopez
J. E. Garcia, V. A. Gonzalez-Lopez, Independence tests for continuous random variables based on the longest increasing subsequence, Journal of Multivariate Analysis (2014), http://dx.doi.org/10.1016/j.jmva.2014.02.010
# mixture of two bivariate normal, one with correlation 0.9 and # the other with correlation -0.9 # N <-100 ro<- 0.90 Z1<-rnorm(N) Z2<-rnorm(N) X2<-X1<-Z1 I<-(1:floor(N*0.5)) I2<-((floor(N*0.5)+1):N) X1[I]<-Z1[I] X2[I]<-(Z1[I]*ro+Z2[I]*sqrt(1-ro*ro)) X1[I2]<-Z1[I2] X2[I2]<-(Z1[I2]*(-ro)+Z2[I2]*sqrt(1-ro*ro)) plot(X1,X2) #calculate the statistic a<-JLMn(X1,X2) a
# mixture of two bivariate normal, one with correlation 0.9 and # the other with correlation -0.9 # N <-100 ro<- 0.90 Z1<-rnorm(N) Z2<-rnorm(N) X2<-X1<-Z1 I<-(1:floor(N*0.5)) I2<-((floor(N*0.5)+1):N) X1[I]<-Z1[I] X2[I]<-(Z1[I]*ro+Z2[I]*sqrt(1-ro*ro)) X1[I2]<-Z1[I2] X2[I2]<-(Z1[I2]*(-ro)+Z2[I2]*sqrt(1-ro*ro)) plot(X1,X2) #calculate the statistic a<-JLMn(X1,X2) a
It compute the JLn-statistic, from a bivariate sample of continuous random variables X and Y.
JLn(x, y)
JLn(x, y)
x , y
|
numeric vectors of data values. x and y must have the same length. |
See subsection 3.2.-Main reference. For sample sizes less than 20, the correction introduced in subsection 3.2 from main reference, with c = 0.4 was avoided.
The value of the JLn-statistic.
J. E. Garcia and V. A. Gonzalez-Lopez
J. E. Garcia, V. A. Gonzalez-Lopez, Independence tests for continuous random variables based on the longest increasing subsequence, Journal of Multivariate Analysis (2014), http://dx.doi.org/10.1016/j.jmva.2014.02.010
## mixture of two bivariate normal, one with correlation 0.9 and ## the other with correlation -0.9 # N <-100 ro<- 0.90 Z1<-rnorm(N) Z2<-rnorm(N) X2<-X1<-Z1 I<-(1:floor(N*0.5)) I2<-((floor(N*0.5)+1):N) X1[I]<-Z1[I] X2[I]<-(Z1[I]*ro+Z2[I]*sqrt(1-ro*ro)) X1[I2]<-Z1[I2] X2[I2]<-(Z1[I2]*(-ro)+Z2[I2]*sqrt(1-ro*ro)) plot(X1,X2) # calculate the statistic a<-JLn(X1,X2) a
## mixture of two bivariate normal, one with correlation 0.9 and ## the other with correlation -0.9 # N <-100 ro<- 0.90 Z1<-rnorm(N) Z2<-rnorm(N) X2<-X1<-Z1 I<-(1:floor(N*0.5)) I2<-((floor(N*0.5)+1):N) X1[I]<-Z1[I] X2[I]<-(Z1[I]*ro+Z2[I]*sqrt(1-ro*ro)) X1[I2]<-Z1[I2] X2[I2]<-(Z1[I2]*(-ro)+Z2[I2]*sqrt(1-ro*ro)) plot(X1,X2) # calculate the statistic a<-JLn(X1,X2) a
It compute the size of the longest increasing subsequence from a sample of a (continuous) random variable.
lis(x)
lis(x)
x |
numeric vector of data values. |
See example 2.1-Main reference.
Integer, the size of the longest increasing subsequence.
J. E. Garcia and V. A. Gonzalez-Lopez
J. E. Garcia, V. A. Gonzalez-Lopez, Independence tests for continuous random variables based on the longest increasing subsequence, Journal of Multivariate Analysis (2014), http://dx.doi.org/10.1016/j.jmva.2014.02.010
#see Example 2.1 (reference) a<-lis(c(3,6,1,7,4,2,5,8)) a
#see Example 2.1 (reference) a<-lis(c(3,6,1,7,4,2,5,8)) a
Test for independence between X and Y computed from a paired sample (x1,y1),...(xn,yn) of (X,Y), using one of the following statistics (a) the Longest Increasing Subsequence (Ln), (b) JLn, a Jackknife version of Ln or (c) JLMn, a Jackknife version of the longest monotonic subsequence. This family of tests can be applied under the assumption of continuity of X and Y.
lis.test(x, y, alternative = c("two.sided", "less", "greater"), method = c("JLMn", "Ln", "JLn"))
lis.test(x, y, alternative = c("two.sided", "less", "greater"), method = c("JLMn", "Ln", "JLn"))
x , y
|
numeric vectors of data values. x and y must have the same length. |
alternative |
indicates the alternative hypothesis and must be one of "two.sided"(default), "greater" or "less". |
method |
a character string indicating which statistics is to be used for the test. One of "Ln", "JLn", or "JLMn"(default). |
For sample sizes less than 20, the correction introduced in subsection 3.2 from main reference, with c = 0.4 was avoided.
sample.estimate |
the value of the statistic. |
p.value |
the p-value for the test. |
alternative |
a character string describing the alternative hypothesis. |
method |
a character string indicating what type of Lis-test was performed. |
J. E. Garcia and V. A. Gonzalez-Lopez
J. E. Garcia, V. A. Gonzalez-Lopez, Independence tests for continuous random variables based on the longest increasing subsequence, Journal of Multivariate Analysis (2014), http://dx.doi.org/10.1016/j.jmva.2014.02.010
# Example 1 # mixture of two bivariate normal, one with correlation 0.9 # and the other with correlation -0.9 N <-100 ro<- 0.90 Z1<-rnorm(N) Z2<-rnorm(N) X2<-X1<-Z1 I<-(1:floor(N*0.5)) I2<-((floor(N*0.5)+1):N) X1[I]<-Z1[I] X2[I]<-(Z1[I]*ro+Z2[I]*sqrt(1-ro*ro)) X1[I2]<-Z1[I2] X2[I2]<-(Z1[I2]*(-ro)+Z2[I2]*sqrt(1-ro*ro)) plot(X1,X2) # calculate the p.value using the default settings (method="JLMn" # and alternative="two.sided") lis.test(X1,X2) # calculate the p.value using method="JLn" and # alternative="two.sided". lis.test(X1,X2,method="JLn") # # Example 2: see subsection 4.3.2-Application 2 from main reference. # (It requires the package VGAM) # #require(VGAM) #plot(coalminers$BW, coalminers$nBW) #lis.test(coalminers$BW, coalminers$nBW, #alternative = "greater", method = "Ln") #lis.test(coalminers$BW, coalminers$nBW, #alternative = "greater", method = "JLn") #
# Example 1 # mixture of two bivariate normal, one with correlation 0.9 # and the other with correlation -0.9 N <-100 ro<- 0.90 Z1<-rnorm(N) Z2<-rnorm(N) X2<-X1<-Z1 I<-(1:floor(N*0.5)) I2<-((floor(N*0.5)+1):N) X1[I]<-Z1[I] X2[I]<-(Z1[I]*ro+Z2[I]*sqrt(1-ro*ro)) X1[I2]<-Z1[I2] X2[I2]<-(Z1[I2]*(-ro)+Z2[I2]*sqrt(1-ro*ro)) plot(X1,X2) # calculate the p.value using the default settings (method="JLMn" # and alternative="two.sided") lis.test(X1,X2) # calculate the p.value using method="JLn" and # alternative="two.sided". lis.test(X1,X2,method="JLn") # # Example 2: see subsection 4.3.2-Application 2 from main reference. # (It requires the package VGAM) # #require(VGAM) #plot(coalminers$BW, coalminers$nBW) #lis.test(coalminers$BW, coalminers$nBW, #alternative = "greater", method = "Ln") #lis.test(coalminers$BW, coalminers$nBW, #alternative = "greater", method = "JLn") #
It compute the Ln-statistic, from a bivariate sample of continuous random variables X and Y.
Ln(x, y)
Ln(x, y)
x , y
|
numeric vectors of data values. x and y must have the same length. |
See Section 2.-Main reference.
The value of the Ln-statistic.
J. E. Garcia and V. A. Gonzalez-Lopez
J. E. Garcia, V. A. Gonzalez-Lopez, Independence tests for continuous random variables based on the longest increasing subsequence, Journal of Multivariate Analysis (2014), http://dx.doi.org/10.1016/j.jmva.2014.02.010
## mixture of two bivariate normal, one with correlation ## 0.9 and the other with correlation -0.9 # N <-100 ro<- 0.90 Z1<-rnorm(N) Z2<-rnorm(N) X2<-X1<-Z1 I<-(1:floor(N*0.5)) I2<-((floor(N*0.5)+1):N) X1[I]<-Z1[I] X2[I]<-(Z1[I]*ro+Z2[I]*sqrt(1-ro*ro)) X1[I2]<-Z1[I2] X2[I2]<-(Z1[I2]*(-ro)+Z2[I2]*sqrt(1-ro*ro)) plot(X1,X2) # calculate the statistic a<-Ln(X1,X2) a
## mixture of two bivariate normal, one with correlation ## 0.9 and the other with correlation -0.9 # N <-100 ro<- 0.90 Z1<-rnorm(N) Z2<-rnorm(N) X2<-X1<-Z1 I<-(1:floor(N*0.5)) I2<-((floor(N*0.5)+1):N) X1[I]<-Z1[I] X2[I]<-(Z1[I]*ro+Z2[I]*sqrt(1-ro*ro)) X1[I2]<-Z1[I2] X2[I2]<-(Z1[I2]*(-ro)+Z2[I2]*sqrt(1-ro*ro)) plot(X1,X2) # calculate the statistic a<-Ln(X1,X2) a
Simulated values for the JLMn statistic under the hypothesis of independence
The format is: List of 200 tables
J. E. Garcia, V. A. Gonzalez-Lopez, Independence tests for continuous random variables based on the longest increasing subsequence, Journal of Multivariate Analysis (2014), http://dx.doi.org/10.1016/j.jmva.2014.02.010
Simulated values for the JLn statistic under the hypothesis of independence.
The format is: List of 200 tables
J. E. Garcia, V. A. Gonzalez-Lopez, Independence tests for continuous random variables based on the longest increasing subsequence, Journal of Multivariate Analysis (2014), http://dx.doi.org/10.1016/j.jmva.2014.02.010
Simulated values for the Ln statistic under the hypothesis of independence
The format is: List of 200 tables
J. E. Garcia, V. A. Gonzalez-Lopez, Independence tests for continuous random variables based on the longest increasing subsequence, Journal of Multivariate Analysis (2014), http://dx.doi.org/10.1016/j.jmva.2014.02.010