ra_gsa: Function to perform a global sensitivity analysis using...

View source: R/ra_gsa.R

ra_gsaR Documentation

Function to perform a global sensitivity analysis using random forest.

Description

This function is based on the publication: Global sensitivity analysis for complex ecological models: a case study of riparian cottonwood population dynamics by Harper et. al 2011. This method combines Random Forest and CART to rank the most influential parameters in the main outcome and provide a graphic representation of the interaction between the parameters in the outcom.

Usage

ra_gsa(data, f, main = "", seed = 1, palette = "-RdYlGn", tree = "none")

Arguments

data

data set for the analysis

f

formula

seed

seed used for replication purposes

palette

Color palette for the static tree

tree

Type of tree. options include: 'none' no tree, 'interactive' interactive visualization with visNetwork, and 'static' static plot with rpart.plot

mainMain

title for the plots

Value

A list with the following elements: $VarianceExp The variance explained by the GSA, $RelImport a plot ranking the variables by their relative importance

Examples

set.seed(1)

# use one of the example models
m <- quantrra::OIRSA

# run the model
output <- ra_run(m = m$nodes, nsim = 1000)

# Run the GSA on the model output
ra_gsa(
  data = output,
  f = P ~ P1 + P2 + P3 + R1 + R2
)


jpablo91/QuantRRA documentation built on July 3, 2024, 10:46 p.m.