sar_multi: Create a Collection of SAR Model Fits

View source: R/sar_average.R

sar_multiR Documentation

Create a Collection of SAR Model Fits

Description

Creates a fit collection of SAR model fits, which can then be plotted using plot.sars.

Usage

sar_multi(data, obj = c("power",
  "powerR","epm1","epm2","p1","p2","loga","koba",
  "monod","negexpo","chapman","weibull3","asymp",
  "ratio","gompertz","weibull4","betap","logistic","heleg","linear"),
  normaTest = "none", homoTest = "none", homoCor = "spearman", grid_start =
  "partial", grid_n = NULL, verb = TRUE, display = TRUE)

Arguments

data

A dataset in the form of a dataframe with two columns: the first with island/site areas, and the second with the species richness of each island/site.

obj

A vector of model names.

normaTest

The test used to test the normality of the residuals of each model. Can be any of "lillie" (Lilliefors Kolmogorov-Smirnov test), "shapiro" (Shapiro-Wilk test of normality), "kolmo" (Kolmogorov-Smirnov test), or "none" (no residuals normality test is undertaken; the default).

homoTest

The test used to check for homogeneity of the residuals of each model. Can be any of "cor.fitted" (a correlation of the squared residuals with the model fitted values), "cor.area" (a correlation of the squared residuals with the area values), or "none" (no residuals homogeneity test is undertaken; the default).

homoCor

The correlation test to be used when homoTest != "none". Can be any of "spearman" (the default), "pearson", or "kendall".

grid_start

Should a grid search procedure be implemented to test multiple starting parameter values. Can be one of 'none', 'partial' or 'exhaustive' The default is set to 'partial'.

grid_n

If grid_start = exhaustive, the number of points sampled in the starting parameter space (see details).

verb

verbose - Whether or not to print certain warnings (default: verb == TRUE).

display

Show the model fitting output and related messages. (default: display == TRUE).

Details

The sar_models() function can be used to bring up a list of the 20 model names. display_sars_models() generates a table of the 20 models with model information.

Value

A list of class 'sars' with n elements, corresponding to the n individual SAR model fits.

Examples

data(galap)
# construct a fit_collection object of 3 SAR model fits
fit2 <- sar_multi(galap, obj = c("power", "loga", "linear"))
plot(fit2)

# construct a fit_collection object of all 20 SAR model fits
# using no grid_start for speed
fit3 <- sar_multi(galap, grid_start = "none")


txm676/mmSAR2 documentation built on Nov. 21, 2024, 5:03 a.m.