Fit the model described in Solow and Costello (2004) to data. It can use external data on either \(\mu_t\) or \(\Pi_{st}\).
snc(
y,
mu = NULL,
pi = NULL,
data = NULL,
init = NULL,
growth = TRUE,
type = "exponential",
...
)snc returns an object of class "snc" containing:
records | the supplied first records data |
convergence | the optim convergence code. |
log-likelihood | the maximum log-likelihood. |
coefficients | a named vector of the ML estimates of the coefficients. |
fitted.values | the fitted mean \(\lambda\) values. |
predict | a data frame containing the estimated mean +- Standard error \(\mu\) values. |
a time series of the annual number of discovered alien and invasive species (IAS)
a formula defining the predictors for \(\mu_t\), the annual introduction rate. Formulas should be provided in the syntax ~ x1 + x2 + ... + xn.
a formula defining the predictors for \(\Pi_{st}\), the annual probability of detection. Formulas should be provided in the syntax ~ x1 + x2 + ... + xn.
a data frame containing the variables in the model(s).
Optional. Initial values supplied to optim. Must be same length as the total number of parameters.
logical. Should the population growth parameter \(\gamma_2\) be included in the model for \(\Pi_{st}\)?. Note that values for init, if provided, need to include an initial value for the growth parameter, when growth = TRUE.
Define whether the mu function should be on "linear" or "exponential" scale. Defaults to "exponential".
Further arguments passed to optim.
This function expands on the model described in Solow and Costello (2004) by facilitating the
inclusion of external data to describe either \(\mu_t\) or \(\Pi_{st}\).
The model with external data is described fully in Buba et al (2024).
When no formula is defined for either, the function automatically fits the original Solow and Costello (2004)
model using the length of the vector data as the independent variable \(t\).
The original model uses Rcpp for shorter run time.
When numerous estimations are required for a more elaborate model (i.e, for simulation studies or bootstrapping),
users may be benefit from building upon the function described in filename.cpp
Solow, A. R., & Costello, C. J. (2004). Estimating the rate of species introductions from the discovery record. Ecology, 85(7), 1822–1825. https://doi.org/10.1890/03-3102
# \donttest{
data(sfestuary)
example_model <- snc(sfestuary)
print(example_model)
# }
Run the code above in your browser using DataLab