[R] riwish() problem
Ed Merkle
merkle.14 at osu.edu
Thu Apr 28 18:39:26 CEST 2005
R users-
In moving from R 2.0.0 to R 2.1.0 in Windows, I have encountered a problem
with the "riwish" command in the package "MCMCpack". I've searched the
documentation and can't seem to figure it out. For example:
Define a matrix:
> lam <- matrix(c(.00233,-.00057,-.00057,.00190),2,2)
and then use the riwish command to generate a random inverse-Wishart variate:
> riwish(72,lam)
In version 2.1.0, the result is a matrix of very small numbers like:
[,1] [,2]
[1,] 3.323499e-05 -3.417600e-06
[2,] -3.417600e-06 2.283511e-05
In version 2.0.0, the result is a matrix of larger numbers like:
[,1] [,2]
[1,] 9.707082 2.228333
[2,] 2.228333 9.037631
This result is consistent across random variates, so I don't think that
random variability is the culprit. I suspect that the version 2.0.0 result
is correct because my larger program worked under 2.0.0 and did not work
under 2.1.0. I have loaded the coda package and VR bundle in each case. I
appreciate any and all help/tips.
-Ed Merkle
More information about the R-help
mailing list