biogeme.likelihood.bootstrap module

biogeme.likelihood.bootstrap.bootstrap(number_of_bootstrap_samples, the_algorithm, modeling_elements, parameters, starting_values, second_derivatives_mode, numerically_safe, use_jit, number_of_jobs)[source]

Perform bootstrap estimation to assess the variability of model parameters.

This function generates a specified number of bootstrap samples from the original dataset, estimates the model on each sample using the provided algorithm and parameters, and returns the collection of estimation results.

Parameters:
  • number_of_bootstrap_samples – Number of bootstrap replications to perform.

  • the_algorithm (Callable[[FunctionToMinimize, ndarray, list[tuple[float, float]], list[str], dict[str, Any] | None], OptimizationResults]) – The optimization algorithm used to estimate the model.

  • modeling_elements (ModelElements) – The components defining the model, including the database and log-likelihood expression.

  • parameters (dict[str, bool | int | float | str]) – Configuration parameters used during estimation.

  • starting_values (dict[str, float]) – Dictionary of initial values for the model’s free parameters.

  • second_derivatives_mode (SecondDerivativesMode) – specifies how second derivatives are calculated.

  • numerically_safe (bool) – improves the numerical stability of the calculations.

  • use_jit (bool) – if True, performs just-in-time compilation.

  • number_of_jobs (int) – number of jobs for parallel execution of bootstrapping.

Return type:

list[AlgorithmResults]

Returns:

A list of tuples containing: - estimated parameter values (NumPy array), - diagnostic information from the optimizer (dictionary), - convergence status (boolean).