local_thresh | R Documentation |
This is based on Phil Higuera's CharThreshLocal.m Matlab code.
The script determines threshold values
to decompose a detrended timeseries
into a noise and a signal component
using a 2-component Gaussian Mixture Model (GMM).
It determines a positive and a negative threshold value
for each interpolated sample,
based on the distribution of values
within the selected window (thresh.yr
).
The procedure uses a Gaussian mixture model
on the assumption that the noise component
is normally distributed around 0 (the values were detrended!).
local_thresh(
series = NA,
proxy = NULL,
t.lim = NULL,
thresh.yr = NULL,
thresh.value = 0.95,
smoothing.yr = NULL,
keep_consecutive = FALSE,
minCountP = 0.05,
MinCountP_window = 150,
out.dir = NULL,
plot.local_thresh = FALSE
)
series |
Output from the |
proxy |
Set |
t.lim |
Allows defining a portion of the time series.
With |
thresh.yr |
Length of the window width (in years)
from which values are selected
to determine the local threshold.
By default, this value is inherited
from the |
thresh.value |
Determines the threshold as the nth-percentile
of the Gaussian Model of the noise component.
Default to |
smoothing.yr |
Width of moving window for computing SNI. |
keep_consecutive |
Logical. If |
minCountP |
Probability that two resampled counts could arise
from the same Poisson distribution (default to |
MinCountP_window |
Width (in years) of the search window
used for the minimum-count test.
Default to |
out.dir |
Path to the folder where figures are written to.
If |
plot.local_thresh |
Logical. If |
Requires an output from the SeriesDetrend()
function.
Walter Finsinger
co <- tapas::co_char_data
tapas::plot_raw(co)
co_i <- tapas::pretreatment_data(co)
co_detr <- tapas::SeriesDetrend(co_i, smoothing.yr = 1000)
co_loc <- tapas::local_thresh(co_detr, proxy = "charAR",
plot.local_thresh = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.