View source: R/Global_Thresh.R
global_thresh | R Documentation |
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).
This is based on Phil Higuera's CharThreshLocal.m Matlab code.
It determines a positive and a negative threshold value
for each interpolated sample,
based on the distribution of values within the entire record.
The procedure uses a Gaussian mixture model
with the assumption that the noise component
is normally distributed around 0 (because input values were detrended!).
A figure is generated and saved to the output
directory
and a list is returned with the threshold data for the analyzed proxy.
global_thresh(
series = NA,
proxy = NULL,
t.lim = NULL,
thresh.value = 0.95,
noise.gmm = 1,
smoothing.yr = NULL,
keep_consecutive = F,
minCountP = 0.05,
MinCountP_window = 150,
out.dir = NULL,
plot.global_thresh = T
)
series |
The output of the |
proxy |
Set |
t.lim |
Restricted portion of the timeseries.
With |
thresh.value |
Threshold: the nth-percentile of the Gaussian Model
of the noise component.
Defaults to |
noise.gmm |
Specifies which of the two GMM components
should be considered as the noise component.
By default |
smoothing.yr |
Width of the moving window
for computing |
keep_consecutive |
Logical. When |
minCountP |
Probability that two resampled counts
could arise from the same Poisson distribution
(defaults to |
MinCountP_window |
Width of the search window (in years)
used for the minimum-count test.
Defaults to |
out.dir |
Path to the folder where figures will be written to.
Use |
plot.global_thresh |
Logical. If |
Requires output from the SeriesDetrend()
function.
A list similar to series
with additional data appended.
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_glob <- tapas::global_thresh(co_detr, proxy = "charAR")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.