compare_eff | R Documentation |
Creates a table of graphs to compare GMWM models constructed by classical and robust methods.
compare_eff(..., display.eff = T, order.eff = T, facet.label = NULL, background = "white", transparence = 0.05, CI.color = NULL, line.color = NULL, line.type = NULL, point.size = NULL, point.shape = NULL, title = NULL, 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)))
... |
Several |
display.eff |
A |
order.eff |
A |
facet.label |
A |
background |
A |
transparence |
A |
CI.color |
A |
line.color |
A |
line.type |
A |
point.size |
A |
point.shape |
A |
title |
A |
title.size |
An |
axis.label.size |
An |
axis.tick.size |
An |
facet.label.size |
An |
facet.label.background |
A |
axis.x.label |
A |
axis.y.label |
A |
gmwm
objectsThis function is designed to compare the gmwm
objects with different computation methods and efficiency values. Therefore,
gmwm
objects supplied to this function are assumed to have different efficiency values and are constructed by
the same data and same model. The function will check the constraint before generating the graph.
CI.color
and facet.label
To change CI.color
and facet.label
, the user must supply a vector.
If the user compares N
gmwm objects, then he/she must supply a vector of length
N
to CI.color
and facet.label
. Please check examples for help. Additionally,
order.eff
will change the order how objects are plotted. User is recommended to plot the graph
without changing the aesthetics firstly. Then, the user can generate the graph by supplying elements to graphical parameters, e.g. CI.color
,
facet.label
, in left-to-right order.
line.type
, line.color
, point.size
, point.size
must be a vector
.
If the user compares N
gmwm
objects, then a vector of length 4 x N must be supplied to these
parameters. For example, if the user wants to compare gmwm1
with gmwm2
, the order to change the
graphical aesthetics is:
"gmwm1 Empirical WV, gmwm2 Empirical WV, gmwm1 lower bound of CI, gmwm2 lower bound of CI, gmwm1 higher bound of
CI, gmwm2 higher bound of CI, gmwm1 Implied WV, gmwm2 Implied WV."
Please check examples for help.
melt()
is used to convert the data frame from wide format to long format. However,
melt()
cannot deal with expressions, so the user cannot supply expressions to the parameter
facet.label
. Users should convert expressions into characters via as.character()
.
If you meet the error "polygon edge not found", it is complaining that you don't have enough space to
plot the graph. If you are using RStudio, you can adjust the plot window. You can also open graphical window by using
quartz()
(Mac/Linux) or windows()
(Windows PC).
Wenchao
## Not run: #Simulate data set.seed(8836) n = 1000 x = gen_gts(n, AR1(phi = .1, sigma2 = 1) + AR1(phi = 0.95, sigma2 = .1)) x[1] = 1000 #Robust gmwm works better for contaminated data GMWM1 = gmwm(2*AR1()+RW(), data = x, robust = TRUE, eff = 0.9) GMWM2 = gmwm(2*AR1()+RW(), data = x, robust = TRUE, eff = 0.6) GMWM3 = gmwm(2*AR1()+RW(), data = x, robust = FALSE) # How order.eff works: compare_eff(GMWM1, GMWM2, GMWM3, order.eff = FALSE) compare_eff(GMWM1, GMWM2, GMWM3, order.eff = TRUE) # order.eff=TRUE: The objects are plotted in descending order of model efficiency. # How to modify facet.label compare_eff(GMWM2, GMWM3, order.eff = FALSE, facet.label = c('Rob. eff. 0.6', 'Cla.') ) compare_eff(GMWM2, GMWM3, order.eff = TRUE, facet.label = c('Cla.', 'Rob. eff. 0.6') ) # How to modify graph aesthetics compare_eff(GMWM2, GMWM3, order.eff = FALSE, CI.color = c("#003C7D", "#F47F24"), line.color = rep(c("#003C7D", "#F47F24"), 4) ) compare_eff(GMWM2, GMWM3, order.eff = TRUE, CI.color = c("#F47F24", "#003C7D"), line.color = rep(c("#F47F24", "#003C7D"), 4) ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.