sar_loga {sars}R Documentation

Fit the Logarithmic model

Description

Fit the Logarithmic model to SAR data.

Usage

sar_loga(data, start = NULL, grid_start = 'partial',
  grid_n = NULL, normaTest = 'none',
  homoTest = 'none', homoCor = 'spearman', verb = 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.

start

NULL or custom parameter start values for the optimisation algorithm.

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.

normaTest

The test used to test the normality of the residuals of the model. Can be any of 'lillie' (Lilliefors 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 the model. Can be any of 'cor.fitted' (a correlation of the residuals with the model fitted values), 'cor.area' (a correlation of the 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'.

verb

Whether or not to print certain warnings (default = TRUE)

Details

The model is fitted using non-linear regression. The model parameters are estimated by minimizing the residual sum of squares with an unconstrained Nelder-Mead optimization algorithm and the optim function. To avoid numerical problems and speed up the convergence process, the starting values used to run the optimization algorithm are carefully chosen. However, if this does not work, custom values can be provided (using the start argument), or a more comprehensive search can be undertaken using the grid_start argument. See the vignette for more information. The fitting process also determines the observed shape of the model fit, and whether or not the observed fit is asymptotic (see Triantis et al. 2012 for further details). Model validation can be undertaken by assessing the normality (normaTest) and homogeneity (homoTest) of the residuals and a warning is provided in summary.sars if either test is chosen and fails. A selection of information criteria (e.g. AIC, BIC) are returned and can be used to compare models (see also sar_average).

As grid_start has a random component, when grid_start != 'none' in your model fitting, you can get slightly different results each time you fit a model

The parameter confidence intervals returned in sigConf are just simple confidence intervals, calculated as 2 * standard error.

Value

A list of class 'sars' with the following components:

The summary.sars function returns a more useful summary of the model fit results, and the plot.sars plots the model fit.

References

Triantis, K.A., Guilhaumon, F. & Whittaker, R.J. (2012) The island species-area relationship: biology and statistics. Journal of Biogeography, 39, 215-231.

Examples

data(galap)
fit <- sar_loga(galap)
summary(fit)
plot(fit)

[Package sars version 1.3.6 Index]