R/rbms_index_modelling.r
flight_curve.Rd
flight_curve Compute the annual flight curve from butterfly count data collated across sites.
flight_curve(
ts_season_count,
NbrSample = 100,
MinVisit = 3,
MinOccur = 2,
MinNbrSite = 1,
MaxTrial = 3,
GamFamily = "poisson",
CompltSeason = TRUE,
SelectYear = NULL,
SpeedGam = TRUE,
OptiGam = TRUE,
KeepModel = TRUE,
KeepModelData = TRUE,
TimeUnit = "d",
MultiVisit = "mean",
weekday = 3,
mod_form = NULL,
tp_col = NULL,
verbose = TRUE,
...
)
data.table Time-series of counts and season information returned by ts_monit_count_site
integer The maximum number of sites to use for computing the flight curve, default=100.
integer The minimum number of visits required for a site to be included, default=3.
integer The minimum number of positive records (e.g. >= 1) required in one year for a site to be included, default=2.
integer The minimum number of sites required to compute a flight curve, default=1.
integer The maximum number of trials for model convergence, default=3.
string The distribution of the error term used in the GAM, default='poisson', but can be the negative-binomial 'nb' or 'quasipoisson'.
Logical to restrict computation of flight curve for years where the complete season has been sampled, default=TRUE.
integer Select a specific year to compute the flight curve, default=NULL.
Logical Set if the bam method should be used, default instead of the default gam method.
Logical Set the use of the bam method when data are larger than 200 and gam for smaller datasets
Logical to keep model output in a list object named flight_curve_model
.
Logical to keep the data used for the GAM.
character The time-step for which the spline should be computed, 'd' day or 'w' week.
string Function to apply for summarising multiple counts within a time unit, 'max' or 'mean' (default).
Integer for selected day of the week for weekly summary, default is 3 (Wednesday). [1-7] where 1 = Monday.
string with formula to be passed to the gam model, default null.
string or vector of string with additional variable used in the gam model, default null.
a logical indicating if some “progress report” should be given.
Additional parameters passed to gam or bam function from the gam package.
A list with three objects, i) **pheno**: a vector with annual flight curves f_pheno
with expected relative abundance, normalize to sum to one over a full season,
ii) **model**: a list of the resulting gam models f_model
fitted on the count data for each year and iii) **data**: a data.table with the data used to fit the GAM model.