# CDW: Cardinal Dates Using Fitted Weibull Curves In cardidates: Identification of Cardinal Dates in Ecological Time Series

## Description

CDW (cardinal dates using Weibull curves) extracts “cardinal dates” from fitted four- and six-parametric Weibull curves.

## Usage

 ```1 2 3``` ```CDW(p, xmin = 0, xmax = 365, quantile = 0.05, symmetric = FALSE) CDWa(p, xmin = 0, xmax = 365, quantile = 0.05, symmetric = FALSE) ```

## Arguments

 `p` object of class `cardiFit` returned by `fitweibull6` or `fitweibull4` or parameter vector of the fitted Weibull function, `xmin` left boundary (in day of year) of the integral under the curve, `xmax` right boundary (in day of year) of the integral under the curve, `quantile` two-sided quantile (percentage of integral) which defines beginning and end of the peak, `symmetric` if (`TRUE`), quantiles are calculated for the whole area under the curve, otherwise for each of the branches separately.

## Details

`CDW` is a numerically improved version of the algorithm described in Rolinski et al. (2007). Version `CDWa` is an alternative, simplified version which sets the baseline before and after the peak to zero using appropriate offset parameters `p` and `p`. The original method described by Rolinski et al. 2007 (here called `CDW`) shifts the function for the left and right branch separately in the asymmetric case.

## Value

A list with components:

 `x` x values of cardinal dates `tMid`, `tBegin`, `tEnd`, `y` the corresponding y values (divided by ymax), `p` parameters of the fitted Weibull function

`weibull4`, `weibull6`, `fitweibull`, `peakwindow`, `metaCDW`, `cardidates`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35``` ```## 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 ## identify cardinal dates from fitted curves (smd <- CDW(p)) (smda <- CDW(p, symmetric = FALSE)) ## plot data, curve and cardinal dates plot(x, y, ylim=c(0, 10), xlim = c(0, 365)) lines(o\$x, o\$f * f) points(x, fweibull6(x, p) * f, col = "green") points(smd\$x, fweibull6(smd\$x, p) * f, col = "orange", pch = 16) points(smda\$x, fweibull6(smda\$x, p) * f, col = "red", pch = 1, cex = 1.2) ## for comparison: additional fit of a 4 parameter Weibull res4 <- fitweibull4(x, y) res4\$r2 p <- res4\$p o <- res4\$fit f <- res4\$ymax smd <- CDW(p) lines(o\$x, o\$f * f, col = "blue") points(smd\$x, fweibull4(smd\$x, p) * f, col = "blue", pch = 16) ```

### Example output ```Loading required package: boot

Attaching package: 'lattice'

The following object is masked from 'package:boot':

melanoma

 0.8925362
\$x
tMid    tBegin      tEnd
109.93479  74.41726 181.10673

\$y
 0.8201478 0.2499816 0.2332290

\$p
   0.8662273  96.1412929   8.2199967   0.1422544 145.0232243   3.9348311

\$x
tMid    tBegin      tEnd
109.93479  74.41726 181.10673

\$y
 0.8201478 0.2499816 0.2332290

\$p
   0.8662273  96.1412929   8.2199967   0.1422544 145.0232243   3.9348311

 0.8185667
```

cardidates documentation built on May 2, 2019, 5:16 p.m.