climepi.epimod.fit_temperature_response#
- climepi.epimod.fit_temperature_response(*, temperature_data, trait_data, curve_type, probability=False, priors=None, step=None, thin=1, **kwargs_sample)[source]#
Fit the dependence of a parameter on temperature.
- Parameters:
temperature_data (
array-like) – Vector of temperature values for which response data are available.trait_data (
array-like) – Vector of values of the trait variable for the corresponding temperature values.curve_type (
str) – The type of curve to fit. Options are ‘quadratic’ (response = a*(T-T_min)*(T-T_max) for T_min < T < T_max, where T is temperature, and zero otherwise) and ‘briere’ (response = a*T*(T-T_min)*sqrt(T_max-T) for T_min < T < T_max, where T is temperature, and zero otherwise). In both cases, a is the scale parameter, T_min is the minimum temperature, and T_max is the maximum temperature, and normally distributed noise is assumed on the response.probability (
bool, optional) – IfTrue, the fitted curve is constrained to be between 0 and 1. Default isFalse.priors (
dict, optional) – Dictionary of priors for the parameters of the model. The keys should be the parameter names (‘scale’, ‘temperature_min’, ‘temperature_max’, and either ‘noise_std’ or ‘noise_precision’ - see description for ‘curve_type’ above) and the values should callable functions that returnpymcdistributions. Where not specified, default priors are used based on the curve type (as used by Mordecai et al., PLoS Negl Trop Dis 2017).step (
callable, optional) – A callable that returns apymcstep method for sampling. IfNone, the default step method (DEMetropolisZ) is used.thin (
int, optional) – Only keep one in everythinsamples. Default is 1 (no thinning).**kwargs_sample (
dict) – Keyword arguments to pass topymc.sample().
- Returns:
arviz.InferenceData– The posterior distribution of the fitted parameters.