Description Usage Arguments Details Value Examples
Adapted from Hoffman and Gelman (2014). This function estimates step size (epsilon) for a Hamiltonian-based sampler (e.g. HMC or NUTS).
1 | estimate_epsilon(theta, logf)
|
theta |
Vector. Start position of the sampler |
logf |
Function - given theta, returns the its log probability |
This function uses the following heuristic: Starting with an epsilon of 1, do a leapfrog step with a randomly sampled momentum p ~ N(0, I). If the joint density of the new position and momentum pair is not at least half the joint density of the starting position and momentum pair, double epsilon and try again.-
Epsilon to use in a Hamiltonian sampler
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.