View source: R/compute_derivative.R
compute_derivative | R Documentation |
Estimates the derivative of a time series using numeric methods.
compute_derivative(x, dt, r = min(dim(as.matrix(x))),
devMethod = c("FOCD", "GLLA", "FINITE"),
gllaEmbed = NA, gllaTau = NA, gllaOrder = NA)
x |
A vector or matrix of measurements over time. |
dt |
Numeric; the change in time between successive measurements. |
r |
An integer; the number of time series in |
devMethod |
A character string. One of either |
gllaEmbed |
An integer; t embedding dimension used for |
gllaTau |
An integer; the time delay used for |
gllaOrder |
An integer; the embedding dimension used for |
If devMethod = "FOCD"
- returns a vector or matrix of first order derivatives the first r
columns of x
with respect to time.
If devMethod = "GLLA"
- returns a matrix or list of matrices of derivatives of the first r
columns of x
with respect to time.
Derivatives returned by devMethod = "GLLA"
are up to order "gllaOrder"
and include the "0^{th}
" derivative.
If devMethod = "FINITE"
- returns a vector or matrix of first order derivatives the first r
columns of x
with respect to time.
Boker, S. M., Deboeck, P. R., Edler, C., & Keel, P. K. (2010). Generalized local linear approximation of derivatives from time series. In Chow S, Ferrer E, and Hsieh F, editors, Statistical methods for modeling human dynamics: An interdisciplinary dialogue.
data(ECG_measurements)
xdat <- ECG_measurements[,"channel1"]
dt <- ECG_measurements[2,"time"] - ECG_measurements[1,"time"]
compute_derivative(x = xdat, dt = dt, devMethod = "FOCD")
## Not run:
compute_derivative(x = xdat, dt = dt, devMethod = "GLLA", gllaEmbed = 5, gllaTau = 1, gllaOrder = 1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.