Apply a skew normal distribution to a normal distribution
196 views (last 30 days)
Show older comments
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
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?
Accepted Answer
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
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!