metaCDW {cardidates}R Documentation

Extract Cardinal Dates of Multiple Time Series at Once Using Fitted Weibull Curves


metaCDW determines the relevant peak of several time series and fits four- resp. six-parametric Weibull curves to these peaks of all series at once and extracts “cardinal dates” from the fitted curves.


metaCDW(dat, method = "weibull6", xstart = 55, xmin = 0, xmax = 365, 
        minpeak = 0.1, mincut = 0.382,
        quantile = 0.05, symmetric = FALSE, p0 = NULL, linint = -1, 
        findpeak = TRUE, maxit = 2000)
## S3 method for class 'cardiMetacdw'
summary(object, file="", ...)



a data.frame containig the columns: sample (description of the timeseries such as year, water body, or any other code (should be numeric or factor), x (the independend variable, e.g. Julian day of the year), y (the dependend variable, e.g. phytoplankton biovolume) and an optional column flag (of type boolean indicating whether a data point should be included in analysis),


either "weibull6" or "weibull4",


offset (day of year) for the "spring" peak; either a single numeric value for all years or a vector of the same length as number of samples,


left boundary (in day of year) of the integral under the curve,


right boundary (in day of year) of the integral under the curve,


two-sided quantile (percentage of integral) which defines beginning and end of the peak,


minimum value of the total maximum which is regarded as peak (default value is derived from golden section),


minimum relative height of a pit compared to the lower of the two neighbouring maxima at which these maxima are regarded as separate peaks.


if (TRUE), quantiles are calculated for the whole area under the curve, otherwise for each of the branches separately.


initial parameters for optimization. In case of p0 = NULL a heuristic algorithm to derive initial values is used for fitweibull6,


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.


maximum number of iterations passed to the optimisation functions,


a logical value indicating whether the relevant peaks of the time series should be identified automatically with peakwindow before the computation proceeds,


a result from a call to metaCDW,


file name where the data are to be written to, defaults to screen,


other parameters of summary passed to write.


This is a top-level function which calls peakwindow, fitweibull and CDW for a series of data sets and returns a table (data frame) of all results.


A list with components:


data frame with cardinal dates and fitted parameters, see CDW for details,


list of fit details for all fits, see fitweibull for details.

See Also

weibull4, weibull6, fitweibull, peakwindow, CDW, cardidates


## open test data set (3 years) with 4 columns
## sample, x, y, flag
dat <- carditest

## alternatively: import data from spreadsheet via the clipboard
# dat <- read.table("clipboard", sep = "\t", header = TRUE)

## or, for languages with comma as decimal separator:
# dat <- read.table("clipboard", sep = "\t", header = TRUE, dec = ",")

## Note: as.numeric recodes factor year to numeric value
plot(as.numeric(dat$sample)*365 + dat$x, dat$y, type = "b")

## do the analysis
tt <- metaCDW(dat, xstart = 55)

## plot results
par(mfrow=c(1, 3))
lapply(tt$weibullfits, plot)

## return table of results

## Not run: 
## copy to clipboard in spreadsheet compatible format
summary(tt, file = "clipboard", sep = "\t", quote = FALSE, row.names = FALSE)

## or, for languages with comma as decimal separator:
#summary(tt, file = "clipboard", sep = "\t", dec = ",",
#  quote = FALSE, row.names = FALSE)

## End(Not run)

[Package cardidates version 0.4.8 Index]