fitsigmoid | R Documentation |
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.
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)
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 |
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 |
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 |
ylim |
the range of the |
xlab |
the label of the |
ylab |
the label of the |
main |
the main title of the figure. |
subdivisions |
please see the arguments for the |
rel.tol |
please see the arguments for the |
abs.tol |
please see the arguments for the |
stop.on.error |
please see the arguments for the |
keep.xy |
please see the arguments for the |
aux |
please see the arguments for the |
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.
par |
the estimates of the model parameters. |
r.sq |
the coefficient of determination between the observed and predicted |
RSS |
the residual sum of squares between the observed and predicted |
sample.size |
the number of data points used in the data fitting. |
x |
the observed |
y |
the observed |
y.pred |
the predicted |
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
or MLRFE
or MPerformanceE
.
Peijian Shi pjshi@njfu.edu.cn, Johan Gielis johan.gielis@uantwerpen.be, Brady K. Quinn Brady.Quinn@dfo-mpo.gc.ca.
Jin, J., Quinn, B.K., Shi, P. (2022) The modified Brière equation and its applications. Plants 11, 1769. \Sexpr[results=rd]{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. \Sexpr[results=rd]{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. \Sexpr[results=rd]{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. \Sexpr[results=rd]{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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/nyas.14862")}
areaovate
, MbetaE
, MBriereE
, MLRFE
,
MPerformanceE
, sigmoid
# The shrimp growth data(See the supplementary table in West et al., 2001)
# West, G.B., Brown, J.H., Enquist, B.J. (2001) A general model for ontogenetic growth.
# Nature 413, 628-631.
t0 <- c(3, 60, 90, 120, 150, 180, 384)
m0 <- c(0.001, 0.005, 0.018, 0.037, 0.06, 0.067, 0.07)
dev.new()
plot( t0, m0, cex.lab=1.5, cex.axis=1.5, col=4,
xlab=expression(italic(x)), ylab=expression(italic(y)) )
xopt0 <- seq(100, 150, by=5)
ini.val <- list(0.035, xopt0, 200, 1)
resu1 <- fitsigmoid(MLRFE, x=t0, y=m0, ini.val=ini.val, simpver=1, fig.opt=TRUE, par.list=TRUE)
xopt0 <- seq(100, 150, by=5)
ini.val <- list(0.035, xopt0, 200, 1)
resu1 <- fitsigmoid(MbetaE, x=t0, y=m0, ini.val=ini.val, simpver=1, fig.opt=TRUE)
m.ini <- c(0.5, 1, 2, 3, 4, 5, 10, 20)
ini.val <- list(1e-8, m.ini, 200, 1)
resu2 <- fitsigmoid(MBriereE, x=t0, y=m0, ini.val=ini.val, simpver=1,
fig.opt=TRUE, control=list(reltol=1e-20, maxit=20000, trace=FALSE),
subdivisions=100L, rel.tol=.Machine$double.eps^0.25,
abs.tol=.Machine$double.eps^0.25, stop.on.error=TRUE,
keep.xy=FALSE, aux=NULL)
delta0 <- c(0.5, 1, 2, 5, 10, 20)
ini.val <- list(0.035, 150, -100, 200, delta0)
resu3 <- fitsigmoid(MLRFE, x=t0, y=m0, ini.val=ini.val, simpver=NULL,
fig.opt=TRUE, control=list(reltol=1e-20, maxit=20000),
subdivisions = 100L, rel.tol=.Machine$double.eps^0.25,
abs.tol=.Machine$double.eps^0.25, stop.on.error=TRUE,
keep.xy=FALSE, aux=NULL)
a.ini <- c(0.1, 1, 10, 100, 200)
b.ini <- 200
ini.val <- list(0.001, 0.02, 0.15, 0, 200, a.ini, b.ini)
resu4 <- fitsigmoid(MPerformanceE, x=t0, y=m0, ini.val=ini.val, simpver=NULL,
fig.opt=TRUE, control=list(reltol=1e-20, maxit=20000, trace=FALSE),
subdivisions=100L, rel.tol=.Machine$double.eps^0.25,
abs.tol=.Machine$double.eps^0.25, stop.on.error=TRUE,
keep.xy=FALSE, aux=NULL)
resu5 <- fitsigmoid(MPerformanceE, x=t0, y=m0, ini.val=resu4$par, simpver=NULL,
fig.opt=TRUE, control=list(reltol=1e-30, maxit=200000, trace=FALSE))
ini.val <- list(0.001, 0.01, c(0.1, 1, 10), 0, 200)
resu6 <- fitsigmoid(MPerformanceE, x=t0, y=m0, ini.val=ini.val, simpver=2,
fig.opt=TRUE, control=list(reltol=1e-20, maxit=20000, trace=FALSE),
subdivisions=100L, rel.tol=.Machine$double.eps^0.25,
abs.tol=.Machine$double.eps^0.25, stop.on.error=TRUE,
keep.xy=FALSE, aux=NULL)
graphics.off()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.