rbmf.vector.gibbs: Gibbs Sampling for the Vector-variate Bingham-von...

Description Usage Arguments Value Note Author(s) References Examples

View source: R/rbmf.vector.gibbs.R

Description

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

Usage

1

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))
  }

pdhoff/rstiefel documentation built on June 16, 2021, 5:36 p.m.