Learn R Programming

rstiefel (version 1.0.1)

ry_bmf: Helper Function for Sampling a Bingham-von Mises-Fisher-distributed Vector

Description

C interface to perform a Gibbs update of y with invariant distribution proportional to exp( sum(l*y^2+y*d) with respect to the uniform measure on the sphere.

Usage

ry_bmf(y, l, d)

Arguments

y

a normal vector.

l

a vector.

d

a vector.

Value

a normal vector

References

Hoff(2009)

Examples

Run this code
# NOT RUN {
## The function is currently defined as
function (y, l, d) 
{
    .C("ry_bmf", y = as.double(y), l = as.double(l), d = as.double(d), 
        n = as.integer(length(y)))$y
  }

# }

Run the code above in your browser using DataLab