generateScenario: Produces time series of hydroclimatic variables for an...

View source: R/control.R

generateScenarioR Documentation

Produces time series of hydroclimatic variables for an exposure target.

Description

generateScenario is the base function used by generateScenarios. The function produces time series of hydroclimatic variables using requested climate attributes that correspond to a single target in the exposure space. The function argument definitions are detailed in the documentation of generateScenarios; please refer to that documentation using ?generateScenarios.

Usage

generateScenario(
  reference,
  expTarg,
  simLengthNyrs = NULL,
  seedID = NULL,
  controlFile = NULL
)

Arguments

reference

data.frame or list; contains reference daily climate data.
For single site data, reference is a data.frame with columns named year, month, day, *variable_name1*, *variable_name2*. Note that the first three columns of the data.frame contain the year, month, and day of the data. The columns have to be named as specified. For multi-site data, reference is a list, with elements named year, month, day, *variable_name1*, *variable_name2*. List format is suitable for both single and multi-site data. Climate variables are specified as matrices, with columns for each site.
Use viewModels() to view the valid variable names. Please refer to data provided with the package that may be loaded using data(tankDat) and data(barossaDat) for examples of the expected format of single site and multi-site reference.

expTarg

a named vector; the attributes at the target location in the exposure space generateScenario is intended to be used to adapt the functionality of generateScenarios for use in a parallel computing environment.

simLengthNyrs

a number; a scalar that specifies the length in years of each generated scenario. This argument is used only with stochastic generation. If NULL (the default), the generated simulation will be as long as reference.

seedID

a number; a scalar that specifies the seed to be used for the first replicate. Subsequent replicates will use seeds incremented by one. If seedID is NULL (which is the default), the function will use a random seed for stochastic time series generation. The seed used will be specified in the output. This argument is intended for use in cases that aim to reproduce an existing simulation.

controlFile

a string; to specify the model/optimisation options used for simulating time series data. The valid values are:

  • NULL: the simulation uses the foreSIGHT default stochastic model settings.

  • "scaling": the simulation uses scaling (simple/seasonal) instead of a stochastic model. If all attributes in expSpace are annual totals/averages, then simple scaling is used. If seasonality ratio attributes are also included in expSpace, then seasonal scaling is used.

  • path to a JSON file: the JSON file contains advanced options specify the stochastic model and optimisation inputs. These options can be used to change stochastic model types, overwrite default model parameter bounds, change default optimisation arguments, and set penalty attributes to be used in optimisation. Please refer to the function writeControlFile in order to create an controlFile JSON file.

See Also

generateScenarios


foreSIGHT documentation built on Oct. 19, 2023, 9:08 a.m.