getFMMPeaks: Peak and trough times and signal values

Description Usage Arguments Value References Examples

View source: R/getFMMPeaks.R

Description

getFMMPeaks() can be used to estimate interesting parameters of the FMM model specially useful in applications. The function estimates peak and trough times and signal values at those times for each component of the model.

Usage

1
getFMMPeaks(objFMM, timePointsIn2pi = TRUE)

Arguments

objFMM

Object of class 'FMM'.

timePointsIn2pi

TRUE to return peak and trough times in the [0,2*pi] interval. When timePointsIn2pi = FALSE the positions of peak and trough times are returned. Its default value is TRUE.

Value

A list with the following components is returned:

tpeakU

a numeric vector with the time points at which the peak of each wave is estimated.

tpeakL

a numeric vector with the time points at which the trough of each wave is estimated.

ZU

a numeric vector with the estimated signal peak values of each wave.

ZL

a numeric vector with the estimated signal trough values of each wave.

References

Rueda C, Larriba Y, Peddada SD (2019). Frequency Modulated Moebius Model Accurately Predicts Rhythmic Signals in Biological and Physical Sciences. Scientific reports, 9 (1), 18701. https://www.nature.com/articles/s41598-019-54569-1

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Generate example data:
fmm2.data <- generateFMM(0, 2, c(1.5, 3.4), c(0.2, 2.3), c(0.1, 0.2),
                    plot = FALSE, outvalues = TRUE,
                    sigmaNoise = 0.5) # add a gaussian noise with sigma = 0.5

## Fit the FMM model with nback = 2 components
## fit is an object of S4 class 'FMM'
fit <- fitFMM(fmm2.data$y,timePoints = fmm2.data$t,nback = 2,
              lengthAlphaGrid = 24,lengthOmegaGrid = 10, numReps = 1)
## estimate peakes and trough times and signals
getFMMPeaks(fit, timePointsIn2pi = TRUE) # times in the [0,2*pi] interval

FMM documentation built on March 2, 2021, 1:06 a.m.