Learn R Programming

trendsegmentR (version 1.3.0)

invTGUW: 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)

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.

Arguments

ts.obj

A list returned by thresholding.

Author

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

See Also

trendsegment, TGUW, thresholding

Examples

Run this code
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

Run the code above in your browser using DataLab