Calculates the (MO)DWT wavelet variance
wvar(x, ...)
# S3 method for class 'lts'
wvar(
x,
decomp = "modwt",
filter = "haar",
nlevels = NULL,
alpha = 0.05,
robust = FALSE,
eff = 0.6,
to.unit = NULL,
...
)
# S3 method for class 'gts'
wvar(
x,
decomp = "modwt",
filter = "haar",
nlevels = NULL,
alpha = 0.05,
robust = FALSE,
eff = 0.6,
to.unit = NULL,
...
)
# S3 method for class 'ts'
wvar(
x,
decomp = "modwt",
filter = "haar",
nlevels = NULL,
alpha = 0.05,
robust = FALSE,
eff = 0.6,
to.unit = NULL,
...
)
# S3 method for class 'imu'
wvar(
x,
decomp = "modwt",
filter = "haar",
nlevels = NULL,
alpha = 0.05,
robust = FALSE,
eff = 0.6,
to.unit = NULL,
...
)
# Default S3 method
wvar(
x,
decomp = "modwt",
filter = "haar",
nlevels = NULL,
alpha = 0.05,
robust = FALSE,
eff = 0.6,
freq = 1,
from.unit = NULL,
to.unit = NULL,
...
)
A vector
with dimensions N x 1.
Further arguments passed to or from other methods.
A string
that indicates whether to use a "dwt" or "modwt" decomposition.
A string
that specifies which wavelet filter to use.
An integer
that indicates the level of decomposition. It must be less than or equal to floor(log2(length(x))).
A double
that specifies the significance level which in turn specifies the \(1-\alpha\) confidence level.
A boolean
that triggers the use of the robust estimate.
A double
that indicates the efficiency as it relates to an MLE.
A string
indicating the unit to which the data is converted.
A numeric
that provides the rate of samples.
A string
indicating the unit from which the data is converted.
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
The default value of nlevels
will be set to \(\left\lfloor {{{\log }_2}\left( {length\left( x \right)} \right)} \right\rfloor\), unless otherwise specified.
set.seed(999)
x = rnorm(100)
# Default
wvar(x)
#> Variance Low CI High CI
#> 2 0.45217782 0.316045047 0.7004281
#> 4 0.23033971 0.140751059 0.4440086
#> 8 0.13710252 0.069880858 0.3811887
#> 16 0.05160384 0.020543745 0.2878292
#> 32 0.01172383 0.003282007 0.3685303
# Robust
wvar(x, robust = TRUE, eff=0.3)
#> Variance Low CI High CI
#> 2 0.549798561 0.247597207 1.1008897
#> 4 0.239947099 0.069559083 0.6463224
#> 8 0.131799969 0.013817225 0.5602029
#> 16 0.061956778 0.013817225 0.5797696
#> 32 0.007484438 0.003742219 0.4233586
# Classical
wvar(x, robust = FALSE, eff=0.3)
#> Variance Low CI High CI
#> 2 0.45217782 0.316045047 0.7004281
#> 4 0.23033971 0.140751059 0.4440086
#> 8 0.13710252 0.069880858 0.3811887
#> 16 0.05160384 0.020543745 0.2878292
#> 32 0.01172383 0.003282007 0.3685303
# 90% Confidence Interval
wvar(x, alpha = 0.10)
#> Variance Low CI High CI
#> 2 0.45217782 0.334461347 0.6516656
#> 4 0.23033971 0.152096918 0.3978812
#> 8 0.13710252 0.077666345 0.3200430
#> 16 0.05160384 0.023732362 0.2119612
#> 32 0.01172383 0.004018555 0.1908247