wave_variance: Emulator Variance across waves

Description Usage Arguments Details Value Examples

Description

Plots the emulator variance for each output across emulator waves.

Usage

1
2
3
4
5
6
7
8
wave_variance(
  waves,
  output_names,
  plot_dirs = names(waves[[1]][[1]]$ranges)[1:2],
  wave_numbers = 1:length(waves),
  n_points = 40,
  sd = FALSE
)

Arguments

waves

A list of lists of Emulator objects, corresponding to the waves

output_names

The list of desired outputs to be plotted

plot_dirs

The (two) input parameters to be plotted.

wave_numbers

A numeric vector of which waves to plot.

n_points

The number of grid points per plotting dimension. Default: 20

sd

Should the standard deviation be plotted instead of the variance? Default: FALSE

Details

It is instructive to look at the change in emulator variance over successive waves, rather than across successive outputs. This function provides a means of doing so quickly for each emulator output.

A 2d slice is taken across the input space, where mid-range values of any non-plotted parameters are fixed. The emulator variance (or standard deviation) is then calculated across the two-dimensional subspace for each wave, and for each output.

Value

A list of data.frames, each corresponding to a given output over waves.

Examples

1
2
3
4
 outputs <- c('nS', 'nI', 'nR')
 em_var <- wave_variance(GillespieMultiWaveEmulators, outputs, n_points = 5)
 em_sd <- wave_variance(GillespieMultiWaveEmulators, c('nI', 'nR'),
  plot_dirs = c('aIR', 'aSR'), n_points = 5, sd = TRUE)

Tandethsquire/emulatorr documentation built on April 12, 2021, 1:08 a.m.