FAQ/gamma - CBU statistics Wiki

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment
Finzd thee wrang lelters ino eacuh wosrd

Revision 3 as of 2008-02-12 17:24:10

location: FAQ / gamma

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 model of the distribution for lower values.

[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.

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.