Gibbs Sampling for the Vector-variate Bingham-von Mises-Fisher Distribution

Share:

Description

Simulate a random normal vector from the Bingham-von Mises-Fisher distribution using Gibbs sampling.

Usage

1
rbmf.vector.gibbs(A, c, x)

Arguments

A

a symmetric matrix.

c

a vector with the same length as x.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## The function is currently defined as
function (A, c, x) 
{
    evdA <- eigen(A)
    E <- evdA$vec
    l <- evdA$val
    y <- t(E) %*% x
    d <- t(E) %*% c
    x <- E %*% ry_bmf(y, l, d)
    x/sqrt(sum(x^2))
  }