lis {LIStest} | R Documentation |
calculate the size of the longest increasing subsequence for a sample of a continuous random variable.
lis(x)
x |
x is a numeric vector of data values |
Integer, the size of the longest increasing subsequence.
Jesus Garcia and Veronica Andrea Gonzalez Lopez
A nonparametric idependence test for small sample size
X<-rexp(50) Y<-runif(50,0,X) res<-LIS.pvalue(X,-Y,alternative="two.sided") res ## The function is currently defined as function( x ){ N<-length(x); gr<-c(1:N)*0 gr[1]<-1 for ( i in 2:N ){ gr[i] = 1; for ( j in 1:(i - 1) ){ if ( x[i] > x[j] ) { gr[i] = max( gr[i], gr[j] + 1) } } } rr<-max( gr ) }