lu4

30 Reputation

4 Badges

13 years, 356 days

MaplePrimes Activity


These are replies submitted by lu4

@Markiyan Hirnyk 

Thanks, I've used the following code:

SkewedNormal := (xi, omega, alpha) -> Distribution(PDF = ((x) -> x*sqrt(2)*exp(-(1/2)*(x-xi)^2/omega^2)*(1/2+(1/2)*erf((1/2)*alpha*(x-xi)*sqrt(2)/omega))/(omega*sqrt(Pi))), CDF = ((x) -> 1/2+(1/2)*erf((1/2)*(x-xi)*sqrt(2)/omega)-(int(exp(-(1/2)*(x-xi)^2*(1+x^2)/omega^2)/(1+x^2), x = 0 .. alpha))/Pi), Mean = xi+omega*alpha*sqrt(2/Pi)/sqrt(1+alpha^2), Variance = omega^2*(1-2*alpha^2/(sqrt(1+alpha^2)^2*Pi)), MGF = ((x) -> 2*exp(xi*x+(1/2)*omega^2*x^2)*(1/2+(1/2)*erf((1/2)*omega*alpha*x*sqrt(2)/sqrt(1+alpha^2))))) 

@Markiyan Hirnyk 

Thanks, I've used the following code:

SkewedNormal := (xi, omega, alpha) -> Distribution(PDF = ((x) -> x*sqrt(2)*exp(-(1/2)*(x-xi)^2/omega^2)*(1/2+(1/2)*erf((1/2)*alpha*(x-xi)*sqrt(2)/omega))/(omega*sqrt(Pi))), CDF = ((x) -> 1/2+(1/2)*erf((1/2)*(x-xi)*sqrt(2)/omega)-(int(exp(-(1/2)*(x-xi)^2*(1+x^2)/omega^2)/(1+x^2), x = 0 .. alpha))/Pi), Mean = xi+omega*alpha*sqrt(2/Pi)/sqrt(1+alpha^2), Variance = omega^2*(1-2*alpha^2/(sqrt(1+alpha^2)^2*Pi)), MGF = ((x) -> 2*exp(xi*x+(1/2)*omega^2*x^2)*(1/2+(1/2)*erf((1/2)*omega*alpha*x*sqrt(2)/sqrt(1+alpha^2))))) 

I was looking for this solution, thank you!

I was looking for this solution, thank you!

Hello Markiyan! Your solution works, but how do you manipulate mu and sigma afterwards? What should I do when I will want to set mu or sigma?

For example for LogNormal distribution I would do the following:

DensityPlot(LogNormal(-.7098242994, 1.049302140))

Hello Markiyan! Your solution works, but how do you manipulate mu and sigma afterwards? What should I do when I will want to set mu or sigma?

For example for LogNormal distribution I would do the following:

DensityPlot(LogNormal(-.7098242994, 1.049302140))

Page 1 of 1