| char_peak_id | R Documentation |
Mirrors CharPeakID.m from the MATLAB v2.0 codebase. For each
threshold column, samples where C_peak exceeds the threshold are flagged,
consecutive exceedances are collapsed to a single event (keeping the
last sample of each run, i.e. the oldest, matching the MATLAB
v1.1 / v2.0 convention), and each event is screened against a
minimum-count criterion using the Shuie-Bain (1982) extension of the
Detre-White (1970) test for unequal sediment volumes.
char_peak_id(charcoal, pretreatment, peak_analysis, char_thresh)
charcoal |
Named list containing:
|
pretreatment |
Named list with element |
peak_analysis |
Named list with elements |
char_thresh |
Named list returned by [char_thresh_global()] or
[char_thresh_local()], containing |
## Threshold value matrix
For **global** thresholds (threshType == 1), char_thresh$pos
is a constant-row [N \times T] matrix reused directly. For
**local** thresholds (threshType == 2), char_thresh$pos is
already [N \times T] (per-sample values).
## Consecutive-peak removal After flagging all exceedances, a diff-based pass retains only the last sample of each consecutive run – the oldest sample within a group of contiguous above-threshold values. This matches the MATLAB v1.1 algorithm (which the v2.0 comment documents correctly despite the v1.1 comment being misleading).
## Minimum-count test
For each identified peak i in column j, a time window of
\pm 150 yr is constructed around the peak, then narrowed to the
adjacent peaks when they fall within the window. The test statistic is
d = \frac{|c_{\min} - (c_{\min}+c_{\max})\,v_{\min}/(v_{\min}+v_{\max})| - 0.5}
{\sqrt{(c_{\min}+c_{\max})\,v_{\min}\,v_{\max}/(v_{\min}+v_{\max})^2}}
and the p-value is 1 - \Phi(d) (standard normal CDF; equivalent to
MATLAB's 1 - tcdf(d, 1e10) because t_{1\times10^{10}} \to z).
Peaks with p > \alpha_{\text{peak}} are removed.
A named list with two components:
Input charcoal list augmented with:
charPeaks – [N \times T] numeric: 1 at peak
samples, 0 elsewhere.
charPeaksThresh – [N \times T] numeric: threshold
value at each identified peak, 0 elsewhere.
peaksTotal – numeric vector length T: total
peaks per threshold column.
threshFRI – numeric matrix (\leq N \times T):
fire-return intervals derived from peak ages per threshold column.
Input char_thresh list augmented with
minCountP – [N \times T] matrix of Shuie-Bain p-values
(NaN where not computed).
[char_thresh_local()], [char_thresh_global()], [CharAnalysis()]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.