psi: Transformation of time series

View source: R/psi.R

psiR Documentation

Transformation of time series

Description

Standardizes (multivariate) time series by their median, MAD and transforms the standardized time series by a ψ function.

Usage

psi(y, fun = c("HLm", "HLg", "SLm", "SLg", "HCm", "HCg", "SCm", "SCg"), k, 
    constant = 1.4826)

Arguments

y

vector or matrix with each column representing a time series (numeric).

fun

character string specifying the transformation function ψ (more in Details).

k

numeric bound used for Huber type psi-functions which determines robustness and efficiency of the test. Default for psi = "HLg" or "HCg" is sqrt(qchisq(0.8, df = m) where m are the number of time series, and otherwise it is 1.5.

constant

scale factor of the MAD.

Details

Let x = \frac{y - med(y)}{MAD(y)} be the standardized values of a univariate time series.

Available ψ functions are:

marginal Huber for location:
fun = "HLm".
ψ_{HLm}(x) = k * 1_{\{x > k\}} + x * 1_{\{-k ≤ x ≤ k\}} - k * 1_{\{x < -k\}}.

global Huber for location:
fun = "HLg".
ψ_{HLg}(x) = x * 1_{\{0 < |x| ≤ k\}} + \frac{k x}{|x|} * 1_{\{|x| > k\}}.

marginal sign for location:
fun = "SLm".
ψ_{SLm}(x_i) = sign(x_i).

global sign for location:
fun = "SLg".
ψ_{SLg}(x) = x / |x| * 1_{\{|x| > 0\}}.

marginal Huber for covariance:
fun = "HCm".
ψ_{HCm}(x) = ψ_{HLm}(x) ψ_{HLm}(x)^T.

global Huber for covariance:
fun = "HCg".
ψ_{HCg}(x) = ψ_{HLg}(x) ψ_{HLg}(x)^T.

marginal sign covariance:
fun = "SCm".
ψ_{SCm}(x) = ψ_{SLm}(x) ψ_{SLm}(x)^T.

gloabl sign covariance:
fun = "SCg".
ψ_{SCg}(x) = ψ_{SCg}(x) ψ_{SCg}(x)^T.

Note that for all covariances only the upper diagonal is used and turned into a vector. In case of the marginal sign covariance, the main diagonal is also left out. For the global sign covariance matrix the last element of the main diagonal is left out.

Value

Transformed numeric vector or matrix with the same number of rows as y.

Author(s)

Sheila Görz

See Also

psi_cumsum, CUSUM

Examples

psi(rnorm(100))

robcp documentation built on Sept. 16, 2022, 5:05 p.m.

Related to psi in robcp...