generateFMM() simulates data from a FMM model defined by parameters M, A, α, β and ω.
generateFMM( M, A, alpha, beta, omega, from =0, to =2* pi, length.out =200, plot =TRUE, outvalues =TRUE, sigmaNoise =0)
Arguments
M: A numeric vector which contains the value of the intercept parameter M.
A: A positive numeric vector which contains the value of the FMM wave amplitude parameter A.
alpha: A numeric vector which contains the value of the FMM wave phase translation parameter α.
beta: A numeric vector which contains the value of the FMM wave skewness parameter β.
omega: A numeric vector which contains the value of the FMM wave kurtosis parameter ω. omega parameter must be between 0 and 1.
from: A numeric value which contains the initial time point of the simulated data. By default, it is 0.
to: A numeric value which contains the final time point of the simulated data. By default, it is 2π.
length.out: A non-negative number wich contains the desired length of the simulation. By default, it is 100.
plot: A logical value indicating whether the simulated data should be drawn on a plot. By default, it is TRUE.
outvalues: A logical value indicating whether the numerical simulation should be return. By default, it is TRUE.
sigmaNoise: A non-negative number which contains the standard deviation of the gaussian noise to be added. Its default value is zero equivalent to a simulation set-up without noise.
Returns
When outvalues = TRUE a list of with the following components is returned: - input: a list with the input parameters M, A, alpha, beta and omega.
t: a numeric vector with the time points at each data is simulated.
y: a numeric vector with the data simulated.
When plot = TRUE a scatter plot of y vs t is drawn.
Details
To simulate a multicomponent FMM model, arguments A, alpha, beta and omega are vectors of length m, where m represents the number of FMM waves. With different lengths, the smaller vectors will be replicate until thay are the same length as the longest vector.
With sigmaNoise = s, s>0, the generateFMM function uses rnorm(length.out, 0, sigmaNoise) to create the normally distributed noise and adds it to the simulated values.
Examples
# Simulate data from a monocomponent FMM model. A plot with the simulated model is showngenerateFMM(M =2,A =3,alpha =1.5,beta =2.3, omega =0.1, outvalues =FALSE)# Add a gaussian noise with standard deviation 0.3. The numeric results are returnedgenerateFMM(M =2, A =3, alpha =1.5, beta =2.3, omega =0.1, sigmaNoise =0.3, plot =FALSE, outvalues =TRUE)# Simulate data from a multicomponent FMM model with two FMM waves# both with amplitude parameter = 2generateFMM(M =0, A = rep(2,2), alpha = c(1.5,3.4), beta = c(0.2,2.3), omega = c(0.1,0.2))
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