Description Usage Arguments Value See Also Examples
View source: R/multi_peak_features.R
Isolate local extrema and perform a linear regression. Aims at giving an estimation of long-term trend in multi-peak signals.
1 | MPFeatTrend_extrema(x, window.size, what, robust = FALSE)
|
x |
a numerical vector. |
window.size |
integer, width of window for maxima detection. See ?detect.peak. |
what |
character, one of "minima" or "maxima". Define whether regression should be performed on maxima or minima of peaks. |
robust |
logical. If TRUE perform robusts linear regression. Median-Based Linear Models are used, see ?mblm::mblm |
A list of 4. $trend, slope of the linear model
$model, the full linear model
$extremes, x extrema values and their index
$type, type of extrema, "mini" or "maxi"
MPFeatTrend_rollmean
1 2 3 4 | x <- sim_phase_shifted_with_fixed_trend(n = 1, noise = 0, slope = 0.1)
x.trend <- MPFeatTrend_extrema(x = x$value, window.size = 5, what = "maxi")
plot(x$value, type = "b")
abline(x.trend$model, col = "blue", lwd = 2, lty = "dashed")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.