Learn R Programming

hdtg (version 0.3.4)

drawLaplaceMomentum: Draw a random Laplace momentum

Description

Generate a d-dimensional momentum where the density of each element is proportional to exp(-|pi|).

Usage

drawLaplaceMomentum(d)

Value

a d-dimensional Laplace-distributed momentum.

Arguments

d

dimension of the momentum.

See Also

zigzagHMC()

Examples

Run this code
# Draw a 3-dimensional Laplace momentum with reproducible results
set.seed(3)
momentum <- drawLaplaceMomentum(3)
momentum

Run the code above in your browser using DataLab