rbing.vector.gibbs {rstiefel} | R Documentation |
Gibbs Sampling for the Vector-variate Bingham Distribution
Description
Simulate a random normal vector from the Bingham distribution using Gibbs sampling.
Usage
rbing.vector.gibbs(A, x)
Arguments
A |
a symmetric matrix. |
x |
the current value of the random normal vector. |
Value
a new value of the vector x
obtained by Gibbs sampling.
Note
This provides one Gibbs scan. The function should be used iteratively.
Author(s)
Peter Hoff
References
Hoff(2009)
Examples
## The function is currently defined as
rbing.vector.gibbs <-
function(A,x)
{
#simulate from the vector bmf distribution as described in Hoff(2009)
#this is one Gibbs step, and must be used iteratively
evdA<-eigen(A,symmetric=TRUE)
E<-evdA$vec
l<-evdA$val
y<-t(E)%*%x
x<-E%*%ry_bing(y,l)
x/sqrt(sum(x^2))
#One improvement might be a rejection sampler
#based on a mixture of vector mf distributions.
#The difficulty is finding the max of the ratio.
}
[Package rstiefel version 1.0.1 Index]