phmc_tune: Hyperparameter Tuning for Moreau-Yosida Regularization...

View source: R/tune.R

phmc_tuneR Documentation

Hyperparameter Tuning for Moreau-Yosida Regularization Parameter

Description

Evaluates the relative Hamiltonian error metric across a grid of candidate lambda_g values to select the optimal regularization parameter balancing potential smoothness and Hamiltonian conservation, as detailed in Section V of Shukla, Vats, and Chi (2025).

Usage

phmc_tune(
  fn,
  grad_f = NULL,
  g = NULL,
  prox_fn = "l1",
  start,
  lambda_grid = 10^seq(-5, 0, length.out = 15),
  epsilon = 0.001,
  L = 10,
  M = NULL,
  target_rel_err = 1e-04,
  data = NULL,
  seed = NULL,
  ...
)

Arguments

fn

Function. Smooth component f(x) of the potential. Must accept parameter vector as first argument.

grad_f

Function or NULL. Analytical gradient of f(x). If NULL, finite differences are used.

g

Function or NULL. Non-smooth component g(x).

prox_fn

Function or character. Proximal operator or built-in name ("l1", "l2", "nuclear_norm", "elastic_net", "none").

start

Numeric vector. Starting parameter value.

lambda_grid

Numeric vector. Grid of candidate lambda_g values to test.

epsilon

Numeric scalar > 0. Leapfrog step size.

L

Integer >= 1. Number of leapfrog steps.

M

Mass matrix or NULL (defaults to identity matrix).

target_rel_err

Numeric scalar. Maximum acceptable relative Hamiltonian error (default 1e-4).

data

Optional dataset passed as second argument to fn and grad_f.

seed

Optional integer or NULL. Random seed to set conditionally for reproducible initial momentum sampling. Default is NULL.

...

Additional arguments forwarded to fn, grad_f, or prox_fn.

Details

The relative Hamiltonian error metric is defined as

R_{\lambda_g} = \left| \frac{H(x_0, p_0) - H(\tilde{T}_{\epsilon, L}^{\lambda_g}(x_0, p_0))}{H(x_0, p_0)} \right|.

Value

An object of class "phmc_tune", which is a list containing:

optimal_lambda_g

A numeric scalar of class "numeric" specifying the selected optimal Moreau-Yosida regularization parameter lambda_g that satisfies the relative Hamiltonian error threshold.

grid_results

A data frame of class "data.frame" containing tested candidate lambda_g values, computed relative Hamiltonian errors (R_lambda_g), and absolute Hamiltonian difference metrics (H_diff).

target_rel_err

A numeric scalar of class "numeric" giving the target relative Hamiltonian error threshold used during grid search tuning.

References

Shukla A, Vats D, Chi EC (2025). “Proximal Hamiltonian Monte Carlo.” arXiv preprint, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.2510.22252")}.


pHMC documentation built on Aug. 21, 2026, 5:18 p.m.

Related to phmc_tune in pHMC...