invTGUW: Inverse Tail-Greedy Unbalanced Wavelet (TGUW) transformation

View source: R/invTGUW.R

invTGUWR Documentation

Inverse Tail-Greedy Unbalanced Wavelet (TGUW) transformation

Description

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.

Usage

invTGUW(ts.obj)

Arguments

ts.obj

A list returned by thresholding.

Value

ts.obj

The modified ts.obj is the result of the inverse TGUW transformation and ts.coeffs now presents the estimated piecewise-linear signal of the data.

Author(s)

Hyeyoung Maeng hyeyoung.maeng@durham.ac.uk, Piotr Fryzlewicz p.fryzlewicz@lse.ac.uk

See Also

trendsegment, TGUW, thresholding

Examples

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

trendsegmentR documentation built on Aug. 24, 2023, 5:07 p.m.