https://github.com/cran/mvtBinaryEP
Tip revision: e03023db232593f436717e7be27d1c52d9865644 authored by Kunthel By on 18 February 2009, 00:00:00 UTC
version 1.0
version 1.0
Tip revision: e03023d
rho.to.rootS2.R
`rho.to.rootS2` <-
function(mu, p, rho, crit=1e-6, maxiter=20)
{
tc.cor <- tetra1(c(mu,mu), rho, crit=crit, maxiter=maxiter);
if (tc.cor[[2]])
{
return( list( rootSigma=NULL, sigma=NULL, pd=NA, sp=F, i=NA, j=NA ) )
}
pd <- as.logical( tc.cor[[1]] > ( -1/(p-1) ) )
if (pd) { return( list( rootSigma = sqrt( tc.cor[[1]] ), sigma = NULL, pd=T, sp=T, i=NA, j=NA ) ) }
else { return( list( rootSigma=NULL, sigma=tc.cor[[1]], pd=F, sp=T, i=NA, j=NA ) ) }
}