Usage
fitsinglemod(model.list, init.param, param.range, main.samp, tot.pop=(100*(divsamplenum(main.samp,2)[1])), numit=10^5, varleft=1e-8, data.default=TRUE, subsizes = 6, dssamps = list(), nrf = 1, minrarefac=1, NResamples=1000, minplaus=10, fitloops=2)
Arguments
model.list
model; written as a function: function(x, params) with(as.list(params), <function of params>). Examples are given in the ModelSet data file as part of the DivE package. Used in the modFit function.
init.param
matrix of of initial seed model parameters. For each matrix, each row represents a given parameter set; each column represents a parameter value. Column names must match parameter names (params) in the corresponding model in the list models. Examples are given in the ParamSeeds data file as part of the DivE package.
param.range
matrix of lower and upper model parameters bounds. Used for the modFit function. The first and second row corresponds to the lower and upper bounds respectively; each column represents a parameter value. Column names must match parameter names (params) in the corresponding model in the list models. Examples are given in the ParamRanges data file as part of the DivE package.
main.samp
the main sample, either as a 2-column data.frame (species ID, count of species), or a vector of species IDs.
tot.pop
total population (integer); default set to 100x the main.samp size.
numit
control argument passed to optimisation routine; the maximum number of iterations that modFit will perform. See modFit for details.
varleft
control argument passed to optimisation routine; see modFit for details.
data.default
if True, then the list of vectors of nested rarefaction data (divsubsample objects) generated by the divsamplenum and divsubsample functions; if False, then the function uses the user-specified list of nested rarefaction data, dssamps
subsizes
either number of subsamples of main.samp (integer), or a vector of subsample lengths. If the former, then the vector of sample lengths will be created using the divsamplenum function. dssamps
list of user specified rarefaction data divsubsamples objects. The length of each component vector of each object in the list must correspond to the vector of subsample lengths (as defined by the user in subsizes).
nrf
difference between lengths of successive rarefaction datapoints.
minrarefac
minimum rarefaction x-axis value. This argument is not used if list of divsubsamples object is specified in dssamps.
NResamples
number of resamples used to calculate the rarefaction data. This parameter is not used if list of divsubsamples object is specified in dssamps. NB: different from numit parameter, which is specific to the fitting process.
minplaus
lower x-axis bound for plausibility check.
fitloops
number of fitting rounds performed for each model. In each round of fitting, the initial seed parameter values for each model will be the fitted parameters of the previous fitting run. This parameter has a significant impact on the computational time. The `sweet spot' is 2.