R/log_multi_gamma.R

#  MULTI_GAMMA returns multivariate gamma function at value n,p 
#   \Gamma_p(n/2)= \pi^{p(p-1)/4}\Pi_{j=1}^p \Gamma\left[ (n+1-j)/2\right]. 
log_multi_gamma<-function( p, n )
{
    f <- ( p * ( p - 1 ) / 4 ) * log( pi );
    for( j in 1:p ){
      f <- f + lgamma( n + ( 1 - j ) / 2 );
    }
    return(f)
}


#function f=log_multi_gamma(p,n)
#%  MULTI_GAMMA returns multivariate gamma function at value n,p 
#%   \Gamma_p(n/2)= \pi^{p(p-1)/4}\Pi_{j=1}^p \Gamma\left[ (n+1-j)/2\right]. 
#
#f=(p*(p-1)/4)*log(pi);
#for j=1:p
#f=f+gammaln(n+(1-j)/2);
#end

Try the NonDecompGraph package in your browser

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

NonDecompGraph documentation built on May 2, 2019, 6:47 p.m.