rmse_sample: Lowest-RMSE sample from time series

Description Usage Arguments Value Examples

View source: R/rmse_sample.R

Description

Computes the Root Mean Square Error between subsequent generations (columns) in given species abundances matrix (time series) as a measure of convergence. The timepoint with the lowest RMSE-difference with respect to the previous timepoint is then extracted and a normalised sample is returned (proportions).

Usage

1
rmse_sample(spab, warn = TRUE, norm = TRUE, cutoff = 1e-04)

Arguments

spab

Species abundances matrix with OTUs in the rows and the timepoints as columns.

warn

default TRUE, set to FALSE to suppress convergence warning

norm

default TRUE: compute RMSE on compositional time series (abundances per time point sum to 1)

cutoff

The value the minimum RMSE cannot exceed in order to declare convergence.

Value

A sample vector with the length equal to the number of rows of given input species abundances matrix.

Examples

1
2
spab <- glv(N = 10, A = powerlawA(n = 10, alpha = 1.2), tend = 10000)
sample <- rmse_sample(spab)

gheysenemma/microsimR documentation built on Dec. 20, 2021, 10:46 a.m.