  Simulating from the multivariate truncated normal distribution (MTN) is
required in various statistical applications yet remains challenging in high
dimensions. Currently available algorithms and their implementations often fail
when the number of parameters exceeds a few hundred. To provide a general
computational tool to efficiently sample from high-dimensional MTNs, we
introduce the hdtg package that implements two state-of-the-art simulation
algorithms: harmonic Hamiltonian Monte Carlo (harmonic-HMC) and zigzag
Hamiltonian Monte Carlo (Zigzag-HMC). Both algorithms exploit analytical
solutions of the Hamiltonian dynamics under a quadratic potential energy with
hard boundary constraints, leading to rejection-free methods. We compare their
efficiencies against another state-of-the-art algorithm for MTN simulation, the
minimax tilting accept-reject sampler (MET). The run-time of these three
approaches heavily depends on the underlying multivariate normal correlation
structure. Zigzag-HMC and harmonic-HMC both achieve 100 effective samples
within 3,600 seconds across all tests with dimension ranging from 100 to 1,600,
while MET has difficulty in several high-dimensional examples. We provide
guidance on how to choose an appropriate method for a given situation and
illustrate the usage of hdtg.
