R/nmat.R

Defines functions nmat

Documented in nmat

nmat=function(vec) 
{
#
#    function to take var-cov matrix in vector form and create correlation matrix 
#       and store in vector form
#
p=as.integer(sqrt(length(vec)))
sigma=matrix(vec,ncol=p)
nsig=1/sqrt(diag(sigma))
return(as.vector(nsig*(t(nsig*sigma))))
}

Try the bayesm package in your browser

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

bayesm documentation built on Sept. 24, 2023, 1:07 a.m.