[R] Does R have an inverse wishart distribution?
Ben Bolker
ben at zoo.ufl.edu
Tue Apr 1 15:13:56 CEST 2003
[Forwarding to R-list as well just so the answer ends up archived
there.]
Actually, now that I look again, there's actually a package already on
CRAN (MCMCpack) that looks like it will do what you want --
has random draws and PDF for wishart and inverse-wishart. It might have
other useful components as well.
The only thing I might conceivably have that would go beyond this is
that the most common algorithm for generating random wishart distributions
requires that the degrees of freedom be greater than the size (number of
rows/columns) of the variance-covariance matrix; I coded an alternative
algorithm without that restriction (from a Springer book by Gentle).
Let me know if you need it, good luck.
Ben
On Mon, 31 Mar 2003, Kevin Karty wrote:
>
> I do in fact mean to sample from it. Pretty much a basic MCMC using a
> Metropolis Hastings algorithm. I was unable to find any reference to
> either of these in the help docs. In particular, am writing a
> hierarchical bayesian multinomial logit application with a mult. Normal
> distribution of coefficients at higher level, so if you know of any
> canned algorithms, that would work as well. Otherwise, I might be able
> to do some QA work for you. :)
>
>
> -Kevin
>
>
> -----Original Message-----
> From: Ben Bolker [mailto:ben at zoo.ufl.edu]
> Sent: Monday, March 31, 2003 3:25 PM
> To: Kevin Karty
> Cc: r-help at stat.math.ethz.ch
> Subject: Re: [R] Does R have an inverse wishart distribution?
>
>
>
> Do you want to simulate from it?
> If so, I could send you various bits of code (some sent by Bill
> Venables
> to the S-PLUS help list long ago), which I would eventually mean to
> package and put up.
>
> I don't have any code for calculating probability densities (or
> cumulative distribution functions, or quantiles).
>
> Ben Bolker
>
> On Mon, 31 Mar 2003, Kevin Karty wrote:
>
> >
> >
> > If so, I've had trouble finding it. Can anyone help?
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> >
>
>
--
318 Carr Hall bolker at zoo.ufl.edu
Zoology Department, University of Florida http://www.zoo.ufl.edu/bolker
Box 118525 (ph) 352-392-5697
Gainesville, FL 32611-8525 (fax) 352-392-3704
More information about the R-help
mailing list