invTGUW | R Documentation |
This function is used inside trendsegment
and performs the inverse TGUW transformation by undoing the orthonormal transformation of TGUW
in reverse order.
Details of the inverse TGUW transformation can be found in H. Maeng and P. Fryzlewicz (2023), Detecting linear trend changes in data sequences.
invTGUW(ts.obj)
ts.obj |
A list returned by |
ts.obj |
The modified ts.obj is the result of the inverse TGUW transformation and |
Hyeyoung Maeng hyeyoung.maeng@durham.ac.uk, Piotr Fryzlewicz p.fryzlewicz@lse.ac.uk
trendsegment
, TGUW
, thresholding
x <- c(1:10, rep(5,9))
n <- length(x)
x <- x + rnorm(n)
tguwfit <- TGUW(x)
th.const <- 1.3
lambda <- (stats::mad(diff(diff(x)))/sqrt(6)) * sqrt(2 * log(n)) * th.const
thrfit <- thresholding(ts.obj = tguwfit, lambda = lambda, minsegL = 5, bal = 0, connected = TRUE)
invfit <- invTGUW(ts.obj = thrfit)
invfit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.