run_ensemble_bayes: Run an ensemble of offline land models and complete Bayesian...

Description Usage Arguments Details Value Output Author(s)

View source: R/main.R

Description

Parameter combinations are selected by generating a quasi-random sequence and mapping it to a specified range for each parameter. Then, each parameter set is run through the offline land model in each of the Perfect, Adaptive, HybridLinearAdaptive, HybridPerfectAdaptive, and Linear variants. (I.e., if N parameter sets are selected, then 5N scenarios are run.)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
run_ensemble_bayes(
  N = 500,
  aOutputDir = "./outputs",
  skip = 0,
  lpdf = get_lpdf(1),
  lprior = uniform_prior,
  aType = "Hindcast",
  aIncludeSubsidies = FALSE,
  aDifferentiateParamByCrop = FALSE,
  aSampleType = "LatinHyperCube",
  aTotalSamplesPlanned = 500,
  logparallel = NULL
)

Arguments

N

Number of parameter sets to select

aOutputDir

Output directory

skip

Number of iterations to skip (i.e., if building on another run.)

lpdf

Log-likelihood function. Used only if Bayesian posteriors are being run.

lprior

Log-prior probability density function. Used only if Bayesian posteriors are being run.

aType

Scenario type: either "Reference" or "Hindcast"

aIncludeSubsidies

Boolean indicating subsidies should be added to profit

aDifferentiateParamByCrop

Boolean indicating whether all crops should use the same expectation parameters

aSampleType

String indicating what type of sampling, currently only "LatinHyperCube" and "Sobol" are supported

aTotalSamplesPlanned

Number of samples planned. For Latin Hypercube, we need to know the total before we start.

logparallel

Name of directory to use for parallel workers' log files. If NULL, then don't write log files.

Details

If the scenario type is "Hindcast", then after each model has been run, the Bayesian analysis will be run so that its results can be stored with the rest of the ScenarioInfo structure.

Value

List of ScenarioInfo objects for the ensemble members

Output

The model results are written to a series of files in the specified output directory. The list of ScenarioInfo objects is written to a file called bayes-scenario-info.rds in the output directory. This file can be loaded with a command such as scenaro_list <- readRDS('output/bayes-scenario-info.rds'). These objects contain links to the model output files, as well as the posterior probability density tables, if the Bayesian analysis was run.

Author(s)

KVC November 2017


JGCRI/gcamland documentation built on Oct. 6, 2020, 5:30 p.m.