plot_sobol {sensobol}R Documentation

Plot Sobol' first and total-order indices

Description

Plot Sobol' first and total-order indices

Usage

plot_sobol(x, dummy = NULL, type = 1)

Arguments

x

A data.table.

dummy

The output of the sobol_ci_dummy function. If supplied and type = 1, the plot includes an horizontal transparent frame showing the confidence intervals of the first and total-order indices for the dummy parameter.

type

An integer. If type = 1, it plots first and total effects. If type = 2, it plots second-order effects. If type = 3, it plots third-order effects. Default is type = 1.

Value

A ggplot object.

Examples

# Define settings:
n <- 500; k <- 8; R <- 100
# Design the sample matrix:
A <- sobol_matrices(n = n, k = k, second = TRUE, third = TRUE)
# Compute the model output:
Y <- sobol_Fun(A)
# Compute the Sobol' indices:
sens <- sobol_indices(Y = Y, params = colnames(data.frame(A)),
R = R, n = n, parallel = "no", ncpus = 1, second = TRUE, third = TRUE)
# Compute the Sobol' indices for the dummy parameter:
s.dummy <- sobol_dummy(Y = Y, params = colnames(data.frame(A)), R = R, n = n)
# Compute confidence intervals:
sens.ci <- sobol_ci(sens, params = colnames(data.frame(A)), type = "norm", conf = 0.95)
# Compute confidence intervals for the dummy parameter:
s.dummy.ci <- sobol_ci_dummy(s.dummy, type = "norm", conf = 0.95)
# Plot Sobol' indices:
plot_sobol(sens.ci, dummy = s.dummy.ci, type = 1)

[Package sensobol version 0.2.2 Index]