compare_wvar: Compare Wavelet Variances

Description Usage Arguments Note Author(s) Examples

Description

Compare the estimates given by the classical and robust methods of calculating the wavelet variance.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
compare_wvar(..., background = "white", split = TRUE, CI = TRUE,
  auto.label.wvar = T, transparence = 0.1, line.color = NULL,
  CI.color = NULL, line.type = NULL, point.size = NULL,
  point.shape = NULL, title = "Haar Wavelet Variance Representation",
  title.size = 15, axis.label.size = 13, axis.tick.size = 11,
  axis.x.label = expression(paste("Scale ", tau)),
  axis.y.label = expression(paste("Wavelet Variance ", nu)),
  units = c(bquote(rad^2/s^2), bquote(m^2/s^4)), facet.label.size = 13,
  facet.label.background = "#003C7D33", legend.label = NULL,
  legend.title = "", legend.key.size = 1.3, legend.title.size = 13,
  legend.text.size = 13, nrow = 1)

Arguments

...

Any number of wvar or wvar.imu objects.

background

A string that determines the graph background. It can be 'grey' or 'white'.

split

A boolean that indicates whether the graphs should be separate (TRUE) or graphed ontop of each other (FALSE)

CI

A boolean that indicates whether the confidence interval should be plotted.

auto.label.wvar

A boolean that indicates whether legend label should indicate the objects are robust or classical.

transparence

A double that ranges from 0 to 1 that controls the transparency of the graph

line.color

A vector of string that indicates the color of lines.

CI.color

A vector of string that indicates the color of confidence interval.

line.type

A vector of string that indicates the type of lines.

point.size

A vector of integer that indicates the size of point.

point.shape

A vector of integer that indicates the shape of point.

title

A string that indicates the title of the graph.

title.size

An integer that indicates the size of title.

axis.label.size

An integer that indicates the size of label

axis.tick.size

An integer that indicates the size of tick mark

axis.x.label

A string that indicates the label on x axis

axis.y.label

A string that indicates the label on y axis

units

A two-element vector indicating the units of gyroscope and accelerometer sensor. Set it to NULL if units are not needed.

facet.label.size

An integer that indicates the size of facet label

facet.label.background

A string that indicates the background color of the facet label

legend.label

A vector of string that indicates the labels on legend.

legend.title

A string that indicates the title of legend

legend.key.size

A double that indicates the size of key (in centermeters) on legend

legend.title.size

An integer that indicates the size of title on legend

legend.text.size

An integer that indicates the size of key label on legend

nrow

An integer that indicates number of rows

Note

If you meet the error "polygon edge not found", RStudio is complaining that you don't have enough space to plot the graph. You can adjust the graphics window, or open an external window. The function open_plots can be used and it works for all operating systems.

When wvar.imu objects are supplied, some parameters, e.g. split and nrow, are invalid, since the graph is plot seperately and put in 2 rows by default.

Author(s)

JJB, Wenchao

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
## Not run: 
## Case1: Supplied objects are \code{wvar}:
data1 = gen_gts(1000, AR1(phi = .32, sigma2=.01))
data2 = gen_gts(2000, ARMA(ar=c(.8,.1), ma=c(.3), sigma2=1))
data3 = gen_gts(4000, AR1(phi = .32, sigma2=1))

wv1 = wvar(data1, robust = TRUE)
wv2 = wvar(data2)
wv3 = wvar(data3)

compare_wvar(wv1, wv2)
compare_wvar(wv1, wv2, CI = FALSE)
compare_wvar(wv1, wv2, split = FALSE)
compare_wvar(wv1, wv2, wv3, split = FALSE)

# Change default setting
color = c('green','red','blue')
label = c('1','2','3')
compare_wvar(wv1, wv2, wv3, 
             line.color = color, CI.color = color,
              legend.label = label)
compare_wvar(wv1, wv2, wv3, 
             line.color = color, CI.color = color, 
             legend.label = label, split = FALSE)

## Case2: Supplied objects are \code{wvar.imu}:
if(!require("imudata")){
   install_imudata()
   library("imudata")
}

data(imu6)
test1 = imu(imu6, gyros = 1:3, accels = 4:6, axis = c('X', 'Y', 'Z'), freq = 100)
wv1 = wvar(test1)

test2 = imu(imu6, gyros = 1, accels = 3:4, axis = c('X','X','Y'), freq = 100)
wv2 = wvar(test2, robust = T)

compare_wvar(wv1, wv2)
compare_wvar(wv1, wv2, auto.label.wvar = F, legend.label = c('data1', 'data2'))

## End(Not run)

SMAC-Group/gmwm documentation built on Sept. 11, 2021, 10:06 a.m.