Talk:Skew normal distribution

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Statistics (Rated Start-class, Low-importance)
WikiProject icon

This article is within the scope of the WikiProject Statistics, a collaborative effort to improve the coverage of statistics on Wikipedia. If you would like to participate, please visit the project page or join the discussion.

Start-Class article Start  This article has been rated as Start-Class on the quality scale.
 Low  This article has been rated as Low-importance on the importance scale.
 

Creation[edit]

I created the article on skew normal distributions today... It is highly useful empirically when you have a distribution that is skewed away from normal -- it gives you a parametric model, which can be then used for confidence intervals, hypothesis testing, etc. Velocidex (talk) 01:29, 13 March 2008 (UTC)

Nice work! I was going to ask you about the pdf... but you fixed it so fast! Josuechan (talk) 07:03, 13 March 2008 (UTC)
BTW, do you happen to know how to generate a draw from this distribution? any references? Josuechan (talk) 07:06, 13 March 2008 (UTC)
Same way you can draw from any other distribution. Check out rejection sampling. Velocidex (talk) 23:54, 2 April 2008 (UTC)

I have two remarks to the above discussion and the text of the article. (1) Random number generation: this is possible _without_ rejection of a portion of any generated values as in rejection sampling, see http://azzalini.stat.unipd.it/SN/faq-r.html (2) Early appearances of this distribution: the information provided is not appropriate, see http://azzalini.stat.unipd.it/SN/faq-h.html --147.162.23.31 (talk) 12:54, 12 March 2010 (UTC)

Inflection points?[edit]

In a standard normal distribution, the inflection points are at ±σ. Where are they in this distribution? —Ben FrantzDale (talk) 20:58, 26 August 2008 (UTC)

Reply: I have done a bit of calculating on this question (after a brief search of the literature available on the net on this distribution) and I think I'm halfway to the answer. I doubt I'll take it much further. To not have this go to waste I'm gonna give my derivation here in case someone wants to take it further.

Starting with f(x) as defined:

f(x) {{=}} 2\phi(x)\int_{-\infty}^{\alpha{x}} \phi(u)du

We need to find the f(x), set it equal to 0 and solve for x. Thus we find f'(x) which is: (by the product rule for derivatives)

f'(x) {{=}} 2\phi'(x)\int_{-\infty}^{\alpha{x}} \phi(u)du + 2\phi(x) \frac{d}{dx}\left ( \int_{-\infty}^{\alpha{x}} \phi(u)du \right )

which we can rewrite as follows using the fundamental theorem of calculus (FTC), and the fact that \phi'(x) {{=}} -x\phi \left ( x \right ):

Applying the FTC to \int_{-\infty}^{\alpha{x}} \phi(u)du proceeds as follows:

\frac{d}{dx} \left ( \int_{-\infty}^{\alpha{x}} \phi(u)du \right ) {{=}} \frac{d}{d \left ( \alpha x \right )}\frac{d \left ( \alpha x \right )}{dx} \left ( \int_{-\infty}^{\alpha{x}} \phi(u)du \right ) {{=}} \alpha \frac{d}{d \left ( \alpha x \right )} \left ( \int_{-\infty}^{\alpha{x}} \phi(u)du \right ) {{=}} \alpha \phi \left ( \alpha x \right )

[NOTE: The FTC is defined as valid over any closed interval. The integral here is defined over a right-closed interval, which seemingly precludes the application of the FTC. The part of the integral, however, has such a small value (approaching 0) that the FTC can quite validly be applied. This statement will need better qualification before it is put on the page]

f'(x) {{=}} -2x\phi(x)\int_{-\infty}^{\alpha{x}} \phi(u)du + 2\alpha\phi(x)\phi(\alpha x)

We also see that the first term can be rewritten in terms of f(x), giving:

f'(x) {{=}} -xf(x) + 2\alpha\phi(x) \phi \left ( \alpha x \right )

We now determine f"(x), again using the product rule for derivatives:

f''(x) {{=}} -f(x) - xf'(x) + 2\alpha\phi'(x) \phi \left ( \alpha x \right ) + 2\alpha\phi(x) \phi' \left ( \alpha x \right )

which we can rewrite using the chain rule for \phi \left ( \alpha x \right ):

f''(x) {{=}} -f(x) - xf'(x) - 2 \alpha x \phi(x) \phi \left ( \alpha x \right ) - 2 \alpha^3 x \phi(x) \phi \left ( \alpha x \right )

