Apply a skew normal distribution to a normal distribution

196 views (last 30 days)
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 Comment
Image Analyst
Image Analyst on 22 Oct 2015
Edited: Image Analyst on 22 Oct 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?

Sign in to comment.

Accepted Answer

Thorsten
Thorsten on 22 Oct 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 Comments
UCStudentHon
UCStudentHon on 23 Oct 2015
Wonderful, thank you Thorsten, this is exactly what I needed to point me in the right direction. Cheers
Thorsten
Thorsten on 23 Oct 2015
Fine. Please be so kind to formally accept my answer.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!