R/phi.R

Defines functions phi

Documented in phi

phi <-
function(a,b){

if ((is.matrix(a)) & (is.matrix(b))){
	p=solve(diag(diag(t(a)%*%a),nrow=ncol(a))^.5)%*%t(a)%*%b%*%solve(diag(diag(t(b)%*%b),nrow=ncol(b))^.5)
} else{
	p=solve((t(a)%*%a)^.5)%*%t(a)%*%b%*%solve((t(b)%*%b)^.5)
}
return(p)
}

Try the ThreeWay package in your browser

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

ThreeWay documentation built on May 29, 2017, 11:52 p.m.