which we rewrite by substituting f'(x) as earlier computed

f''(x) {{=}} -f(x) + x^2 f(x) - 2 \alpha x \phi(x) \phi \left ( \alpha x \right ) - 2 \alpha x \phi(x) \phi \left ( \alpha x \right ) - 2 \alpha^3 x \phi(x) \phi \left ( \alpha x \right )

grouping the terms...

f''(x) {{=}} \left ( x^2 - 1 \right ) f(x) - 2 \alpha \left ( \alpha^2 + 2 \right ) \phi(x) \phi \left ( \alpha x \right ) x

setting equal to 0, we now get

\left ( x^2 - 1 \right ) f(x) - 2 \alpha \left ( \alpha^2 + 2 \right ) \phi(x) \phi \left ( \alpha x \right ) x {{=}} 0

which we can rewrite as

\left ( x^2 - 1 \right ) f(x) {{=}} 2 \alpha \left ( \alpha^2 + 2 \right ) \phi(x) \phi \left ( \alpha x \right ) x

getting f(x) alone on the left...

f(x) {{=}} 2 \alpha \left ( \alpha^2 + 2 \right ) \left ( \frac{x}{x^2 - 1} \right ) \phi(x) \phi \left ( \alpha x \right )

We now substitute f(x) from the definition, giving:

2\phi(x)\int_{-\infty}^{\alpha{x}} \phi(u)du {{=}} 2 \alpha \phi(x) \left ( \alpha^2 + 2 \right ) \left ( \frac{x}{x^2 - 1} \right ) \phi \left ( \alpha x \right )

we cancel the 2\phi \left ( x \right ) on both sides:

\int_{-\infty}^{\alpha{x}} \phi(u)du {{=}} \alpha \left ( {\alpha}^2 + 2 \right ) \left ( \frac{x}{x^2 - 1} \right ) \phi \left ( \alpha x \right )

differentiate:

\frac{d}{dx}\int_{-\infty}^{\alpha{x}} \phi(u)du {{=}} \alpha \phi \left ( \alpha x \right ) {{=}} \alpha \left ( \alpha^2 + 2 \right ) \frac{d}{dx}\left [ \left ( \frac{x}{x^2 - 1} \right ) \phi \left ( \alpha x \right ) \right ]

apply FTC and the product rule:

