The nlsLM function is used instead of the
nls function in order to use the Levenberg-Marquardt
algorithm which is an extremely robust method of curve-fitting as it is
able to switch between Gauss-Newton and gradient descent. This allows it to
cope with far-off-optimal starting values. The standard nls function does
not use Levenberg-Marquardt; it instead uses the Gauss-Newton type, the
PORT routines and a partial linear fit.
# NOT RUN {tdTilia <- tdData(tilia, x = "Day", y = "Trees")
model <- timedist(data = tdTilia, x = "Day", y = "propMax", r = 0.1, c = 0.5,
t = 120)
model
# }