Learn R Programming

SSM (version 1.0.1)

sensitivity.plot: Plot the sensitivity indices of a smooth supersaturated model.

Description

sensitivity.plot visualises the sensitivity indices of a given smooth supersaturated model using barplot. If the SA flag was not set to TRUE when fit.ssm was run to fit the model, then update.sensitivity should be used to compute the model variances. If not, this function will return an error message.

Usage

sensitivity.plot(ssm, type = "main_total", ...)

Arguments

ssm

An SSM object. Must have relevant sensitivity indices in the appropriate slots, either from setting SA = TRUE in fit.ssm or by using update.sensitivity.

type

(optional) Character. Determines the type of barplot. One of "sobol", "main_sobol", "main_total", or "total". Default behaviour is "main_total".

...

arguments passed to the barplot function call.

Details

There are four classes of plot available:

  • "sobol" Produces a barplot of all Sobol indices. If there are more than 10 factors then Sobol indices will not have been computed for interactions and only the Sobol indices for main effects will be plotted. Main effects are in red, interactions are in grey.

  • "main_sobol" Produces a barplot of Sobol indices for main effects only.

  • "main_total" Produces a barplot of Total indices for main effects only. This is the default behaviour.

  • "total" Produces a barplot of Total indices for main effects and all second order interactions. Main effects are in red, interactions are in grey.

Note that variables and interactions are not labelled in the plots since there can be too many bars to label clearly.

Examples

Run this code
# A 20 point design in four variables
X <- matrix(runif(80, -1, 1), ncol = 4)
Y <- runif(20)
s <- fit.ssm(X, Y, SA = TRUE)
sensitivity.plot(s)

# In the next plots, the grey bars indicate interactions.
sensitivity.plot(s, "sobol")
sensitivity.plot(s, "total")
# Identifying particular indices is best done using the information held in
# the SSM object.  The following orders s@total_int_factors so the
# interaction indicated by the top row is the most important.
ind <- order(s@total_int, decreasing = TRUE)
s@total_int_factors[ind, ]

Run the code above in your browser using DataLab