Learn R Programming

phenology (version 3.72)

fit_phenology: Fit the phenology parameters to timeseries of counts.

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 the help ! Add trace=1 [default] to have information on the fit progression or trace=0 to hide information on the fit progression. method_incertitude='multinomial' [default] is the correct one from a statistical point of view. method_incertitude='binomial' is an alternative more rapid. method_incertitude='sum' is an aproximate method more rapid and using less memory. 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 = file.choose(), parametersfit = NULL,
  parametersfixed = NULL, trace = 1, maxit = 500,
  method_incertitude = "multinomial", zero_counts = TRUE, hessian = TRUE,
  help = FALSE, silent = FALSE, growlnotify = TRUE)

Arguments

data
A dataset generated by add_format
parametersfixed
Set of fixed parameters
parametersfit
Set of parameters to be fitted
trace
If 1, it shows 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, it will continue to search for. Default is 500.
method_incertitude
'multinomial' [default] is the correct one from a statistical point of view; 'binomial' is an aproximate method more rapid and using less memory; 'sum' is an alternative more rapid but potentially biased (not sure).
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
silent
If TRUE does not show any message
growlnotify
If False, does not send growl notification

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_phenology(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(result_Gratiot)

Run the code above in your browser using DataLab