Rglimclim simulation objects {Rglimclim} | R Documentation |
Simulations produced by the GLCsim
routine are stored in separate files, which may be large especially if daily data are stored. Information about each simulation is stored in a small R object of class GLCsim
; the methods documented here are intended to provide the user with a quick means of summarising and visualising simulation results.
## S3 method for class 'GLCsim' print(x, name=TRUE,...) ## S3 method for class 'GLCsim' summary(object,which.variables,which.sites,which.regions, which.timescales,thresholds,season.defs,...) ## S3 method for class 'summary.GLCsim' print(x, ...) ## S3 method for class 'summary.GLCsim' plot(x,imputation,quantiles, which.variables,which.sites,which.regions, which.timescales,which.stats,which.seasons, plot.titles,ylabs,colours.sim="greyscale", colour.obs="black",...)
x, object |
An object of class |
name |
A logical variable indicating whether the |
which.variables |
A vector selecting the variables for which to produce plots and summaries. If omitted, plots and summaries will be produced for all available variables. Note that the specification of |
which.sites |
An optional character vector of 4-character site codes. If supplied, plots and summaries will be restricted to the corresponding sites; otherwise they will be produced for all sites. |
which.regions |
An optional vector selecting regions for which to produce plots or summaries. If omitted, plots and summaries will be produced for all available regions. Like |
which.timescales |
Either |
thresholds |
A numeric vector the same length as |
season.defs |
A list of numeric vectors, defining months to be grouped together to form "seasons" when processing monthly output files. If not specified, separate summaries are produced for each month of the year. |
... |
Other arguments to generic methods. |
imputation |
For the |
quantiles |
For the |
which.stats |
For the |
which.seasons |
For the |
plot.titles |
For the |
ylabs |
For the |
colours.sim |
Either |
colour.obs |
The colour to use for plotting an imputation envelope if required. Defaults to |
The print
method for the GLCsim
class produces a summary of the simulation settings: input file name, which variables were simulated, the simulation period and numbers of simulations, as well as details of which output has been stored and where the output files are located.
The summary
method is used to produce summary statistics that can be plotted or used for further analysis. The objects that it produces are lists (see "Value" section below) that have their own summary.GLCsim
class.
The print
method for the summary.GLCsim
class produces a concise printout of the summaries that have been calculated and can be useful for (e.g.) finding the relevant names that should be used in a call to the plot
method for this class (i.e. the available choices for the which.variables
, which.regions
arguments etc.).
There is no plot
method for objects of class GLCsim
; plotting is done on objects of class summary.GLCsim
(see "Value" section below). Usually, the most efficient way to plot results of a simulation is precompute all summary statistics via a single call to the summary
method, and then to use multiple calls to plot.summary.GLCsim
to produce plots for subsets of these statistics without requiring any further computations. It may be useful to know the order in which this plot
method produces its plots: it loops over variables and, for each variable, first produces all plots for daily summary statistics (if requested) and then the plots for monthly or seasonal means. For the daily summary statistics, the routine first loops over all sites for which plots have been requested (and, within this, over all statistics that have been requested) and then over all regions. For monthly or seasonal means, the routine just loops over the seasons that have been defined.
If an imputation
argument is supplied to the plot
method, a band will be superimposed on the plots of simulated distributions, showing the range of values found within the imputation
object. This is useful to assess whether the simulations can capture the observed behaviour, taking account of uncertainty in the observations due to missing values. It is worth noting that if the imputation
object is derived from a simulation containing 39 imputations, then the resulting band will be a 95% confidence interval for the actual values of the quantities plotted (because if we could pool the actual value with the 39 imputations, there would be a 1/40 chance that the actual value would be the maximum of the pooled sample and a 1/40 chance that it would be the minimum).
The print
and plot
methods produce NULL
values.
The summary
method produces a list object of class summary.GLCsim
, with components Daily
and Monthly
(which are NULL
unless the corresponding summaries have been selected via the which.timescales
argument). The Daily
component itself contains components Sites
and Regions
, each of which is a 5-dimensional array of summary statistics: the dimensions are Simulation
(simulation number), Month
, Site
or Region
, Variable
and Statistic
. The Monthly
component is a 5-dimensional array of seasonal means for selected regions, with dimensions Simulation
, Region
, Variable
, Year
and Season (months)
; the individual dimnames
for the Season (months)
dimension are of the form (for example) "XXX, YYY, ZZZ"
where XXX
, YYY
and ZZZ
are elements of month.abb
. Note that (a) the seasonal means are computed as a straight average of the corresponding monthly values (so they do not account for different numbers of days in each month) (b) if a season is defined via season.defs
as, for example, c(12,1,2)
then, for year YYYY
, the routine will calculate the mean of each variable for month 12 in year YYYY
and months 1 and 2 in year YYYY+1
.
Because the summary
method produces objects with their own print method, the user cannot see the values of the summaries simply by calling print
on a summary
object. To see the contents of a summary.GLCsim
object in its entirety, use unclass
. Specific parts of the object can be accessed directly using the component names.
A potential source of confusion with these routines is that the which.variables
and which.regions
are specified differently in the GLCsim
and summary.GLCsim
methods. In the GLCsim
methods, they should be supplied as numeric vectors; in the summary.GLCsim
method(s) they should be supplied as character vectors, corresponding to the required dimnames
of the GLCsim
object to which they are applied.
Richard Chandler (r.chandler@ucl.ac.uk)