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

Guaramy Guaramy at hotmail.com
Mon Apr 2 19:39:46 CEST 2012


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
plot(x,M,type="l",lwd=2,col="red")

}

alpha = 0.02612297
beta = -0.50801886
mu = 0.00575829917
delta = 0.67395
x = x=seq(-0.04,0.04,length=200)

MXN.fd(x,alpha,beta,mu,delta)

i think the problem is the gamma function, does anyone know how to compute
gamma with imaginary numbers?

thanks in advance

--
View this message in context: http://r.789695.n4.nabble.com/Error-in-gamma-delta-complex-0-0-1-x-mu-alpha-unimplemented-complex-function-tp4526695p4526695.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list