KlostermanFit {phenopix} | R Documentation |
Fit a double logistic equation to a vector according to Klosterman et al. (2014)
Description
This function fits a double logistic curve to observed values using the function as described in klosterman et al. (2014), eq 7.
Usage
KlostermanFit(ts, which = "light", uncert = FALSE, nrep = 100,
ncores='all', sf=quantile(ts, probs=c(0.05, 0.95), na.rm=TRUE))
Arguments
ts |
A ts or zoo object with gcc data. index(ts) must be numeric days of year (doys) or a POSIXct vector |
which |
A character to be chosen between 'light' (default) and 'heavy'. See details. |
uncert |
Should uncertainty be estimated? |
nrep |
Number of relications to estimate uncertainty, defaults to 100. |
ncores |
Number of processors to be used in parallel computation, defaults to 'all' which will accidentally slow down any other activity on your computer. Otherwise set the number of processors you want to use in parallelization. |
sf |
Scaling factors required to normalize the data prior to the fitting. If the function is called by e.g. |
Details
The function estimates parameters of the double logistic equation from
Klosterman et al. 2014. Two optimization procedures are available. If
which='light' (the default) equation parameters are optimized using the
function optim
and computation is faster, whereas if which='heavy'
the optimization procedure calls the function nsl
and is based on
a greater number of iteractions with different first guesses for parameters.
This option is about ten times slower than the light one.
Value
A list containing the following items.
fit |
A list as returned by the function FitDoubleLogGu |
uncertainty |
A list containing a zoo data.frame with the uncertainty predicted values, and a dataframe containing the respective uncertainty curve parameters |
Author(s)
Gianluca Filippa <gian.filippa@gmail.com>
References
Klosterman ST, Hufkens K, Gray JM, Melaas E, Sonnentag O, Lavine I, Mitchell L, Norman R, Friedl MA, Richardson A D (2014) Evaluating remote sensing of deciduous forest phenology at multiple spatial scales using PhenoCam imagery, Biogeosciences, 11, 4305-4320, doi:10.5194/bg-11-4305-2014.
See Also
FitDoubleLogKlLight
FitDoubleLogKlHeavy
Examples
## Not run:
library(zoo)
data(bartlett2009.filtered)
## fit without uncertainty estimation
fitted.kl1 <- KlostermanFit(bartlett2009.filtered, which='light')
fitted.kl2 <- KlostermanFit(bartlett2009.filtered, which='heavy')
## check fitting
plot(bartlett2009.filtered)
lines(fitted.kl1$fit$predicted, col='red')
lines(fitted.kl2$fit$predicted, col='blue')
legend('topleft',col=c('red', 'blue'), lty=1,
legend=c('light', 'heavy'), bty='n')
## End(Not run)