getHarmonicSample: One-step Harmonic HMC Sampler (Whitened Coordinates)

View source: R/harmonicHMC.R

getHarmonicSampleR Documentation

One-step Harmonic HMC Sampler (Whitened Coordinates)

Description

One-step Harmonic HMC Sampler (Whitened Coordinates)

Usage

getHarmonicSample(
  whitenedPosition,
  whitenedConstraints,
  integrationTime,
  diagnosticMode = FALSE,
  seed = NULL
)

Arguments

whitenedPosition

Position in whitened coordinates

whitenedConstraints

List from applyWhitenTransform()

integrationTime

Time for dynamics simulation

diagnosticMode

Return bounce diagnostics

seed

random seed

See Also

harmonicHMC()

Examples

# Basic usage with whitened coordinates
set.seed(123)
whitened_pos <- c(0.1, -0.2, 0.3)
# Create example whitened constraints
whitened_constraints <- list(
  direc = matrix(c(1, 0, 0, 0, 1, 0), nrow = 2, byrow = TRUE),
  direcRowNormSq = c(1, 1),
  bound = c(-0.5, -0.5)
)
result <- getHarmonicSample(
  whitenedPosition = whitened_pos,
  whitenedConstraints = whitened_constraints,
  integrationTime = pi/4
)
result

# With diagnostics enabled
result_diag <- getHarmonicSample(
  whitenedPosition = whitened_pos,
  whitenedConstraints = whitened_constraints,
  integrationTime = pi/4,
  diagnosticMode = TRUE
)
str(result_diag)

hdtg documentation built on Jan. 26, 2026, 9:06 a.m.

Related to getHarmonicSample in hdtg...