7
$\begingroup$

I am fitting a gaussian mixture to financial data. My mixture density is given by:

$f(l)=πϕ(l;μ_1,σ^2_1)+(1−π)ϕ(l;μ_2,σ_2^2)$

I calculated the skewness of the data already. Now, I want to look at the skewness of the fitted gaussian mixture. Since I used ML (EM algorithm) and not method of moments, the moments will not be the same. I know this. But I don't know how to calculate the skewness of the mixed gaussian? I want to have a theoretical derived formula, so I mean, I don't want to calculate this empirical by taking the fitted values and do e.g. skew(...) in R. I will do this to control myself, but first I want to have the theoretical formula for it. I could not find it (I googled for skewness mixture density and so.)

I know that the the skewness is given by

$ \gamma_1 = \operatorname{E}\Big[\big(\tfrac{X-\mu}{\sigma}\big)^{\!3}\, \Big] = \frac{\mu_3}{\sigma^3} = \frac{\operatorname{E}\big[(X-\mu)^3\big]}{\ \ \ ( \operatorname{E}\big[ (X-\mu)^2 \big] )^{3/2}} $

So what is the Skewness of a mixture gaussian? How can I derive it? A mathematical derivation would be great. I have estimated both densities and I have the estimates for μ and σ. I want a formula in what I can insert those values to get the skewness of the mixed density. Then I will control it empirically with skew(...) in R.

I know this for the kurtosis: kurtosis and I want to have this for skewness and - this would be great- a derivation of it?

$\endgroup$
8
  • 2
    $\begingroup$ The formulas for moments of mixture distributions are given in the statement of the question at stats.stackexchange.com/questions/54645/…. That substantially answers this one, too, given that skewnesses are rational combinations of moments as shown in the formula for $\gamma_1$. $\endgroup$
    – whuber
    Mar 30, 2013 at 15:17
  • $\begingroup$ @whuber mh, this doesn't help me much, I am not good in reading those formulas.... $\endgroup$ Mar 30, 2013 at 15:18
  • $\begingroup$ Please explain: you are asking for a formula and a theoretical derivation and that thread provides it. If there is a part of it you do not understand (or think is incorrect), then please point it out; otherwise it's impossible to know what your question really is and it will just be closed by the community. $\endgroup$
    – whuber
    Mar 30, 2013 at 15:19
  • $\begingroup$ I want to have a formula for the skewness like I have for the kurtosis above in my question @whuber I want to plug in my estimators and get the skewness. $\endgroup$ Mar 30, 2013 at 15:20
  • $\begingroup$ And using either the formulas in that thread or the one given by @Triple roast here, in conjunction with formulas you have already presented in your question, you have a plug-in solution. $\endgroup$
    – whuber
    Mar 30, 2013 at 15:21

2 Answers 2

8
$\begingroup$

Skewness is a vague concept which allows its formalisation in several ways. The most popular measure of skewness is the one you mention, which was proposed more than 100 years ago. However, there are better (more interpretable) measures nowdays.

It has been largely discussed the validity of using a measure of skewness in multimodal distributions, since its interpretation becomes unclear. This is the case of finite mixtures. If your mixture looks (or is) unimodal, then you can use this value to understand a bit how asymmetric it is.

In R, this quantity is implemented in the library moments, in the command skewness().

The moments of a mixture $X$, with density $g=\sum_{j=1}^n \pi_j f_j$ can be calculated as $E[X^k] = \sum_{j=1}^n \pi_j\int x^k f_j(x)dx$.

A numerical solution in R.

# Sampling from a 2-gaussian mixture
gaussmix <- function(n,m1,m2,s1,s2,alpha) {
    I <- runif(n)<alpha
    rnorm(n,mean=ifelse(I,m1,m2),sd=ifelse(I,s1,s2))
}

# A simulated sample
samp <- gaussmix(100000,0,0,1,1,0.5)

library(moments)
# Approximated kurtosis and skeweness using the simulated sample
skewness(samp)
kurtosis(samp)
$\endgroup$
9
  • $\begingroup$ yeah, but I don't want to do the R step first. I want to have mathematical derivation/formula for it? @Triple roast I mean, I have the ML estimates and I put them into a mathematical derived formula to get the skewness. So not the empirical solution, you know what I mean? But in your formula I cannot put in my estimates? $\endgroup$ Mar 30, 2013 at 15:10
  • $\begingroup$ Yes, please see my update. It is simple to calculate moments of a mixture, using the linearity of the expectation. Still, my first argument may be of interest. $\endgroup$ Mar 30, 2013 at 15:12
  • $\begingroup$ see my edit in my question, I have this for kurtosis and want to have a similiar formula for skewness. $\endgroup$ Mar 30, 2013 at 15:14
  • $\begingroup$ +1 The preliminary discussion and cautionary comments are on the mark. Thank you for sharing your wisdom and welcome to our site! $\endgroup$
    – whuber
    Mar 30, 2013 at 15:18
  • 3
    $\begingroup$ Thanks, @whuber. Stat, please check my update (stolen from this answer). It is numerical, but it may be of some help. Cheers. $\endgroup$ Mar 30, 2013 at 15:30
1
$\begingroup$

You can find the formula for the third moment in Frühwirth-Schnatter (2006), "Finite Mixture and Markov Switching Models", page 11:

$$\mathrm{E}\left((Y-\mu)^3 \mid \boldsymbol{\vartheta}\right)=\sum_{k=1}^K \pi_k\left(\left(\mu_k-\mu\right)^2+3 \sigma_k^2\right)\left(\mu_k-\mu\right)$$

Now for the skewness, as defined as $\mu^3/\sigma^3$, plug the formula for $\sigma^2$ found in wikipedia:

$$\sigma^2=\mathrm{E}\left((Y-\mu)^2 \mid \boldsymbol{\vartheta}\right)=\sum_{k=1}^K \pi_k(\sigma_k^2 + \mu_k^{2} )- \mu^{2} $$ where $\mu=\mathrm{E}\left(Y \mid \boldsymbol{\vartheta}\right) = \sum_{k = 1}^K \pi_k \mu_k$

Illustration

Taking the same simulation as @Triple roast, see how the theoretical moment is close to the empirical one:

# Sampling from a 2-gaussian mixture
m1 <- 1
m2 <- 1.2
s1 <- 0.4
s2 <- 0.5
alpha <- 0.4

gaussmix <- function(n) {
  I <- runif(n)<alpha
  rnorm(n,mean=ifelse(I,m1,m2),sd=ifelse(I,s1,s2))
}

# A simulated sample
samp <- gaussmix(10000000)

library(moments)

##
mu_tot <- alpha*m1+(1-alpha)*m2
c(mu_tot, mean(samp))
#> [1] 1.120000 1.119915

## variance
var_theo <- (m1^2+s1^2)*alpha+ (m2^2+s2^2)*(1-alpha) -mu_tot^2
c(var_theo, var(samp))
#> [1] 0.223600 0.223588

## skewness
third_moment <- alpha * ((m1-mu_tot)^2+3*s1^2)*(m1-mu_tot) + (1-alpha) * ((m2-mu_tot)^2+3*s2^2)*(m2-mu_tot)
skew_theo <- third_moment/var_theo^(3/2)

c(skew_theo, skewness(samp))
#> [1] 0.1189419 0.1192531

Created on 2023-09-22 with reprex v2.0.2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.