\alpha \phi \left ( \alpha x \right ) {{=}} \alpha \left ( {\alpha}^2 + 2 \right ) \left [ \frac{d}{dx} \left ( \frac{x}{x^2 - 1} \right ) \phi \left ( \alpha x \right ) + \left ( \frac{x}{x^2 - 1} \right ) \phi' \left ( \alpha x \right )\right ]

using the quotient rule: (and canceling a  \alpha both sides)

\phi \left ( \alpha x \right ) {{=}} \left ( {\alpha}^2 + 2 \right ) \left [ -\left ( \frac{x^2 + 1}{\left ( x^2 - 1 \right ) ^2} \right ) \phi \left ( \alpha x \right ) - \alpha^2 x \left ( \frac{x}{x^2 - 1} \right ) \phi \left ( \alpha x \right )\right ]
\phi \left ( \alpha x \right ) {{=}} -\left ( {\alpha}^2 + 2 \right ) \left [ \frac{x^2 + 1 + \alpha^2 x^2 \left ( x^2 - 1\right )}{\left ( x^2 - 1 \right ) ^2} \right ]\phi \left ( \alpha x \right )

cancel \phi \left ( \alpha x \right ) and multiply through with x^2 - 1

\left ( x^2 - 1 \right ) ^2 {{=}} -\left ( {\alpha}^2 + 2 \right )  \left ( x^2 + 1 + \alpha^2 x^2 \left ( x^2 - 1\right ) \right )

obtain an equation in x:

x^4 - 2 x^2 + 1 {{=}} -\left ( {\alpha}^2 + 2 \right )  \left ( x^2 + 1 + \alpha^2 x^4 - \alpha^2 x^2 \right )
x^4 - 2 x^2 + 1 {{=}} -\alpha^2 \left ( {\alpha}^2 + 2 \right ) x^4 + \left ( \alpha^2 - 1 \right ) \left ( {\alpha}^2 + 2 \right ) x^2  - \left ( {\alpha}^2 + 2 \right )
\left ( \alpha^2 \left ( {\alpha}^2 + 2 \right ) + 1 \right ) x^4 - \left ( \left ( \alpha^2 - 1 \right ) \left ( {\alpha}^2 + 2 \right ) + 2 \right ) x^2  + \left ( \left ( {\alpha}^2 + 2 \right ) + 1 \right ) {{=}} 0

which can be rewritten as a quadratic equation by setting  v {{=}} x^2:

\left ( \alpha^2 \left ( {\alpha}^2 + 2 \right ) + 1 \right ) v^2 - \left ( \left ( \alpha^2 - 1 \right ) \left ( {\alpha}^2 + 2 \right ) + 2 \right ) v  + \left ( \left ( {\alpha}^2 + 2 \right ) + 1 \right ) {{=}} 0

This equation in v can be solved using the quadratic formula.

This should suffice to get you close to an answer. I'm not 100% sure what I did above was correct, so CHECK IT please. I found the discriminant of the quadratic and found that it can be negative, and indeed is for the case a=0. This tells me something might be seriously wrong.

I know this is original work, so do with it what you will, I didn't put it on the main page for just that reason. --Tjips (talk) 17:50, 10 April 2010 (UTC)

Median/mode[edit]

Are the median and mode left off for a reason? Honestly I don't know a lot about this distribution but even if these are difficult to calculate for some reason it would seem important to specify them somehow.

--Mcorazao (talk) 15:05, 4 May 2010 (UTC)

As far as I can discover, there are no closed expressions for the mode and median.

I propose to add this, and that they can be computed

  • median from quantile(1/2)
  • mode by finding the maximum of the pdf

Paul A Bristow (talk) 14:43, 31 January 2012 (UTC)

The formula for the PDF, beneath the graphs, appears wrong[edit]

In the main article it says the PDF is given by:

f(x) = 2\phi(x)\Phi(\alpha x). \,

When we substitute in  (x-\xi)/\omega for x and expand this, we get:

f(x) = \sqrt{\frac{2}{\pi * \omega^2}} e^{-\frac{(x-\xi)^2}{2\omega^2}} \int_{-\infty}^{\alpha\left(\frac{x-\xi}{\omega}\right)}  \frac{ e^{-\frac{t^2}{2}}}{\sqrt{2\pi}} \,

But the formula just below the graphs show:

\frac{1}{\omega\pi} e^{-\frac{(x-\xi)^2}{2\omega^2}} \int_{-\infty}^{\alpha\left(\frac{x-\xi}{\omega}\right)}  \frac{ e^{-\frac{t^2}{2}}}{\sqrt{2\pi}}

The formula beneath the graphs needs to be multiplied by a factor of:

\sqrt{2 \pi}

Numerical methods confirm this (the following is Maxima code):

pdf(x,mu,sigma,alpha):= sqrt(2/%pi)/sigma * %e^( -(x-mu)^2/(2*sigma^2)) * quad_qagi(%e^(-t^2/2)/(sqrt(2)*sqrt(%pi)),t,minf, alpha*(x-mu)/sigma )[1];

quad_qags(pdf(x,-1,1,10),x,-20,20); —Preceding unsigned comment added by [[User:{{{1}}}|{{{1}}}]] ([[User talk:{{{1}}}|talk]] • [[Special:Contributions/{{{1}}}|contribs]])

It seems to me from numerical calculation - for a normal distribution - that there's a 1/omega factor missing in the pdf with omega and xi, i.e. it should be:
f(x) = \frac{2}{\omega} \phi\left(\frac{x-\xi}{\omega}\right)\Phi\left(\alpha \left(\frac{x-\xi}{\omega}\right)\right). \,
i get this from using 'normpdf' and 'normcdf' in octave 3.0.1. Boud (talk) 20:11, 5 October 2010 (UTC)

Agreed, a factor \frac{1}{\omega} is missing. —Preceding unsigned comment added by 84.160.163.108 (talk) 13:28, 13 October 2010 (UTC)

alpha not really in (-1,1) or is it?![edit]

I just got confused with the part that "the skewness of the distribution is limited to the interval (-1,1)". This contradicts with the plots where α has values 4 and -4 and also with information that the first external link points to, where Adelchi Azzalini writes what happens if α goes to infinity. I think that part on the page is either written in a confusing way or simply wrong. Herdtien (talk) 15:16, 11 October 2010 (UTC)

Notice, the difference between the skewness of the distribution and its shape parameter. —Preceding unsigned comment added by 84.160.163.108 (talk) 13:07, 13 October 2010 (UTC)