Learn R Programming

phenology (version 3.40)

fit_phenology: Fits the phenology parameters to timeseries.

Description

Function of the package phenology to fit parameters to timeseries. To fit data, the syntaxe is : Result<-fit_phenology(data=dataset, parametersfit=par, parametersfixed=pfixed, trace=1, method_incertitude=2, zero_counts=TRUE, hessian=TRUE) or if no parameter is fixed : Result<-fit_phenology(data=dataset, parametersfit=par) or fit_phenology(help=TRUE) to have this help ! Add trace=1 [default] to have information on the fit progression or trace=0 to hide information on the fit progression. method_incertitude=2 [default] is the correct one from a statistical point of view. method_incertitude=0 is an aproximate method more rapid and using less memory. method_incertitude=1 is an alternative more rapid but potentially biased. zero_counts=c(TRUE, TRUE, FALSE) indicates whether the zeros have been recorded for each of these timeseries. Defaut is TRUE for all. hessian=FALSE does not estimate se of parameters.

Usage

fit_phenology(data = NULL, parametersfit = NULL,
    parametersfixed = NA, trace = 1, maxit = 500,
    method_incertitude = 2, zero_counts = TRUE,
    hessian = TRUE, help = FALSE)

Arguments

data
A dataset generated by add_format
parametersfixed
Set of fixed parameters
parametersfit
Set of parameters to be fitted
trace
If 1, displays the progression of fit; 0 is silent (don't be afraid if it is long !)
maxit
Number of iterations for search before checking if it converges. If it does not converge, will continue. Default 500.
method_incertitude
2 [default] is the correct one from a statistical point of view; 0 is an aproximate method more rapid and using less memory; 1 is an alternative more rapid but biased.
zero_counts
example c(TRUE, TRUE, FALSE) indicates whether the zeros have been recorder for each of these timeseries. Defaut is TRUE for all.
hessian
If FALSE does not estimate se of parameters
help
If TRUE, an help is displayed

Value

  • Return a list of with data and result

Details

fit_phenology fits parameters to timeseries.

Examples

Run this code
library(phenology)
# Read a file with data
# Gratiot<-read.delim("http://max2.ese.u-psud.fr/epc/conservation/BI/Complete.txt", , header=FALSE)
data(Gratiot)
# Generate a formatted list nammed data_Gratiot
data_Gratiot<-add_format(origin=NULL, add=Gratiot, name="Complete", reference=as.Date("2001-01-01"), format="%d/%m/%Y")
# Generate initial points for the optimisation
parg<-par_init(data_Gratiot, parametersfixed=NULL)
# Run the optimisation
# result_Gratiot<-fit_phenology(data=data_Gratiot, parametersfit=parg, parametersfixed=NULL, trace=1)
data(result_Gratiot)
# Plot the phenology and get some stats
output<-plot_phenology(result=result_Gratiot, pdf=FALSE)

Run the code above in your browser using DataLab