profile_jax: Profile native JAX formula evaluation

View source: R/results.R

profile_jaxR Documentation

Profile native JAX formula evaluation

Description

The complete expression tree is compiled once, then native Biogeme's CompiledFormulaEvaluator is used for each requested evaluation mode. Each mode is evaluated twice, matching the native profiling example's first call and steady-state measurements. Only ordinary environment and timing summaries cross back to R.

Usage

profile_jax(
  model,
  beta_values = NULL,
  cases = list(
    list(
      label = "Function only", gradient = FALSE, hessian = FALSE, bhhh = FALSE
    ),
    list(
      label = "Function + gradient", gradient = TRUE, hessian = FALSE, bhhh = FALSE
    ),
    list(
      label = "Function + gradient + Hessian",
      gradient = TRUE, hessian = TRUE, bhhh = FALSE
    ),
    list(
      label = "Function + gradient + BHHH",
      gradient = TRUE, hessian = FALSE, bhhh = TRUE
    )
  ),
  model_name = "rbiogeme_model",
  controls = list(),
  numerically_safe = FALSE,
  control = NULL
)

Arguments

model

A biogeme_model.

beta_values

Named finite numeric vector of parameter values. If NULL, model starting values are used.

cases

A non-empty list of named case lists. Each case has a non-empty label and optional logical gradient, hessian, and bhhh flags.

model_name

Native Biogeme model name.

controls

Named native Biogeme controls.

numerically_safe

Whether native formula evaluation uses numerical-safety transformations.

control

Optional biogeme_control() object; an alias for controls.

Details

Timing values depend on the active Python, JAX, hardware, and thread configuration. The operation is a profiling diagnostic, not an estimation operation.

Value

An object of class biogeme_jax_profile containing the native JAX environment and serialized profile data for each case.

See Also

biogeme_control


rbiogeme documentation built on Sept. 29, 2026, 5:09 p.m.