climepi.epimod.get_posterior_temperature_response#

climepi.epimod.get_posterior_temperature_response(idata, *, curve_type, num_samples=None, temperature_vals=None, probability=False, trait_name=None, trait_attrs=None)[source]#

Get the posterior distribution of the fitted temperature response.

Parameters:
  • idata (arviz.InferenceData) – The posterior distribution of the fitted parameters (as returned by climepi.epimod.fit_temperature_response()).

  • curve_type (str) – The type of curve fitted. Options are ‘quadratic’ and ‘briere’.

  • num_samples (int, optional) – Number of samples to draw from the posterior distribution. If None, all samples are used.

  • temperature_vals (array-like, optional) – Vector of temperature values for which the response is to be computed. If not provided, a default range is generated based on the minimum and maximum temperature values in the posterior distribution.

  • probability (bool, optional) – If True, the response is constrained to be between 0 and 1. Default is False.

  • trait_name (str, optional) – The name of the trait variable. If None, the response variable is named ‘response’.

  • trait_attrs (dict, optional) – Additional attributes to assign to the trait variable in the returned dataset. If None, no additional attributes are assigned.

Returns:

xarray.DataArray – The posterior distribution of the fitted temperature response, with dimensions ‘temperature’ and ‘sample’.