Apply a skew normal distribution to a normal distribution

57 visualizaciones (últimos 30 días)
UCStudentHon
UCStudentHon el 22 de Oct. de 2015
Comentada: Thorsten el 23 de Oct. de 2015
Hi All,
I am trying to apply a skew normal distribution to a graph, at the moment I have a perfect shaped bell curve as seen here,
The center of the curve is at 250, if I wanted to skew the graph slightly to right(at a number of my choosing, as in I can input where I want the peak to be) while maintaining the height, how would I go about it, I believe that under the section 'Definition' of this link https://en.wikipedia.org/wiki/Skew_normal_distribution contains the answer but I have been unable to successfully implement it,
Thanks,
P.S. These are the lines of code that create the graph
x=linspace(0,dimensions(1),dimensions(1)+1);
y = gaussheight.*exp(-(((x-pPressureElipse(4))./xrad).^2));
  1 comentario
Image Analyst
Image Analyst el 22 de Oct. de 2015
Editada: Image Analyst el 22 de Oct. de 2015
The formula you gave in your code is a simple shifting of a non-skewed Gaussian. I've never heard of that other distribution, described in Wikipedia. It looks complicated. What do you need it for? Why not use a log normal, which is like a skewed Gaussian and is very common and well known. There are even functions in the Statistics and Machine Learning toolbox that specifically work with log normal distributions. Can you use log-normal instead of that strange function you're trying to use?

Iniciar sesión para comentar.

Respuesta aceptada

Thorsten
Thorsten el 22 de Oct. de 2015
gaussian = @(x) (1/sqrt((2*pi))*exp(-x.^2/2))
skewedgaussian = @(x,alpha) 2*gaussian(x).*normcdf(alpha*x)
plot(x, gaussian(x))
hold on
plot(x, skewedgaussian(x, 4))
plot(x, skewedgaussian(x, -4))
plot(x, skewedgaussian(x, 1))
plot(x, skewedgaussian(x, -1))
  2 comentarios
UCStudentHon
UCStudentHon el 23 de Oct. de 2015
Wonderful, thank you Thorsten, this is exactly what I needed to point me in the right direction. Cheers
Thorsten
Thorsten el 23 de Oct. de 2015
Fine. Please be so kind to formally accept my answer.

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by