Diff for "FAQ/gamma" - CBU statistics Wiki
location: Diff for "FAQ/gamma"
Differences between revisions 3 and 14 (spanning 11 versions)
Revision 3 as of 2008-02-12 17:24:10
Size: 859
Editor: PeterWatson
Comment:
Revision 14 as of 2008-02-13 10:49:57
Size: 689
Editor: PeterWatson
Comment:
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? = = How do I produce random variables which follow a negatively skewed distribution? =
Line 3: Line 3:
Most distributions such as the exponential and log-Normal distributions are positively skewed with the mode of the distribution occurring for lower values.
Line 4: Line 5:
Most distributions such as the exponential and log-Normal distributions are positive skewed with the model of the distribution for lower values. The Weibull distribution is negatively skewed and may be generated [http://www.taygeta.com/random/weibull.xml using random variables which are uniform on the interval [0,1]]

The below produces an open ended negatively skewed weibull distribution with parameters, 2 and 20. It has a median of

$$
2^text{-0.05}((ln(2)^text{0.05})) = \mbox{approx. 0.95.}
$$
Line 7: Line 14:
[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.

The below produces negatively skewed data with no upper bound.
Line 12: Line 15:
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).
compute wrv= (-(1/2)*(ln(1-rv.uniform(0,1))))**(0.05).

How do I produce random variables which follow a negatively skewed distribution?

Most distributions such as the exponential and log-Normal distributions are positively skewed with the mode of the distribution occurring for lower values.

The Weibull distribution is negatively skewed and may be generated [http://www.taygeta.com/random/weibull.xml using random variables which are uniform on the interval [0,1]]

The below produces an open ended negatively skewed weibull distribution with parameters, 2 and 20. It has a median of

$$ 2text{-0.05}((ln(2)text{0.05})) = \mbox{approx. 0.95.} $$

compute wrv= (-(1/2)*(ln(1-rv.uniform(0,1))))**(0.05).
exe.

None: FAQ/gamma (last edited 2013-03-08 10:17:36 by localhost)