View source: R/zigzagMarkovian.R
| getMarkovianZigzagSample | R Documentation |
Simulate the Markovian zigzag dynamics for a given position over a specified travel time.
getMarkovianZigzagSample(position, velocity = NULL, engine, travelTime)
position |
a d-dimensional position vector. |
velocity |
optional d-dimensional velocity vector. If NULL, it will be generated within the function. |
engine |
an object representing the Markovian zigzag engine, typically containing settings and state required for the simulation. |
travelTime |
the duration for which the dynamics are simulated. |
A list containing the position and velocity after simulating the dynamics.
markovianZigzag()
# First create an engine
set.seed(123)
engine <- createEngine(
dimension = 2,
lowerBounds = c(-1, -1),
upperBounds = c(1, 1),
seed = 123,
mean = c(0, 0),
precision = diag(2)
)
# Draw a single Markovian zigzag sample
position <- c(0.1, -0.2)
travel_time <- 0.5
sample_result <- getMarkovianZigzagSample(
position = position,
engine = engine,
travelTime = travel_time
)
sample_result
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.