Talk:Skew normal distribution

Creation
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?
In a standard normal distribution, the inflection points are at ±&sigma;. 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)

When you get the equation $$\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 )$$, you should not differentiate, because the equality after the differentiation holds only if this equation is an equivalence (i.e. true for all x) which is not the case. You search for those specific x values (probably two) for which this equality is true. Since the two values are unique in their small surroundings, the derivative of the two sides of this equation won't be equal. Also, as the left side doesn't have a closed form (it is an $$erf$$ function), we can't solve this equation analytically. 84.1.98.66 (talk) 23:38, 31 May 2020 (UTC)

Median/mode
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)

I don't think the approximate expression for the mode $$m_0(\alpha)$$ can be correct. For one thing, the approximation given predicts the mode to the left of $$\xi$$ for positive $$\alpha$$ so there is at least a sign error somewhere. Also, as $$\alpha\rightarrow\infty$$, the approximation do no go to zero. There is also no citation explaining where this approximation coming from.

Jt68 (talk) 12:01, 30 May 2018 (UTC)

The formula for the PDF, beneath the graphs, appears wrong
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):

—Preceding unsigned comment added by User: (talk • 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)

I agree with the current main text, but I think the factor $$\sqrt{2 \pi}$$ from the original comment is still missing from the formula under the graphs. Bmelinden (talk) 13:12, 29 August 2016 (UTC)

alpha not really in (-1,1) or is it?!
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)

Skew left vs skew right: Contradiction in text versus figure
The statement in the text that "The distribution is left skewed if α > 0 and is right skewed if α < 0" is contradicted by the probability density graph (at top right of article), which shows a heavier left tail if alpha<0. I have not taken the time to work through the math and obtain a full understanding of this distribution. But since this sentence seems to contradict the graph, I will shortly be so bold as to alter the sentence to read: "The distribution is right skewed if α > 0 and is left skewed if α < 0". My thanks to those who have developed and maintained these pages. If my changes are erroneous, please sort out the issue and make the corrections needed to bring both the text and the figure in line with the truth about the distribution. Thank you. --Presearch (talk) 22:52, 31 October 2018 (UTC)

Defining delta and gamma.
This article has a circular "definition" or absence thereof for $$\delta$$ and $$\hat{\gamma}_1$$ (sample skew? why the 1?). In the column on the right, there is a formula for $$\gamma$$ and a link to another article, but the formula involves $$\delta$$ and the linked article has no reference to either of them. There are multiple definitions of skew, so which one is $$\gamma$$ referring to? The statement maximum theoretical skewness does elude to yet another formula for $$\gamma$$, but again with no references or formality.

In its current state, trying to compute alpha for any real data set is not possible. — Preceding unsigned comment added by 2001:14BA:5054:D300:D09C:99DD:9096:8C3 (talk) 09:32, 21 February 2022 (UTC)