runs.test: Calculating the number of runs

View source: R/runs.test.R

runs.testR Documentation

Calculating the number of runs

Description

This function calculates the number of runs of successive positive or negative deviations from theta (if model = stasis) or the mean of the data. This function is used by other functions and will generally not be used directly by users.

Usage

runs.test(x, model, tt = NULL, theta = NULL, int = NULL,
  mstep = NULL)

Arguments

x

vector of sample means

model

the model being evaluated

theta

the value of theta if model = stasis

Details

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.

Value

net evolution


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