A function to fit a smoothed spline to Phenological Data
SplineFit(ts, uncert = FALSE, nrep = 100, df.factor = 0.05,
ncores='all', sf=quantile(ts, probs=c(0.05, 0.95), na.rm=TRUE))
A list containing the following items.
A list with fitted values and an object named 'params' set to NULL, for simmetry with other fittings
A list containing a zoo data.frame with the uncertainty predicted values, and an object named 'params' set to NULL, for simmetry with other fittings
A ts or zoo object with gcc data. index(ts) must be numeric days of year (doys)
Should uncertainty be estimated?
Number of relications to estimate uncertainty, defaults to 100.
Defaults to 0.05, it is multiplied by length(ts) to generate degrees of freedom for the spline fitting. The higher the number of data, the higher should be df factor. For a complete year of data (i.e. length(ts)=365) the default value is optimum.
Unused argument for compatibility
Scaling factors required to normalize the data prior to the fitting. If the function is called by e.g. greenProcess
sf is automatically calculated.
Gianluca Filippa <gian.filippa@gmail.com>
This function fits a smoothed spline to the data. Df for smoothing are set at 0.05*length(ts) by default and df.factor can be modified. Uncertainty is estimated by changing the degrees of freedom of the spline. In particular a sequence from 0.01 and df.factor, of length nrep is used as varying degrees of freedom for the spline fitting.
if (FALSE) {
data(bartlett2009.filtered)
fitted <- SplineFit(bartlett2009.filtered, uncert=TRUE, nrep=50)
}
Run the code above in your browser using DataLab