448
Comment:
|
1095
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= How do I produce random variables which follow a negative skew distribution? = Most distributions such as the exponential and log-Normal distributions are positive skewed with the mode of the distribution occurring for lower values. |
|
Line 2: | Line 5: |
= | The Gamma distribution[http://www.aiaccess.net/English/Glossaries/GlosMod/e_gm_gamma_distri.htm may be produced by summing exponential distributions.] There are two parameters, n and $$\lambda$$. n is the number of summed exponentials and $$\lambda$$ is the exponential rate. When $$\lambda$$ is very small compared to n a negative skewed version of the gamma distribution results with no upper limit. |
Line 4: | Line 8: |
Most distributions such as the exponential and log-Normal distributions are positive skewed with the model of the distribution for lower values. | The below produces two exponential random variables (n=2) with a very small $$\lambda$$ (=1/10000) in SPSS. One simulated data set produced using this macro had a skew of -1.03. {{{ define !gamma ( !pos !tokens(1) /!pos !tokens(1)). !do !i=!1 !to !2 !by 1. compute !concat(a,!i)=-(10000)*ln(rv.uniform(0,1)*10000). !doend. !enddefine. !gamma 1 2. exe. compute sum=0. exe. |
Line 7: | Line 25: |
[http://www.uib.no/people/ngbnk/kurs/notes/node31.html The Gamma distribution] which has two parameters, $$\alpha$$ and $$\beta$$ may produce negative skew where the model occurs for higher values (values > 0) when $$/alpha$$ is a lot greater than $$\beta$$. It also has no maximum value. | compute sum=-(a1+a2). exe. }}} |
How do I produce random variables which follow a negative skew distribution?
Most distributions such as the exponential and log-Normal distributions are positive skewed with the mode of the distribution occurring for lower values.
The Gamma distribution[http://www.aiaccess.net/English/Glossaries/GlosMod/e_gm_gamma_distri.htm may be produced by summing exponential distributions.] There are two parameters, n and $$\lambda$$. n is the number of summed exponentials and $$\lambda$$ is the exponential rate. When $$\lambda$$ is very small compared to n a negative skewed version of the gamma distribution results with no upper limit.
The below produces two exponential random variables (n=2) with a very small $$\lambda$$ (=1/10000) in SPSS. One simulated data set produced using this macro had a skew of -1.03.
define !gamma ( !pos !tokens(1) /!pos !tokens(1)). !do !i=!1 !to !2 !by 1. compute !concat(a,!i)=-(10000)*ln(rv.uniform(0,1)*10000). !doend. !enddefine. !gamma 1 2. exe. compute sum=0. exe. compute sum=-(a1+a2). exe.