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)

Example output

synchrony 0.3.8 loaded.
   index time       val
1      3    3 0.9660044
2      5    5 0.6750053
3      8    8 0.9682103
4     12   12 0.5451323
5     14   14 0.3134739
6     19   19 0.9160133
7     21   21 0.7521838
8     24   24 0.5530433
9     26   26 0.7447809
10    28   28 0.7601665
11    32   32 0.8099435
12    35   35 0.8491979
13    41   41 0.4772582
14    43   43 0.1050653
15    49   49 0.9620309
16    52   52 0.9966767
17    54   54 0.1948796
18    56   56 0.7152502
19    59   59 0.5306569
20    61   61 0.2640708
21    64   64 0.3530368
22    66   66 0.9749908
23    70   70 0.8755920
24    72   72 0.9991848
25    74   74 0.9320157
26    78   78 0.8986203
27    80   80 0.7602750
28    83   83 0.5595663
29    86   86 0.8562611
30    90   90 0.7674711
31    92   92 0.9767146
32    94   94 0.9301199
33    96   96 0.7989164

synchrony documentation built on March 26, 2020, 7:14 p.m.