Learn R Programming

gmwm (version 2.0.0)

wvar: Wavelet Variance

Description

Calculates the (MODWT) wavelet variance

Usage

wvar(x, ...)
"wvar"(x, decomp = "modwt", nlevels = NULL, alpha = 0.05, robust = FALSE, eff = 0.6, to.unit = NULL, ...)
"wvar"(x, decomp = "modwt", nlevels = NULL, alpha = 0.05, robust = FALSE, eff = 0.6, to.unit = NULL, ...)
"wvar"(x, decomp = "modwt", nlevels = NULL, alpha = 0.05, robust = FALSE, eff = 0.6, freq = 1, from.unit = NULL, to.unit = NULL, ...)
"wvar"(x, decomp = "modwt", nlevels = NULL, alpha = 0.05, robust = F, eff = 0.6, to.unit = NULL, ...)

Arguments

x
A vector with dimensions N x 1, or a lts object, or a gts object, or a imu object.
...
Further arguments passed to or from other methods.
decomp
A string that indicates whether to use the "dwt" or "modwt" decomposition.
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 indicates the $(1-p)*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 which the data is converted to.
freq
A numeric that provides the rate of samples.
from.unit
A string indicating the unit which the data is converted from.

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
"alpha"
p value used for CI
"unit"
String representation of the unit

Details

If `nlevels` is not specified, it is set to floor(log2(length(x)))

Examples

Run this code
set.seed(999)
x = rnorm(100)
# Default
wvar(x)
# Robust
wvar(x, robust = TRUE, eff=0.3)
# 90% confidence interval
wvar(x, alpha = 0.10)

# IMU Object
## Not run: 
# if(!require("imudata")){
#    install_imudata()
#    library("imudata")
# }
# 
# data(imu6)
# test = imu(imu6, gyros = 1:3, accels = 4:6, freq = 100)
# df = wvar.imu(test)
# ## End(Not run)

Run the code above in your browser using DataLab