tracts.driver_utils.get_predicted_ancestry_proportions#

get_predicted_ancestry_proportions(demographic_model, model_func, optimal_params)#

Computes and logs the predicted ancestry proportions for the optimal parameters.

Parameters:
  • demographic_model (ParametrizedDemography | ParametrizedDemographySexBiased) – The demographic model for which to compute the predicted ancestry proportions.

  • model_func (Callable[[ndarray], dict[str, ndarray]]) – A function that takes in optimizer parameters and returns the migration matrices for those parameters.

  • optimal_params (ndarray) – The final optimal parameters in optimizer units, as returned by the optimization process.

Returns:

A tuple containing the predicted autosome proportions and predicted allosome proportions, respectively. Each is an array of proportions corresponding to the populations in the model. If no autosomal or allosomal proportions are predicted, the corresponding value in the tuple will be None.

Return type:

tuple[np.ndarray | None, np.ndarray | None]