Description Usage Arguments Details Value Note Author(s) References See Also

`dcgamma`

approximates density of a gamma shape distribution with
a gamma density. `rcgamma`

obtains random draws from the
approximation. `mcgamma`

computes approximated mean, variance and
normalization constant.

1 2 3 |

`x` |
Vector indicating the values at which to evaluate the density. |

`n` |
Number of random draws to obtain. |

`a,b,c,d,r,s` |
Parameter values. |

`newton` |
Set to |

The density of a gamma shape distribution is given by
```
C(a,b,c,d,r,s) (gamma(a*x+d)/gamma(x)^a)
(x/(r+s*x))^{a*x+d} x^{b-d-1} exp(-x*c)
```

for `x>=0`

, and 0 otherwise, where `C()`

is the normalization constant.
The gamma approximation is
`Ga(a/2+b-1/2,c+a*log(s/a))`

. The approximate normalization constant is
obtained by taking the ratio of the exact density and the
approximation at the maximum, as described in Rossell (2007).

`dcgamma`

returns a vector with approximate density.
`rcgamma`

returns a vector with draws from the approximating gamma.
`mcgamma`

returns a list with components:

`m ` |
Approximate mean |

`v ` |
Approximate variance |

`normk ` |
Approximate normalization constant |

For general values of the parameters the gamma approximation may be poor. In such a case one could use this function to obtain draws from the proposal distribution in a Metropolis-Hastings step.

David Rossell

Rossell D. GaGa: a simple and flexible hierarchical model for microarray data analysis. http://rosselldavid.googlepages.com.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.