R/rvCoeff.R

Defines functions rvCoeff

Documented in rvCoeff

rvCoeff <- function(Smat,Tmat, type){
##private function
matrixTrace <- function(squareMatrix){
	return(sum(diag(squareMatrix)))
}	
	#rv = 0
	if(sum(dim(Smat) == dim(Tmat)) != 2){
		print('Dimensions do not match')
		return(NaN)
	}
		
	return( as.numeric(matrixTrace(t(Smat) %*% Tmat) / sqrt( matrixTrace(t(Smat) %*% Smat) %*% matrixTrace(t(Tmat) %*% Tmat) )) ) 
	
}

Try the ExPosition package in your browser

Any scripts or data that you put into this service are public.

ExPosition documentation built on May 1, 2019, 7:06 p.m.