species_mix.fit is similar to glm.fit and does all the heavy lifting when it comes to estimating species mix models. If you are unfamiliar with how to use glm.fit it is recommended that you use species_mix which is the user friendly wrapper around this function. If you are comfortable with the data strucutres for an species_mix model feel free to use this function for fitting (but realise many of the post processing function - )
species_mix.fit(
y,
X,
W,
G,
S,
spp_weights,
site_spp_weights,
offset,
disty,
linky,
size,
powers,
control,
inits = NULL
)is a matrix generated from model.response containing the species information. The matrix has the dimensions n_sites * n_species.
is a design matrix for the archetype_formula dimension n_sites * n_covariates.
is a design matrix for species_formula and will be implemented if species_formula has covariates.
is the number of species archetypes that are being estimated.
is the number of species to be modelled (this will be calculated internally in species_mix())
These are weights on the species logls and are specifically used in the Bayesian Bootstrap.
These are site and species specific weights. For most distributions these will be the same across all species. But this form is required to correctly estiamte the IPPMs. See species_mix for more details.
this is a vector of site specific offsets, this might be something like area sampled at sites.
the error distribution to used in species_mix estimation. Currently, 'bernoulli', 'poisson', 'negative.binomial' and 'guassian' are available - internal conversion of distribution to a integer.
The link function to use alongside the distribution. The link function uses with the distribution (disty)
The size of each of binomial sample at each site. Length should be the number of sites.
The power parameters for the Tweedie distribution.
this is a list of control parameters that alter the specifics of model fitting.
This will be a vector of starting values for species_mix (i.e you've fitted a model and want to refit it).