Revision 4f2efb4ed8831a90968ef063d2403d675c84dae3 authored by Matthias Templ on 26 November 2013, 12:55:44 UTC, committed by cran-robot on 26 November 2013, 12:55:44 UTC
1 parent 2ad963b
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])))
}
}
}
rvars[lower.tri(rvars)] <- rvars[upper.tri(rvars)]
return(rvars)
}
Computing file changes ...