delicatessen.estimating_equations.dose_response.ee_2p_logistic

ee_2p_logistic(theta, X, y, lower, upper)

Estimating equations for the 2-parameter logistic model (2PL). The estimating equations are

\[\begin{split}\sum_{i=1}^n \begin{bmatrix} 2 (Y_i - \hat{Y}_i) (\theta_3 - \theta_0) \frac{\theta_2}{\theta_1} \frac{\rho}{(1 + \rho)^2} \\ 2 (Y_i - \hat{Y}_i) (\theta_3 - \theta_0) \log(D_i / \theta_1) \frac{\rho}{(1 + \rho)^2} \\ \end{bmatrix} = 0\end{split}\]

where \(R_i\) is the response of individual \(i\), \(D_i\) is the dose, \(\rho = \frac{D_i}{\theta_1}^{\theta_2}\), and \(\hat{Y_i} = \theta_0 + \frac{\theta_3 - \theta_0}{1+\rho}\).

Here, theta is a 1-by-2 array for the 2PL. The first theta corresponds to the effective dose (ED50) (\(\theta_1\)), and the second corresponds to the steepness of the curve (\(\theta_2\)). The lower limit (\(\theta_0\), lower) and upper limit (\(\theta_3\), upper) are pre-specified by the user (and are no longer estimated)

Parameters
  • theta (ndarray, list, vector) – Theta in this case consists of 2 values. In general, starting values \(>0\) are better choices for the 2PL model

  • X (ndarray, list, vector) – 1-dimensional vector of n dose values.

  • y (ndarray, list, vector) – 1-dimensional vector of n response values.

  • lower (int, float) – Set value for the lower limit.

  • upper (int, float) – Set value for the upper limit.

Returns

Returns a 2-by-n NumPy array evaluated for the input theta.

Return type

array

Examples

Construction of a estimating equation(s) with ee_2p_logistic should be done similar to the following

>>> from delicatessen import MEstimator
>>> from delicatessen.data import load_inderjit
>>> from delicatessen.estimating_equations import ee_2p_logistic

For demonstration, we use dose-response data from Inderjit et al. (2002), which can be loaded from delicatessen directly.

>>> d = load_inderjit()   # Loading array of data
>>> dose_data = d[:, 1]   # Dose data
>>> resp_data = d[:, 0]   # Response data

Since there is a natural lower-bound of 0 for root growth, we set lower=0. While a natural upper bound does not exist for this example, we set upper=8 for illustrative purposes. Defining psi, or the stacked estimating equations

>>> def psi(theta):
>>>     return ee_2p_logistic(theta=theta, X=dose_data, y=resp_data,
>>>                           lower=0, upper=8)

The 2PL model and others are harder to solve compared to other estimating equations. See the advice provided in the ee_4p_logistic documentation.

>>> estr = MEstimator(psi, init=[(np.max(resp_data)+np.min(resp_data)) / 2,
>>>                              (np.max(resp_data)+np.min(resp_data)) / 2])
>>> estr.estimate(solver='lm')

Inspecting the parameter estimates, variance, and confidence intervals

>>> estr.theta
>>> estr.variance
>>> estr.confidence_intervals()

Inspecting the parameter estimates

>>> estr.theta[0]    # ED(50)
>>> estr.theta[1]    # steepness

References

Ritz C, Baty F, Streibig JC, & Gerhard D. (2015). Dose-response analysis using R. PloS One, 10(12), e0146021.

An H, Justin TL, Aubrey GB, Marron JS, & Dittmer DP. (2019). dr4pl: A Stable Convergence Algorithm for the 4 Parameter Logistic Model. R J., 11(2), 171.

Inderjit, Streibig JC, & Olofsdotter M. (2002). Joint action of phenolic acid mixtures and its significance in allelopathy research. Physiologia Plantarum, 114(3), 422-428.