pearl.calculations

Module for simple function calculations used in PEARL.

Functions

calculate_prob(pop, coeffs)

Calculate and return a numpy array of individual probabilities from logistic regression given the population and coefficient matrices.

pearl.calculations.calculate_prob(pop: pandas.DataFrame, coeffs: numpy.typing.NDArray.typing.Any) numpy.typing.NDArray.typing.Any[source]

Calculate and return a numpy array of individual probabilities from logistic regression given the population and coefficient matrices. Used for multiple logistic regression functions.

Parameters:
  • pop (pd.DataFrame) – Population Dataframe that results from calling create_mortality_in_care_pop_matrix, create_mortality_out_care_pop_matrix, create_ltfu_pop_matrix, or create_comorbidity_pop_matrix.

  • coeffs (NDArray[Any]) – Coefficients are stored in Parameters object with attribute names corresponding to the above population preparation functions.

Returns:

Result of multiplying the population by the coefficients and converting to probability.

Return type:

NDArray[Any]