residuals.sad | R Documentation |
residuals.sad
computes residuals between predicted and observed SAD, either the rank abundance or CDF.
mse.sad
computes mean squared error for rank or cdf between predicted and observed SAD.
mseZ.sad
computes the z-score of mean squared error based on parametric bootstrapping.
## S3 method for class 'sad' residuals(x, type = c("rank", "cumulative"), relative = TRUE, log = FALSE, ...) mse(x, ...) ## S3 method for class 'sad' mse(x, ...) mseZ(x, ...) ## S3 method for class 'sad' mseZ(x, nrep, ...)
x |
an |
type |
'rank' or 'cumulative' |
relative |
logical, if true use relative MSE; defaults to TRUE |
log |
logical, if TRUE calculate MSE on log scale; defaults to FALSE |
... |
arguments to be passed to methods |
nrep |
number of simulations from the fitted METE distribution |
return.sim |
logical; return the simulated liklihood values |
Residuals are calculated either for the rank abundances or the cumulative distribution function. This can be done on a log scale and/or as the proportional error. The mean squared error is then simply the mean of squared residuals of either the rank or cumulative distribution function. z-scores are caculated by simulating from a fitted SAD and calculating the MSE between the simulated data sets and the SAD prediction. The distribution of these values is compared against the MSE of the data to obtain a z-score.
residuals
returns a numeic vector giving residuals for each data point;
for type='rank'
this will be a vector of length equal to the number of species
but for type='cumulative'
this will be a vector of length equal to the number
of unique abundances.
mse
returns a numeric vector of length one giving the value of the mean squared error.
mseZ
returns a list with elements: z
, the z-score; obs
,
the observed mean squared error; sim
, nrep
simulated values (NULL
if return.sim=FALSE
.)
Andy Rominger <ajrominger@gmail.com>
'stub'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.