runstest: Computes Runs Test p-values

runstestR Documentation

Computes Runs Test p-values

Description

Computes Runs Test p-values

Usage

runstest(fit, obs, ...)

## S4 method for signature 'FLQuants,missing'
runstest(fit, combine = TRUE)

## S4 method for signature 'FLQuants,FLQuants'
runstest(fit, obs, combine = TRUE)

## S4 method for signature 'FLQuant,FLQuant'
runstest(fit, obs, combine = TRUE)

## S4 method for signature 'FLQuant,missing'
runstest(fit, combine = TRUE)

## S4 method for signature 'numeric,numeric'
runstest(fit, obs, combine = TRUE)

## S4 method for signature 'numeric,missing'
runstest(fit, obs, combine = TRUE)

Arguments

fit

The result of a model fit.

obs

The observations used in the fit.

...

Extra arguments.

combine

Should ages be combined by addition, defaults to TRUE.

Value

A list with elements 'p.values' and 'pass'.

Examples

data(nsher)
# Compute 'runstest' for FLSR fit
runstest(fit=fitted(nsher), obs=rec(nsher))
# Example runstest by age
data(ple4)
runstest(catch.n(ple4), landings.n(ple4), combine=FALSE)
runstest(fit=FLQuants(D=residuals(catch(ple4), discards(ple4)),
  L=residuals(catch(ple4), landings(ple4))))
runstest(fit=residuals(fitted(nsher), rec(nsher)))
runstest(FLQuants(residuals(fitted(nsher), rec(nsher))))
# Returns value per iter
runstest(fit=rnorm(25, residuals(fitted(nsher), rec(nsher)), 0.2))
runstest(ssb(nsher))
runstest(rnorm(1, FLQuant(1, dimnames=list(year=1973:2021))))
runstest(rep(0.1, 10), cumsum(rnorm(10, 0.1, 0.01)))
runstest(rnorm(10, 0, 0.1))

flr/FLCore documentation built on May 4, 2024, midnight