I am trying to numerically integrate a Generalized Normal Distribution. I expect the area under it to be 1. What I get is -1. Why is it like this?
mu=0;
alpha=0.5;
beta=2;
x=-2:0.01:2;
densityGG = beta/(2*alpha*gamma(1/beta)) * exp(-power(abs(x-mu)/alpha,beta));
plot(x,densityGG);
trapz(densityGG,x)
The function is actually
So try
and it should sort things out.