Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Multivariate "mixed" distribution

From   n p <[email protected]>
To   [email protected]
Subject   Re: st: RE: Multivariate "mixed" distribution
Date   Tue, 2 Nov 2004 02:45:31 -0800 (PST)

Yesterday I asked for advice on generating a sample
from a multi(5)variate distribution with a given
covariance structure with 4 of the 5 variables having
a normal distribution and the 5th having a Gumbel
distribution. Roy W. Haas gave me the following

> You can always use the following two-step process.
> Let X be the (standard) normal variable that you
> want to change the marginal distribution of. Then
> U=F(X), where F() is the standard normal cdf, has a
> uniform distribution. Then Y=G*(U) has the
> cumulative distribution G(), where G* is the inverse
> function of G. You may have to approximate the
> covariance between Y and the other marginals by a
> series expansion or similar device, but you now have
> the desired marginal distribution.

Here's my interpretation of Roy's advice ("sigma" is
the target var-cov matrix) :

*****START oF CODE*****************
mat corsigma=corr(sigma)
drawnorm z1 z2 z3 z4 z5,corr(corsigma)
gen u5=norm(z5) /*transformation to uniform*/
gen g=log(log(1/(1-u5))) /*transformation to Gumbel
with parameters a=0 and b=1*/
mat diagsigma=vecdiag(sigma)
gen a0i=z1*sqrt(diagsigma[1,1])
gen a1i=z2*sqrt(diagsigma[1,2])
gen b0i=z3*sqrt(diagsigma[1,3])
gen b1i=z4*sqrt(diagsigma[1,4])
gen c0i=g*sqrt(diagsigma[1,5])/sqrt(1.645)
/* 1.645 is the variance of a Gumbel(0,1)*/
**************END OF CODE***********************

This method seems to work OK. If Roy or someone else
wants to comment on this is wellcome.

Thanks again Roy.

Nikos Pantazis 

Do you Yahoo!? 
Check out the new Yahoo! Front Page. 

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index