tracts.driver_utils.compute_physical_start_params#
- compute_physical_start_params(driver_spec, demographic_model, sex_bias_param_names, non_sex_bias_param_names, step_label='step 1')#
Computes physical starting parameters to optimize from. When
driver_spec.optim.two_steps_optimizationis True, only non-sex-bias parameters are sampled (sex-bias parameters are fixed at the midpoint of their admissible bounds – 0 with the default(-1, 1)bounds, or the midpoint of a user-narrowed range that may exclude 0, seebounds; or at any user-provided fixed value), matching step 1’s parameter subset, and identical starting points are collapsed into one (seecollapse_identical_start_params). Otherwise, all parameters are sampled/fixed according todriver_spec.optim.fix_parameters_by_valuealone.- Parameters:
driver_spec (
InferenceConfig) – The driver-file configuration controlling repetitions/seed/two_steps_optimization/ fix_parameters_by_value.demographic_model (
ParametrizedDemography|ParametrizedDemographySexBiased) – The demographic model to sample starting parameters for.sex_bias_param_names (
list[str]) – Names of the sex-bias parameters among the demographic model’s free base parameters.non_sex_bias_param_names (
list[str]) – Names of the non-sex-bias parameters among the demographic model’s free base parameters.step_label (
str) – Label used when collapsing identical two-step starting parameters into one. Defaults to “step 1”.
- Returns:
The physical starting parameters to optimize from.
- Return type:
list[ndarray]