Learn R Programming

hdtg (version 0.3.3)

Generate Samples from Multivariate Truncated Normal Distributions

Description

Efficient sampling from high-dimensional truncated Gaussian distributions, or multivariate truncated normal (MTN). Techniques include zigzag Hamiltonian Monte Carlo as in Akihiko Nishimura, Zhenyu Zhang and Marc A. Suchard (2024) , and harmonic Monte Carlo in Ari Pakman and Liam Paninski (2014) .

Copy Link

Version

Install

install.packages('hdtg')

Monthly Downloads

252

Version

0.3.3

License

MIT + file LICENSE

Maintainer

Zhenyu Zhang

Last Published

January 26th, 2026

Functions in hdtg (0.3.3)

harmonicHMC

Sample from a truncated Gaussian distribution with the harmonic HMC
drawLaplaceMomentum

Draw a random Laplace momentum
createNutsEngine

Create a Zigzag-NUTS engine object
markovianZigzag

Markovian Zigzag Sampler
cholesky

Efficient Cholesky decomposition
getInitialPosition

Get an eligible initial value for a MTN with given mean and truncations
getZigzagSample

Draw one MTN sample with Zigzag-HMC or Zigzag-NUTS
getHarmonicSample

One-step Harmonic HMC Sampler (Whitened Coordinates)
createEngine

Create a Zigzag-HMC engine object
getMarkovianZigzagSample

Draw one Markovian zigzag sample
zigzagHMC

Sample from a truncated Gaussian distribution
setMean

Set the mean for the target MTN
setPrecision

Set the precision matrix for the target MTN