amps: A helper function to find the amplitudes by finding the peaks...

Description Usage Arguments Examples

Description

This function finds the peaks and antimodes by way of distribution density estimation. It may be convenient to think of this function as finding the global and local maxima and the local minima of a data vector. Note that the global minimum is asymptotically zero ("0")from based on distribution theory; for practical purposes, double checking the global minimum is good practice. Just run ("min(x))")

Usage

1
amps(x)

Arguments

x

Data vector.

Examples

1
2
data<-c(rnorm(15,0,1),rnorm(21,5,1))
amps(data)

Example output

$Peaks
    Location (x) Amplitude (y)
159   -0.3839207     0.1085129
330    4.8339919     0.1489818

$Antimode
    Location (x) Amplitude (y)
236     1.965666    0.06623773

modes documentation built on May 2, 2019, 1:28 p.m.