Data-Fitting Function for the Sigmoid Growth Equation
Data-Fitting Function for the Sigmoid Growth Equation
fitsigmoid is used to estimate the parameters of a sigmoid growth equation based on the integral of a performance equation or one of its simplified versions.
UTF-8
fitsigmoid(expr, x, y, ini.val, simpver =1, control = list(), par.list =FALSE, fig.opt =FALSE, xlim =NULL, ylim =NULL, xlab =NULL, ylab =NULL, main =NULL, subdivisions =100L, rel.tol = .Machine$double.eps^0.25, abs.tol = rel.tol, stop.on.error =TRUE, keep.xy =FALSE, aux =NULL)
Arguments
expr: a performance equation or one of its simplified versions that is used to build a sigmoid growth equation.
x: the observed investigation times.
y: the observed y values (i.e., biomass, height, body length, etc.).
ini.val: the initial values of the model parameters.
simpver: an optional argument to use the simplified version of the performance equation.
control: the list of control parameters for using the optim function in package stats.
par.list: the option of showing the list of parameters on the screen.
fig.opt: an optional argument to draw the observations and the predicted sigmoid curve.
xlim: the range of the x-axis over which to plot a sigmoid growth curve.
ylim: the range of the y-axis over which to plot a sigmoid growth curve.
xlab: the label of the x-axis when showing a sigmoid growth curve.
ylab: the label of the y-axis when showing a sigmoid growth curve.
main: the main title of the figure.
subdivisions: please see the arguments for the integrate function in package stats.
rel.tol: please see the arguments for the integrate function in package stats.
abs.tol: please see the arguments for the integrate function in package stats.
stop.on.error: please see the arguments for the integrate function in package stats.
keep.xy: please see the arguments for the integrate function in package stats.
aux: please see the arguments for the integrate function in package stats.
Details
Here, ini.val only includes the initial values of the model parameters as a list. The Nelder-Mead algorithm (Nelder and Mead, 1965) is used to carry out the optimization of minimizing the residual sum of squares (RSS) between the observed and predicted y values. The optim
function in package stats was used to carry out the Nelder-Mead algorithm. The performance equations denote MbetaE, MBriereE, MLRFE, MPerformanceE and their simplified versions. The arguments of P and simpver should correspond to expr (i.e., MbetaE or MBriereE
or MLRFE or MPerformanceE). The sigmoid equation is the integral of a performance equation or one of its simplified versions.
Returns
par: the estimates of the model parameters.
r.sq: the coefficient of determination between the observed and predicted y values.
RSS: the residual sum of squares between the observed and predicted y values.
sample.size: the number of data points used in the data fitting.
x: the observed x values.
y: the observed y values.
y.pred: the predicted y values.
Note
Here, the user can define other performance equations, but new equations or their simplified versions should include the lower and upper thresholds on the x-axis corresponding to y=0, whose indices should be the same as those in MbetaE or MBriereE
Jin, J., Quinn, B.K., Shi, P. (2022) The modified Brière equation and its applications. Plants 11, 1769. tools:::Rd_expr_doi("10.3390/plants11131769")
Lian, M., Shi, P., Zhang, L., Yao, W., Gielis, J., Niklas, K.J. (2023) A generalized performance equation and its application in measuring the Gini index of leaf size inequality. Trees − Structure and Function 37, 1555−1565. tools:::Rd_expr_doi("10.1007/s00468-023-02448-8")
Nelder, J.A., Mead, R. (1965) A simplex method for function minimization. Computer Journal 7, 308−313. tools:::Rd_expr_doi("10.1093/comjnl/7.4.308")
Shi, P., Fan, M., Ratkowsky, D.A., Huang, J., Wu, H., Chen, L., Fang, S., Zhang, C. (2017) Comparison of two ontogenetic growth equations for animals and plants. Ecological Modelling 349, 1−10. tools:::Rd_expr_doi("10.1016/j.ecolmodel.2017.01.012")
Shi, P., Gielis, J., Quinn, B.K., Niklas, K.J., Ratkowsky, D.A., Schrader, J., Ruan, H., Wang, L., Niinemets, Ü. (2022) 'biogeom': An R package for simulating and fitting natural shapes. Annals of the New York Academy of Sciences 1516, 123−134. tools:::Rd_expr_doi("10.1111/nyas.14862")