Learn R Programming

gmwm (version 2.0.0)

compare.gmwm: Graphically Compare GMWM Model Fit

Description

Creates GMWM model fits of different models within the same panel.

Usage

compare.gmwm(..., background = "white", split = TRUE, CI = TRUE, auto.label.wvar = F, transparence = 0.1, line.color = NULL, CI.color = NULL, line.type = NULL, point.size = NULL, point.shape = NULL, title = "Comparison of Implied Wavelet Variance", 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)), facet.label.size = 13, legend.label = NULL, legend.title = "", legend.key.size = 1.3, legend.title.size = 13, legend.text.size = 13, nrow = 1, plot.emp.wv = T)

Arguments

...
Several gmwm 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 gmwm 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 the confidence interval (e.g. 'black', 'red', '#003C7D', etc.)
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.
axis.x.label
A string that indicates the label on x axis.
axis.y.label
A string that indicates the label on y axis.
facet.label.size
An integer that indicates the size of 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 how many rows the graph should be arranged in.
plot.emp.wv
A boolean that indicates whether Emp. WV should be plotted or not (Used in compare.models).

Value

A ggplot2 panel containing the graph of gmwm objects.

Details

If only one object is supplied, this function is actually calling plot.gmwm. When the parameters line.color, CI.color, line.type, point.size, point.shape and legend.label are modified, please follow the rules of plot.gmwm.

When CI = T, for CI.color, specify the color for each object. For line.color, line.type, point.size, point.shape, specify the value of lower bound, upper bound, empirical wavelet variance (WV), implied WV respectively for each object.

When CI = F, you don't need CI.color this time. For line.color, line.type, point.size, point.shape, only specify the value of empirical WV and implied WV respectively.

Check the examples for help.

Examples

Run this code
## Not run: # AR
# set.seed(8836)
# n = 200
# x = gen.gts(AR1(phi = .1, sigma2 = 1) + AR1(phi = 0.95, sigma2 = .1), n)
# GMWM1 = gmwm(AR1(), data = x)
# GMWM2 = gmwm(2*AR1(), data = x)
# compare.gmwm(GMWM1, GMWM2, split = FALSE)
# compare.gmwm(GMWM1, GMWM2, point.size = rep(c(1,1,4,4),2), CI.color = c('black','grey'))
# compare.gmwm(GMWM1, GMWM2, CI = F, point.size = rep(c(6,6),2))
# ## End(Not run)

Run the code above in your browser using DataLab