analyze_parameter_scan: Analyze results of a parameter scan

View source: R/parameter_scan.R

analyze_parameter_scanR Documentation

Analyze results of a parameter scan

Description

Analyze results of a parameter scan

Usage

analyze_parameter_scan(
  parameter_scan_results,
  datafile = "",
  smooth_interval = 28
)

Arguments

parameter_scan_results

String or List. If a string, it is interpreted as the name of a rds file that contains the results of a parameter scan which is then loaded using readRDS(). Otherwise, it should be the output of run_parameter_scan() directly.

datafile

Name or path to a file containing measured data. The model results in parameter_scan_results are compared to the data therein. If empty, the site is inferred from the ModvegeSite objects in parameter_scan_results and a corresponding data file is searched for in 'getOption("growR.data_dir", default = "data").

smooth_interval

Int. Number of days over which the variable dBM is smoothened. Should be set to make experimental data and simulated data to be as comparable as possible.

Value

analyzed A list with five keys: dBM, cBM, cBM_end, metrics and params.

dBM

A data.frame with 1 + n_params + n_metrics columns where each row represents a different parameter combination. The first column (n) gives the row number and is used to identify a parameter combination. The subsequent n_params columns give the values of the parameters used in this combination. The final n_metrics columns give the resulting performance score of the model run with these parameters for each metric applied to model variable dBM.

cBM

A data.frame of same format as for the key dBM. The first n_params + 1 columns are identical to the data.frame in dBM. The difference is that the final n_metrics columns give performance scores with respect to the model variable cBM.

cBM_end

A data.frame analogous to dBM and cBM, only this time the last n_metrics columns give performance scores with respect to the variable cBM_end, which is the final value of cBM, i.e. the cumulative grown biomass at the end of the year.

params

A vector containing the names of the scanned parameters. These are also the column names of columns 2:(n_params+1) in results.

metrics

A vector containing the names of the employed performance metrics. These are also the column names of the last n_metrics columns in results.

See Also

run_parameter_scan(), readRDS()

Examples

# There needs to be data available with which the model is to be compared.
# For this example, use data provided by the package.
path = system.file("extdata", package = "growR")
datafile = file.path(path, "posieux1.csv")

# We also use example parameter scan data provided by the package.
# In the real world, you would generally create your own data using 
# `run_parameter_scan()`.
analyze_parameter_scan(parameter_scan_example, datafile = datafile)


growR documentation built on May 29, 2024, 9:12 a.m.