compare_models: Graphically Compare GMWM Model Fit

Description Usage Arguments Details Value Author(s) Examples

Description

Creates a table of graphs to compare GMWM model fit.

Usage

1
2
3
4
5
6
7
8
9
compare_models(..., display.model = T, show.theo.wv = F,
  facet.label = NULL, background = "white", transparence = 0.05,
  CI.color = NULL, line.color = NULL, line.type = NULL,
  point.size = NULL, point.shape = NULL,
  title = "Comparison of GMWM Models", title.size = 18,
  axis.label.size = 16, axis.tick.size = 11, facet.label.size = 13,
  facet.label.background = "#003C7D33",
  axis.x.label = expression(paste("Scale ", tau)),
  axis.y.label = expression(paste("Wavelet Variance ", nu)))

Arguments

...

Several gmwm objects.

display.model

A boolean indicating whether the model should be displayed in the facet label.

show.theo.wv

A boolean indicating whether the theoretical WV should be plotted in the lower triangular area. See details.

facet.label

A character vector indicating what should be displayed in the facet labels.

background

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

transparence

A double that ranges from 0 to 1 that controls the transparency of confidence interval.

CI.color

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

line.color

A vector of string that indicates the color of lines.

line.type

A vector of string that indicates the type of lines.

point.size

A vector of integer that indicates the size of points on lines.

point.shape

A vector of integer that indicates the shape of points on lines.

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.

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.

axis.x.label

A string that indicates the label on x axis.

axis.y.label

A string that indicates the label on y axis.

Details

This function has been updated to deal with any gmwm object. The old contraint that supplied objects must be constrcuted by the same data is no longer needed.

The parameter show.theo.wv will be automatically set to TRUE, if the supplied gmwm objects are constructed by the same data. This aims to mimic the behaviour in the old version of compare_models.

The default aesthetical setting is designed to work well with 2 and 3 objects. Users are expected to change the color/point/line settings if they want to supply more than 3 objects.

If two models have the same attribute values, for example, same empirical WV, then their aethetics will be set to the same, i.e. same line type, line color, point size, point shape, etc.

Value

A ggplot2 panel containing the graphs of gmwm objects.

Author(s)

Wenchao

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
#AR
set.seed(8836)
x1 = gen_gts(1000, AR1(phi = .1, sigma2 = 1) + AR1(phi = 0.95, sigma2 = .1))
x2 = gen_gts(2000, AR1(phi = .1, sigma2 = 1) + AR1(phi = 0.95, sigma2 = .1))

GMWM1 = gmwm(AR1(), data = x1)
GMWM2 = gmwm(2*AR1(), data = x2)

compare_models(GMWM1, GMWM2, show.theo.wv = T, transparence = 0.2, 
               facet.label = c('model1', 'model2'))
               
compare_models(GMWM1, GMWM2, CI.color = c('black','red'), 
               point.size = c(3, 3, 0, 0, 0, 0, 2, 2),
               line.color = c('black', 'red', 'grey', 'pink',
                              'grey', 'pink', 'purple', 'green')) 
#in the order of emp. WV, lower bound, higher bound, theo. WV

## End(Not run)

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