Learn R Programming

capm (version 0.9.1)

CalculateGlobalSens: Global sensitivity analysis

Description

Wraper for sensRange function, which calculates population size sensitivities, to parameters used in one of the following functions: SolveIASA, SolveSI or SolveTC.

Usage

CalculateGlobalSens(model.out = NULL, ranges = NULL, sensv = NULL, all = FALSE)

Arguments

model.out
an output from one of the previous function or a list with equivalent structure.
ranges
output from the SetRanges function, applied to the pars argument used in the function previously specified in model.out.
sensv
string with the name of the the output variables for which the sensitivity needs to be estimated.
all
logical. If FALSE, sensitivity ranges are calculated for each parameter. If TRUE, sensitivity ranges are calculated for the combination of all aparameters.

Value

A data.frame (extended by summary.sensRange when all == TRUE) containing the parameter set and the corresponding values of the sensitivity output variables.

Details

When all is equal to TRUE, dist argument in sensRange is defined as "latin" and when equal to FALSE, as "grid". The num argument in sensRange is defined as 100.

References

Soetaert K and Petzoldt T (2010). Inverse modelling, sensitivity and monte carlo analysis in R using package FME. Journal of Statistical Software, 33(3), pp. 1-28.

Reichert P and Kfinsch HR (2001). Practical identifiability analysis of large environmental simulation models. Water Resources Research, 37(4), pp.1015-1030.

http://oswaldosantos.github.io/capm

See Also

sensRange.

Examples

Run this code
#####################
## SolveIASA model ##
#####################

## Parameters and intial conditions.
pars.solve.iasa = c(
   b1 = 21871, b2 = 4374,
   df1 = 0.104, dm1 = 0.098, df2 = 0.125, dm2 = 0.118,
   sf1 = 0.069, sf2 = 0.05, sm1 = 0.028, sm2 = 0.05,
   k1 = 98050, k2 = 8055, h1 = 1, h2 = 0.5,
   a = 0.054, alpha = 0.1, v = 0.2, z = 0.1)
   
init.solve.iasa = c(
   f1 = 33425, fs1 = 10865,
   m1 = 38039, ms1 = 6808,
   f2 = 3343, fs2 = 109,
   m2 = 3804, ms2 = 68)
   

# Solve for point estimates.
solve.iasa.pt <- SolveIASA(pars = pars.solve.iasa, 
                          init = init.solve.iasa, 
                          time = 0:15, method = 'rk4')

## Set ranges 10 % greater and lesser than the
## point estimates.
rg.solve.iasa <- SetRanges(pars = pars.solve.iasa)

## Calculate golobal sensitivity of combined parameters.
## To calculate global sensitivity to each parameter, set
## all as FALSE.
glob.all.solve.iasa <- CalculateGlobalSens(
  model.out = solve.iasa.pt,
  ranges = rg.solve.iasa, 
  sensv = 'n2', all = TRUE)

Run the code above in your browser using DataLab