biogeme.bayesian_estimation.sampling_strategy module¶
Defines the strategy for sampling the MCMC based on hardware configuration and user’s preferences.
Michel Bierlaire Mon Oct 27 2025, 17:01:13
- class biogeme.bayesian_estimation.sampling_strategy.SamplingConfig(backend, chain_method, cores, target_accept, init, max_treedepth, nuts_kwargs)[source]¶
Bases:
object- Parameters:
backend (str)
chain_method (str | None)
cores (int | None)
target_accept (float)
init (str | None)
max_treedepth (int | None)
nuts_kwargs (dict[str, Any] | None)
-
backend:
str¶
-
chain_method:
str|None¶
-
cores:
int|None¶
-
init:
str|None¶
-
max_treedepth:
int|None¶
-
nuts_kwargs:
dict[str,Any] |None¶
-
target_accept:
float¶
- biogeme.bayesian_estimation.sampling_strategy.make_sampling_config(strategy, target_accept)[source]¶
Create a
SamplingConfigfrom a short strategy string.- Parameters:
strategy (str) – One of
'automatic','numpyro-parallel','numpyro-vectorized', or'pymc'.target_accept (float) – Target acceptance rate.
- Returns:
A ready-to-use configuration object.
- Return type:
- Raises:
ValueError – If
strategyis not one of the allowed values.