[R] Sampling two exponentials
Moshe Olshansky
m_olshansky at yahoo.com
Thu Jul 31 03:52:04 CEST 2008
I am not sure that this is well defined.
For a multivariate normal distribution (which is well defined), the covariance matrix (and the means vector) fully determine the distribution. In the exponential case, what is multivariate (bivariate) exponential distribution? I believe that knowing that the two marginal distributions are exponential and knowing the covariance matrix does not uniquely determine the joint distribution.
On the other hand, if you want just any such pair, this is not difficult (at least if we want the correlation to be non-negative).
Let X and Z be independent exponential variables with lambda = 1 and let W be independent of X and Z with P(W=1) = p = 1 - P(W=0). Now let Y = X if W = 1 and Y = Z if W = 0. It is easy to see that Y is also exponential with lambda = 1 and the correlation coefficient between X and Y is p. Now multiply X and Y by appropriate constants to get the desired covariance matrix (correlation coefficient won't be affected).
--- On Thu, 31/7/08, Ben Bolker <bolker at ufl.edu> wrote:
> From: Ben Bolker <bolker at ufl.edu>
> Subject: Re: [R] Sampling two exponentials
> To: r-help at stat.math.ethz.ch
> Received: Thursday, 31 July, 2008, 10:40 AM
> Zhang Yanwei - Princeton-MRAm <YZhang <at>
> munichreamerica.com> writes:
>
> >
> > Hi all,
> > I am going to sample two variables from two
> exponential distributions, but I
> want to specify a covariance
> > structure between these two variables. Is there any
> way to do it in R? Or is
> there a "Multivariate
> > Exponential" thing corresponding to the
> multivariate normal? Thanks in advance.
> >
>
> It's not at all easy, but I'd suggest that you do
> some reading
> about copulas (and take a look at the copula package).
>
> Ben Bolker
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.
More information about the R-help
mailing list