fit_burr12_sf_alt
- mdtools.functions.fit_burr12_sf_alt(xdata, ydata, ysd=None, return_valid=False, **kwargs)[source]
Fit the survival function of the Burr Type XII distribution to ydata using
scipy.optimize.curve_fit()
.The survival function of the Burr Type XII distribution is given by
\[S(t) = \frac{ 1 }{ \left[ 1 + \left( \frac{t}{\tau} \right)^\beta \right]^{\frac{d}{\beta}} }\]This function uses an alternative parameterization compared to
fit_burr12_sf()
by setting \(d = \beta \delta\). The advantage is that one can know specify bounds for \(\beta \delta\). One might want to do this, because the n-th raw moment of the Burr Type XII distribution, which is\[\langle t^n \rangle = \tau^n \frac{ \Gamma\left( \delta - \frac{n}{\beta}\right) \Gamma\left( 1 + \frac{b}{\beta}\right) }{ \Gamma(\delta) },\]only exists if \(\beta \delta > n\).
- Parameters:
xdata (
array_like
) – The independent variable where the data is measured.ydata (
array_like
) – The dependent data. Must have the same shape as xdata. Only data points with 0 < ydata <= 1 will be considered. NaN’s and infinite values will not be considered, either.ysd (
array_like
, optional) – The standard deviation of ydata. Must have the same shape as ydata.return_valid (
bool
, optional) – IfTrue
, return a boolean array of the same shape as ydata that indicates which elements of ydata meet the requirements given above.kwargs (
dict
, optional) – Additional keyword arguments (besides xdata, ydata and sigma) to parse toscipy.optimize.curve_fit()
. See there for possible options. By default, absolute_sigma is set toTrue
, p0 is set to[tau_init, 1, 1 + tol_d]
and bounds is set to([0, 0, 1 + tol_d], [np.inf, 1, 2 + tol_d])
wheretol_d
is set to1e-6
.tau_init
is the point at which ydata falls below \(1/2\).
- Returns:
popt (
numpy.ndarray
) – Optimal values for the parameters so that the sum of the squared residuals is minimized. The first element of popt is the optimal \(\tau\) value, the second element is the optimal \(\beta\) value, the third value is the optimal \(d\) value.perr (
numpy.ndarray
) – Standard deviation of the optimal parameters.valid (
numpy.ndarray
) – Boolean array of the same shape as ydata indicating, which elements of ydata were used for the fit. Only returned if return_valid isTrue
.
See also
mdtools.functions.fit_burr12_sf()
Fit the survival function of the Burr Type XII distribution using the original parameterization
mdtools.functions.burr12_sf_alt()
Survival function of the Burr Type XII distribution function using the alternative parameterization