Re: Create independent Gamma RV with identity Covariance Matrix



In article
<ellieandrogerxyzzy-2002061631450001@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
ellieandrogerxyzzy@xxxxxxxxxxxxxxxxxxxxxx (Roger Stafford) wrote:

In article <ef29839.-1@xxxxxxxxxxxxxxxx>, "Dhiraj patil"
<ddpq4f@xxxxxxxxx> wrote:

Hi

as a part of a project , i require to generate 4-dimension Gamma RV
with Identity Covariance matrix. with m (1 by 4) and p (1 by 4)
e.g g=Gamma(m,p)

I dont know how to create such a matrix which will obey condition of
having identity covariance Matrix

Thanks
Dhiraj
--------------------
To get a covariance matrix equal to the identity matrix, all you need
are independent gamma distribution random variables to give zeros off the
diagonal and variances of one along the diagonal. The matlab statistics
toolbox function 'gamrnd' makes use of matlab's 'rand' or 'randn'
functions which automatically yield independent random variables. All you
need to do is to set up your parameters to produce a distribution with
unit variances. If you don't have that toolbox, it is easy to generate
the random variables yourself using the 'gammainc' and 'rand' functions.

You are lucky. What would be more challenging would be generating gamma
distribution random variables with prescribed non-zero off-diagonal
covariances.

Roger Stafford
---------------
I was mistaken yesterday in claiming that a gamma distribution random
variable can be generated using the 'gammainc' and 'rand' functions. To
use the 'rand' function for this purpose would require the *inverse* of
the incomplete gamma function.

(Remove "xyzzy" and ".invalid" to send me email.)
Roger Stafford
.



Relevant Pages

  • Re: Computing Pearson Type V pdf
    ... One does not need "nice identities"; just use logarithms. ... Any good computer package has the logarithm of the Gamma ... the normal approximation should do very ... simulate Gamma random variables for large shape parameters, ...
    (sci.stat.math)
  • Re: Create independent Gamma RV with identity Covariance Matrix
    ... as a part of a project, i require to generate 4-dimension Gamma RV ... To get a covariance matrix equal to the identity matrix, ... are independent gamma distribution random variables to give zeros off the ... functions which automatically yield independent random variables. ...
    (comp.soft-sys.matlab)

Loading