pcSobol-class: An S4 class to return the results of sensitivity analyses

Description Usage Arguments Value Methods (by generic) Slots References Examples

Description

An S4 class to return the results of sensitivity analyses

Plots pcSobol S4 object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S4 method for signature 'pcSobol'
print(x, ...)

## S4 method for signature 'pcSobol'
show(object)

## S4 method for signature 'pcSobol'
plot(x, outcome_var = "Outcome",
  legend_pos = c("topright", "bottomright", "bottomleft", "topleft"),
  ptype = c("all", "fo", "total"))

Arguments

x

The result slot of an object created by sobol_sa.

...

ignored

object

S4 pcSA object

outcome_var

Optional character vector for labeling the outcome variable in the plot. Default is "Outcome".

legend_pos

Character vector that sets the position of the legend to one of: "topright", "bottomright", "bottomleft", or "topleft".

ptype

Optional Character vector for first order, total, or all effects c("all", "fo", "total").

Value

Returns a ggplot2 plot.

Methods (by generic)

Slots

call

Language from the call of the function.

result

sobol2007 s3 class from sensitivity package.

timing

Numeric vector length one with the total elapsed time it took to execute.

session

the results from calling sessionInfo() at end of pc_sa function.

References

J. C. Thiele, W. Kurth, V. Grimm, Facilitating Parameter Estimation and Sensitivity Analysis of Agent-Based Models: A Cookbook Using NetLogo and R. Journal of Artificial Societies and Social Simulation. 17, 11 (2014).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
fake_abm <- function(params, out) {
  x1 <- params[1]
  x2 <- params[2]
  if (out=="sq") return(x1^2 + x2 + rnorm(1, 0))
  if (out=="ident") return(x1 + x2 + rnorm(1, 0))
}
inputs <- lapply(list(param1 = NA, param2 = NA), 
                 function(x) list(random_function = "qunif",
                                  ARGS = list(min = 0, max = 1)))
s <- sobol_sa(fake_abm, inputs, "sq")
plot(s)

JohnNay/sa documentation built on May 7, 2019, 12:01 p.m.