| createNutsEngine | R Documentation |
Create the C++ object to set up SIMD vectorization for speeding up calculations for Zigzag-NUTS ("Zigzag-NUTS engine").
createNutsEngine(
dimension,
lowerBounds,
upperBounds,
seed,
stepSize,
mean,
precision,
flags = 128L
)
dimension |
the dimension of MTN. |
lowerBounds |
a vector specifying the lower bounds. |
upperBounds |
a vector specifying the upper bounds. |
seed |
random seed. |
stepSize |
the base step size for Zigzag-NUTS. |
mean |
the mean vector. |
precision |
the precision matrix. |
flags |
which SIMD instruction set to use. 128 = SSE, 256 = AVX. |
a list whose only element is the Zigzag-NUTS engine object.
setMean(), setPrecision(), zigzagHMC(), createEngine()
# Create a Zigzag-NUTS engine for a 2D problem
dimension <- 2
lowerBounds <- c(-2, -2)
upperBounds <- c(2, 2)
stepSize <- 0.1
mean <- c(0.5, -0.5)
precision <- matrix(c(2, 0.3, 0.3, 2), nrow = 2)
nuts_engine <- createNutsEngine(dimension, lowerBounds, upperBounds,
seed = 456, stepSize, mean, precision)
str(nuts_engine)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.