fitweibull {cardidates}  R Documentation 
Fit a four or sixparametric Weibull function to environmental data.
fitweibull6(x, y = NULL, p0 = NULL, linint = 1, maxit = 2000) fitweibull4(x, y = NULL, p0 = c(0.1, 50, 5, 100), linint = 1, maxit = 1000)
x, y 
the x (in day of year) and y coordinates of a set of points. Alternatively, a single argument x can be provided. 
p0 
initial parameters for optimization. In case of 
linint 
control parameter to select interpolation behavior. Negative values (default) specify automatic selection heuristic, zero disables interpolation. A positive value is interpreted as mandatory interpolation time step. 
maxit 
maximum number of iterations passed to the optimisation functions. 
Function fitweibull6
uses extensive heuristics to derive initial parameters
for the optimization. It is intended to work with data which are defined over an
interval between 0 and 365, e.g. environmental data and
especially for plankton blooms.
Please note that the function does internal transformation:
y_{rel} = y_i / y_{max}
Note that additional data points are inserted between original measurements
by linear interpolation with time step = 1 before curve fitting if the number
of original data points is too low (currently n < 35).
You can set linint = 0
to switch interpolation off.
fitweibull4
has only builtin heuristics for data interpolation but not
for guessing initial parameters which must be supplied as
vector p0
in the call.
A list with components:
p 
vector of fitted parameters, 
ymax 
maximum y value used for transformation, 
r2 
coefficient of determination between transformed and fitted y values, 
fit 
data frame with the following columns:

Note that the heuristics works optimal if unnecessary leading and trailing data are removed before the call.
Susanne Rolinski (original algorithm) and Thomas Petzoldt (package).
Maintainer: Thomas Petzoldt <thomas.petzoldt@tudresden.de>
Rolinski, S., Horn, H., Petzoldt, T., & Paul, L. (2007): Identification of cardinal dates in phytoplankton time series to enable the analysis of longterm trends. Oecologia 153, 997  1008. http://dx.doi.org/10.1007/s0044200707832.
weibull4
,
weibull6
,
CDW
peakwindow
,
cardidates
## create some test data set.seed(123) x < seq(0, 360, length = 20) y < abs(rnorm(20, mean = 1, sd = 0.1)) y[5:10] < c(2, 4, 7, 3, 4, 2) ## fit Weibull function with 6 free parameters res < fitweibull6(x, y) ## show some properties res$r2 p < res$p o < res$fit f < res$ymax ## fit 6 parameter Weibull with userprovided start parameters x < seq(0, 150) y < fweibull6(x, c(0.8, 40, 5, 0.2, 80, 5)) + rnorm(x, sd = 0.1) plot(x, y) res < fitweibull6(x, y, p0 = c(0, 40, 1, 1, 60, 0)) plot(res)