Description Usage Arguments Value Examples
View source: R/single_peak_features.R
Extract all single-peak features
1 | FeatAllFeat(y, basal, start.lag.grow, end.exp.dec, ...)
|
y |
a numerical vector from which features are extracted. |
basal |
a normalization constant to bring base of the peak around 0. |
start.lag.grow |
Index of y where ascending phase starts. See FeatLagGrow, argument 'start'. |
end.exp.dec |
Index of y where descending phase ends. See FeatExpDec, argument 'end'. |
... |
Additional arguments for FeatFWHM. |
A list of 13 features: "mini": minimum of y; "maxi": maximum of y; "diff.min.max": difference maxi-mini; "time.min": index of y where it is minimized; "time.max": index of y where it is maximized; "max.amp": amplitude of peak. Obtained by subtracting constant basal. See FeatMaxAmplitude. "FWHM": Full-Width at Half maximum. Difference right-left. See FeatFWHM. "left": time where half maximum of the peak is reached on its left flank; "right": time where half maximum of the peak is reached on its right flank; "grow.half","grow.lag": growth rate estimated by the slope of a linear regression of the ascending phase of the peak. 2 different methods are used to isolate this phase. First, it is defined as the time between which the signal has reached half of its maximum (left) and its maximum; see FeatHalfMaxGrow. Second, as the time between a hard-encoded starting time point (start.lag.grow) and peak maximum; see FeatLagGrow. "dec.half","dec.exp": decay rate estimated by the slope of a linear regression of the descending phase of the peak. 2 different methods are used to isolate this phase. First, it is defined as the time between which the signal has reached its maximum and half of its maximum (right); see FeatHalfMaxDec. Second, as the time between peak maximum and a hard-encoded endtime point (start.lag.grow); see FeatExpDec. In this case the signal is modelled by EXPONENTIAL DECAY.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | signal <- dnorm(x = seq(-4,4, length.out = 500), mean = 0, sd = 1)
feats <- FeatAllFeat(y = signal, basal = 0, start.lag.grow = 100, end.exp.dec = 400)
plot(signal)
# Half-maximum points
abline(h = max(signal)/2, col = "green")
abline(v = c(feats$left, feats$right), col = c("blue", "red"))
# Growth and Decay slopes according to half-max methods
growth0 = c(feats$left, max(signal)/2)
growth1 = c(which.max(signal), max(signal)/2 + feats$grow.half * (which.max(signal)-feats$left))
segments(x0 = growth0[1], y0 = growth0[2], x1 = growth1[1], y1 = growth1[2], col = "blue", lwd = 4, lty = "dashed")
decay0 = c(which.max(signal), max(signal))
decay1 = c(feats$right, max(signal) + feats$dec.half * (feats$right-which.max(signal)))
segments(x0 = growth0[1], y0 = growth0[2], x1 = growth1[1], y1 = growth1[2], col = "blue", lwd = 4, lty = "dashed")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.