find.minmax: Find min/max of a time series

Description Usage Arguments Value Author(s) Examples

Description

Find local minima and maxima of a time series

Usage

1
find.minmax (timeseries)

Arguments

timeseries

time series in matrix format (n rows x 2 columns). The first column should contain the time steps and the second column should contain the values. If timeseries is a column vector instead of a matrix, then it will be automatically converted to a matrix with column 1 corresponding to a time index ranging from 1 to the length of timeseries

Value

Returns a named list containing:

mins

n x 3 matrix containing the index, time steps, and the local min values

maxs

n x 3 matrix containing the index, time steps, and the local max values

Author(s)

Tarik C. Gouhier (tarik.gouhier@gmail.com)

Examples

1
2
3
4
5
6
t1=runif(100)
min.max=find.minmax(t1)
min.max$maxs
plot (t1, t="l")
points (min.max$mins, col="blue", bg="blue", pch=19)
points (min.max$maxs, col="red", bg="red", pch=19)

tgouhier/synchrony documentation built on Dec. 8, 2019, 11:11 p.m.