autoplot
Method for a List of Prediction Results
autoplot.predRLList.Rd
Autoplot a list of prediction results, usually to compare them.
Arguments
- object
A named list with all its elements of class
"predRL"
.- groupName
A string used to label the legend.
- ...
Not used yet.
Details
The list must be given the S3 class "predRLList"
in order
to call the autoplot
method. The method can be used to draw
several curves on the same plot or to use facets thanks to the
functions facet_grid
or facte_wrap
.
Examples
prior <- set_prior(prior = "flatflat", model = "gev")
post <- rpost_rcpp(n = 10000, model = "gev", prior = prior,
data = portpirie)
pfitGEV0 <- GEVBayes0(MCMC = post$sim_vals, yMax = portpirie)
pL <- list("1 year" = predict(pfitGEV0),
"10 year"= predict(pfitGEV0, newDuration = 10))
class(pL) <- "predRLList"
g <- autoplot(pL, groupName = "period") +
ggtitle("Predictive RL plot : Bayesian GEV for portpirie") +
theme_gray()
g
g + facet_grid(NewDuration ~ ., scales = "free_y")