R/rbms_index_modelling.r
get_nm.Rd
get_nm Compute the normalized flight curve by fitting a spline in a Generalized Additive Model for one year 'y' to butterfly count data.
get_nm(
y,
ts_season_count,
MinVisit,
MinOccur,
MinNbrSite,
NbrSample,
GamFamily,
MaxTrial,
SpeedGam,
OptiGam,
TimeUnit,
MultiVisit,
weekday,
mod_form,
tp_col,
verbose = TRUE,
...
)
integer Vector of years for which to compute the flight curve.
data.table Time-series of count and season information returned by ts_monit_count_site
integer The minimum number of visits required for a site to be included in the computation, default=3.
integer The minimum number of positive records (e.g. >= 1) observed over the year in a site default=2.
integer The minimum number of sites required to compute the flight curve, default=1.
integer Value inherited from flight_curve, when set to 'NULL' (default), all site are considered in the GAM model
string Value inherited from flight_curve, default='poisson', but can be 'nb' or 'quasipoisson'.
integer Value inherited from flight_curve, default=3.
logical Set if the bam method should be used, default instead of the default gam method.
logical Set the use the bam method when data are larger than 200 and gam for smaller datasets
character Time-step for which the spline should be computed, 'd' day or 'w' week.
string Function 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 of lists, each list containing three objects, i) **f_curve**: a data.table with the flight curve f_curve
with expected relative abundance, normalised to sum to one over a full season,
ii) **f_model**: the resulting gam model f_model
fitted on the count data and iii) **f_data**: a data.table with the data used to fit the GAM model. This is provided for all year provided in 'y'.