Re: [R] Error in gamma(delta + (complex(0, 0, 1) * (x - mu))/alpha) : unimplemented complex function

2012-04-03 Thread Hans W Borchers
I am trying to obtain the grafic of a pdf . but this error keeps showing . Here is the code Or use the complex gamma function gammaz() in package 'pracma'. The following code works, that is produces a plot: library(pracma) MXN.fd - function(x,alpha,beta,mu,delta) { A -

[R] Error in gamma(delta + (complex(0, 0, 1) * (x - mu))/alpha) : unimplemented complex function

2012-04-02 Thread Guaramy
I am trying to obtain the grafic of a pdf . but this error keeps showing . Here is the code MXN.fd = function(x,alpha,beta,mu,delta) { A = (2*cos(beta/2))^(2*delta) B = 2*alpha*pi*gamma(2*delta) C = (beta*(x-mu))/alpha D = abs(gamma(delta + (complex(0,0,1)*(x-mu))/alpha)^2) M = A/B*exp(C)*D M

Re: [R] Error in gamma(delta + (complex(0, 0, 1) * (x - mu))/alpha) : unimplemented complex function

2012-04-02 Thread Ben Bolker
Guaramy Guaramy at hotmail.com writes: [SNIP] i think the problem is the gamma function, does anyone know how to compute gamma with imaginary numbers? Try lngamma_complex() in the gsl package? Ben Bolker __ R-help@r-project.org mailing