tracts.driver_utils.get_time_scaled_model_func#

get_time_scaled_model_func(model)#

Computes a function that takes in optimizer parameters, converts them to physical parameters using the model’s parameter handler, and returns the migration matrices for those parameters. This is necessary because some optimizers may require parameters to be on a different scale (e.g. log scale) than the physical parameters used in the model, so this function serves as a wrapper to apply the necessary transformations before passing parameters to the model.

Parameters:

model (ParametrizedDemography) – The demographic model for which to compute the migration matrices.

Returns:

A function that takes in optimizer parameters, converts them to physical parameters, and returns the migration matrices for those parameters.

Return type:

Callable[[ndarray], dict[str, ndarray]]