hmc: Hamiltonian Monte Carlo (HMC) sampling

Description Usage Arguments Value

View source: R/hmc.R

Description

Hamiltonian Monte Carlo (HMC) sampling

Usage

1
hmc(log_prob, hamiltonian, x0 = c(0, 0), iter = 100, step_size = 0.1)

Arguments

log_prob

a function that takes input theta and returns a value that is proportional to the log probability density at theta

hamiltonian

a function that takes as input the location and momentum and returns their time derivatives

x0

initial value

iter

number of iterations

step_size

leapfrog step size

Value

a list


jtimonen/mc2 documentation built on Jan. 20, 2020, 10:37 a.m.