Revision 128cc5eed366a5a3f6c33b70a81379c1b1ca8688 authored by Matthias Templ on 16 August 2010, 18:42:55 UTC, committed by cran-robot on 16 August 2010, 18:42:55 UTC
1 parent 4c9961a
Raw File
robVariation.R
`robVariation` <-
function(x, robust=TRUE){
    rvars <- matrix(0, ncol=ncol(x), nrow=ncol(x))
	if(robust){
    for( i in 1:ncol(x)){
      for( j in 1:ncol(x)){
        if( i < j ) rvars[i,j] <- (mad(log(x[,i]/x[,j])))^2
      }
    }
	} else{
		for( i in 1:ncol(x)){
			for( j in 1:ncol(x)){
				if( i < j ) rvars[i,j] <- (var(log(x[,i]/x[,j])))^2
			}
		}		
	}
    invisible(rvars) 
}

back to top