Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: invgammap


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   "Carlo Lazzaro" <carlo.lazzaro@tin.it>, <statalist@hsphsun2.harvard.edu>
Subject   RE: st: invgammap
Date   Tue, 8 May 2007 17:12:43 +0100

Yulia's slip consists only of including the word 
"inverse" in her first sentence. Delete it and all is fine. 

Her code is just what I would have recommended
had she not replied first. Examples can be found embedded
in -qgamma- and -pgamma- on SSC (which may be
of interest to you). See also -gammafit- on SSC. 

As was mentioned some months ago, I have various 
routines for fitting and plotting the inverse gamma, 
but they are not yet in the public domain. 

Nick 
n.j.cox@durham.ac.uk 

Carlo Lazzaro

> Dear Yulia & Nick,
> 
> thanks a lot for Your Kind hints and for Your time.
> 
> PS Please, may I Kindly ask You to explain what does Yulia's 
> slip mean?

Nick Cox
 
> Small correction: 
> 
> The distribution concerned here is the _gamma_ distribution. 
> 
> Its quantile function is obtained as here from the -invgammap()-
> function. 
> 
> There is another distribution, the inverse gamma, which 
> is distinct. It is also known as the reciprocal gamma, Vinci
> or Pearson Type V distribution. 
> 
> Yulia's slip arises because the word "inverse" is 
> overloaded. 
> 
> In one sense, "inverse" has the sense of
> "inverse function". This is the case with the quantile function
> which is, the inverse of the (cumulative) distribution function. 
> The prefix "inv" in -invgammap()- is there for this reason. 
> 
> In another sense, "inverse" has the sense of "reciprocal". 
> Thus, the inverse gamma is so-called because (for example)
> y is distributed as an inverse gamma if 1/y is distributed 
> as a gamma. 
> 
> Nick 
> n.j.cox@durham.ac.uk 
> 
> Yulia Marchenko, StataCorp
>  
> > Carlo Lazzaro <carlo.lazzaro@tin.it> asks about the scale 
> > parameter of the
> > inverse Gamma distribution:
> > 
> > > performing an invgammap with random probabilities
> > >
> > > generate alfa=invgammap(a,uniform())
> > >
> > > I have noticed the absence of the beta parameter of the 
> > gamma distributions.
> > > May this absence affect the results of the probabilistic 
> > invgammap function?
> > 
> > Although probability functions -gammap()- and -invgammap()- 
> > do not allow
> > specifying the scale parameter, Carlos can obtain the 
> > probabilities of the
> > Gamma distribution with shape parameter a and scale parameter 
> > beta as follows.
> > 
> >  . generate gamma = gammap(a, x/beta)
> > 
> > To obtain the inverse of the Gamma distribution with shape 
> > parameter a and
> > scale parameter beta, Carlos can use
> > 
> >  . generate x = beta*invgammap(a, gamma)
> > 
> > or, using his example,
> > 
> >  . generate alfa = beta*invgammap(a,uniform())

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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