Learn R Programming

hdtg (version 0.3.3)

getMarkovianZigzagSample: Draw one Markovian zigzag sample

Description

Simulate the Markovian zigzag dynamics for a given position over a specified travel time.

Usage

getMarkovianZigzagSample(position, velocity = NULL, engine, travelTime)

Value

A list containing the position and velocity after simulating the dynamics.

Arguments

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.

See Also

markovianZigzag()

Examples

Run this code
# 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

Run the code above in your browser using DataLab