delicatessen.estimating_equations.dose_response.ee_3p_logistic
- ee_3p_logistic(theta, X, y, lower)
Estimating equations for the 3-parameter logistic model (3PL). The estimating equations are
\[\begin{split}\sum_{i=1}^n \begin{bmatrix} -2 (Y_i - \hat{Y}_i) (1 - 1/(1 + \rho)) \\ 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-3 array for the 3PL. The first theta corresponds to the effective dose (ED50) (\(\theta_1\)), the second corresponds to the steepness of the curve (\(\theta_2\)), and the third corresponds to the upper limit (\(\theta_3\)). The lower limit (\(\theta_0\),
lower
) is pre-specified by the user (and is no longer estimated)- Parameters
theta (ndarray, list, vector) – Theta in this case consists of 3 values. In general, starting values \(>0\) are better choices for the 3PL 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.
- Returns
Returns a 3-by-n NumPy array evaluated for the input
theta
.- Return type
array
Examples
Construction of a estimating equation(s) with
ee_3p_logistic
should be done similar to the following>>> from delicatessen import MEstimator >>> from delicatessen.data import load_inderjit >>> from delicatessen.estimating_equations import ee_3p_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
. Defining psi, or the stacked estimating equations>>> def psi(theta): >>> return ee_3p_logistic(theta=theta, X=dose_data, y=resp_data, >>> lower=0)
The 3PL 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, >>> np.max(resp_data)]) >>> 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 >>> estr.theta[2] # upper limit
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.