Description Usage Arguments Details Value Note Author(s) References See Also Examples
Fit a four or sixparametric Weibull function to environmental data.
1 2 3  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 <[email protected]>
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  ## 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)

Loading required package: boot
Loading required package: pastecs
Loading required package: lattice
Attaching package: 'lattice'
The following object is masked from 'package:boot':
melanoma
[1] 0.8925362
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.