Skip to contents

Analyze NetLogo simulation output

Usage

analyze_nl(nl, metrics = getexp(nl, "metrics"), funs = list(mean = mean))

Arguments

nl

nl object

metrics

vector of strings defining metric columns for evaluation. Defaults to metrics of the experiment within the nl object

funs

list with the summary metrics for the sensitivity results

Value

analysis summary tibble

Details

The analyze_nl function runs basic analyses on NetLogo simulation output. In order to execute this function, simulation output needs to be attached to the simdesign first with setsim(nl, "output") <- results.

analyze_nl calls different post-processing analysis functions, depending on the specified method in the simdesign object of the nl object.

The following simdesign are currently supported:

simdesign_ff

Calls analyze_ff. The function calculates aggregated output metrics by dropping random seeds and aggregating values with the provided functions.

simdesign_lhs

Calls analyze_lhs. The function calculates aggregated output metrics by dropping random seeds and aggregating values with the provided functions.

simdesign_sobol

Calls analyze_sobol. The function calculates sobol sensitivity indices from the output results using the sensitivity package.

simdesign_sobol2007

Calls analyze_sobol2007. The function calculates sobol sensitivity indices from the output results using the sensitivity package.

simdesign_soboljansen

Calls analyze_soboljansen. The function calculates sobol sensitivity indices from the output results using the sensitivity package.

simdesign_morris

Calls analyze_morris. The function calculates morris sensitivity indices from the output results using the sensitivity package.

simdesign_eFast

Calls analyze_eFast. The function calculates eFast sensitivity indices from the output results using the sensitivity package.

For the following simdesign no postprocessing analysis function has been implemented yet:

simdesign_simple, simdesign_distinct, simdesign_GenSA, simdesign_GenAlg

Examples


# Load nl object including output data from testdata
nl <- nl_sobol

# Define aggregation measurements:
myfuns <- list(mean=mean, sd=sd, min=min, max=max)

# Calculate sensitivity indices:
analyze_nl(nl, funs = myfuns)
#> [1] "No missing combinations detected!"
#> Registered S3 method overwritten by 'sensitivity':
#>   method    from 
#>   print.src dplyr
#> # A tibble: 18 × 8
#>    original    bias `std. error` `min. c.i.` `max. c.i.` parameter  metric  seed
#>       <dbl>   <dbl>        <dbl>       <dbl>       <dbl> <chr>      <chr>  <dbl>
#>  1    0.114 0.0421        0.163       0            0.429 initial-n… count…  8515
#>  2    0.554 0.0196        0.109       0.307        0.711 initial-n… count…  8515
#>  3    0.346 0             0.215       0            0.900 initial-n… count…  8515
#>  4    0.652 0             0.0607      0.528        0.781 initial-n… count…  8515
#>  5    0     0             0.0995      0            0.223 initial-n… count…  8515
#>  6    0.365 0.0146        0.130       0.0827       0.651 initial-n… count…  8515
#>  7    0.114 0.0107        0.173       0            0.489 initial-n… count…  8515
#>  8    0.554 0             0.111       0.320        0.796 initial-n… count…  8515
#>  9    0.346 0             0.226       0            0.755 initial-n… count…  8515
#> 10    0.652 0.00151       0.0660      0.500        0.780 initial-n… count…  8515
#> 11    0     0             0.100       0            0.217 initial-n… count…  8515
#> 12    0.365 0.0129        0.135       0.0821       0.663 initial-n… count…  8515
#> 13    0.114 0.0167        0.178       0            0.432 initial-n… count…  8515
#> 14    0.554 0.00687       0.102       0.354        0.783 initial-n… count…  8515
#> 15    0.346 0             0.225       0            0.851 initial-n… count…  8515
#> 16    0.652 0             0.0561      0.539        0.763 initial-n… count…  8515
#> 17    0     0             0.105       0            0.222 initial-n… count…  8515
#> 18    0.365 0.0143        0.134       0.117        0.629 initial-n… count…  8515