runs.test.stasis: Applying the runs test to the stasis model

View source: R/runs.test.stasis.R

runs.test.stasisR Documentation

Applying the runs test to the stasis model

Description

Investigates if the stasis model is an adequate statistical description of an evolutionary time series by applying the runs test.

Usage

runs.test.stasis(y, nrep = 1000, conf = 0.95, plot = TRUE,
  save.replicates = TRUE, omega = NULL)

Arguments

y

a paleoTS object

nrep

number of iterations in the parametric bootstrap (number of simulated time series); default is 1000.

conf

confidence level for judging whether a model is an adequate statistical description of the data. Number must be between 0 and 1. A higher number means less strict judgment of whether a model is adequate; default is 0.95. Tests are two-tailed (except for the net evolution test), which means a model is judged adequate if the observed test statistic is within the 2.5 percent of the extreme values of the calculated test statistics on the simulated data given the default confidence value of 0.95.

plot

logical; if TRUE, the value of the test statistic calculated based on the observed fossil time series is plotted on the distribution of test statistics calculated on the simulated time series; default is TRUE.

save.replicates

logical; if TRUE, the values of the test statistic calculated on the simulated time series is saved and can be accessed later for plotting purposes; default is TRUE.

omega

evolutonary variance estimated from the observed data. This parameter is automatically estimated from the data, if not set by the user (usually not recommended).

Details

This function applies a runs test in order to investigate if the stasis model can be judged an adequate statistical description of the data. In the stasis model, there should be no tendency for a trait to successively deviate from the optimum in the same direction and the runs test is applied to the sign of the residuals (i.e. θ – trait value) to identify series that have non-random patterns in the sign of deviations. For a time series of length n, the number of runs (one run is a sequence of consecutive numbers with same sign), is approximately normal with mean μ=(2(n_+ n_-))/n+1 and variance (μ-1)(μ-2)/(n-1), where n+ and n- are the number of residuals above and below the optimum respectively. The mean and variance are used to calculate the standard/Z-score implemented as the test statistic.

Value

First part of the output summarizes the number of iterations in the parametric bootstrap and the confidence level for judging whether a model is an adequate statistical description of the data. The last part of the output is:

estimate

The calculated test statistic on the observed data.

min.sim

The smallest test statistic calculated on the simulated data.

max.sim

The largest test statistic calculated on the simulated data.

p-value

Not a real p-value, but is calculated as the fraction of simulated test statistics that is larger (or smaller) than the calculated test statistic on the observed data divided by 0.5. A value of 1 means 50 percent of the test statistics on the simulated data are larger and smaller than the calculated statistic on the observed data. A value of 0.10 means 90 percent of the test statistics on the simulated data are larger or smaller than the test statistic on the observed time series.

result

Whether the model PASSED or FAILED the adequacy test. The outcome depends on the confidence level.

Author(s)

Kjetil L. Voje

References

Voje, K.L. 2018. Assessing adequacy of models of phyletic evolution in the fossil record. Methods in Ecology and Evoluton. (in press).

Voje, K.L., Starrfelt, J., and Liow, L.H. 2018. Model adequacy and microevolutionary explanations for stasis in the fossil record. The American Naturalist. 191:509-523.

See Also

fit3adequacy.RW, fit3adequacy.trend

Examples

## generate a paleoTS objects by simulating a stasis time series
x <- sim.Stasis(ns = 40, theta = 0, omega = 0.1)

## investigate if the time series pass the adequacy test
runs.test.stasis(x)


klvoje/adePEM documentation built on Feb. 24, 2023, 1:28 p.m.