Learn R Programming

wv (version 0.1.2)

wvar: Wavelet Variance

Description

Calculates the (MO)DWT wavelet variance

Usage

wvar(x, ...)

# S3 method for lts wvar( x, decomp = "modwt", filter = "haar", nlevels = NULL, alpha = 0.05, robust = FALSE, eff = 0.6, to.unit = NULL, ... )

# S3 method for gts wvar( x, decomp = "modwt", filter = "haar", nlevels = NULL, alpha = 0.05, robust = FALSE, eff = 0.6, to.unit = NULL, ... )

# S3 method for ts wvar( x, decomp = "modwt", filter = "haar", nlevels = NULL, alpha = 0.05, robust = FALSE, eff = 0.6, to.unit = NULL, ... )

# S3 method for imu wvar( x, decomp = "modwt", filter = "haar", nlevels = NULL, alpha = 0.05, robust = FALSE, eff = 0.6, to.unit = NULL, ... )

# S3 method for default wvar( x, decomp = "modwt", filter = "haar", nlevels = NULL, alpha = 0.05, robust = FALSE, eff = 0.6, freq = 1, from.unit = NULL, to.unit = NULL, ... )

Value

A list with the structure:

  • "variance": Wavelet Variance

  • "ci_low": Lower CI

  • "ci_high": Upper CI

  • "robust": Robust active

  • "eff": Efficiency level for Robust calculation

  • "alpha": p value used for CI

  • "unit": String representation of the unit

Arguments

x

A vector with dimensions N x 1.

...

Further arguments passed to or from other methods.

decomp

A string that indicates whether to use a "dwt" or "modwt" decomposition.

filter

A string that specifies which wavelet filter to use.

nlevels

An integer that indicates the level of decomposition. It must be less than or equal to floor(log2(length(x))).

alpha

A double that specifies the significance level which in turn specifies the \(1-\alpha\) confidence level.

robust

A boolean that triggers the use of the robust estimate.

eff

A double that indicates the efficiency as it relates to an MLE.

to.unit

A string indicating the unit to which the data is converted.

freq

A numeric that provides the rate of samples.

from.unit

A string indicating the unit from which the data is converted.

Author

James Balamuta, Justin Lee and Stephane Guerrier

Details

The default value of nlevels will be set to \(\left\lfloor {{{\log }_2}\left( {length\left( x \right)} \right)} \right\rfloor\), unless otherwise specified.

Examples

Run this code
set.seed(999)
x = rnorm(100)

# Default
wvar(x)

# Robust
wvar(x, robust = TRUE, eff=0.3)

# Classical
wvar(x, robust = FALSE, eff=0.3)

# 90% Confidence Interval 
wvar(x, alpha = 0.10)

Run the code above in your browser using DataLab