View source: R/get_relative_values.R
get_relative_values | R Documentation |
For each policy alternative, this function finds the the model output values for each simulation run at the specified time points relative to the peak (or minimum) value.
get_relative_values(data, max_min_values_list, t_s, t_ss, Dt_max = TRUE)
data |
A list of data.frames (one data.frame for each policy alternative). |
max_min_values_list |
A list generated by |
t_s |
The total time window to examine before and after the peak (or minimum) value. |
t_ss |
The interval size for sampling time points within the specified
time window |
Dt_max |
A logical value indicating whether the decision threshold
is a maximum ( |
A list of nested lists with the following elements: (i) a data.frame of values recorded at specific time steps relative to the peak time (e.g., peak-10, peak, peak+10) for each model run, and (ii) a vector of the names of each time step ex. minus_30,minus_20,...,plus_20, plus_30.
Each data.frame in data
contains the results from multiple model
runs using different parameter sets (e.g., from probabilistic sensitivity,
uncertainty, or Bayesian inference analysis). The first column contains
the model time and subsequent columns contain the predicted output for
each simulation run at the respective time.
The model time in the first column must contain numeric values indicating
a simulation time (ex. 1, 2, 3,...) or dates (ex. "2021-01-01", "2021-01-02")
which must be in R
Date format (i.e., class="Date"). To ensure a consistent
basis for comparison, the model time in the first column should be the same for
each policy alternative (data.frame).
tmin <- "2021-01-01"
tmax <- "2021-04-10"
D <- 750
t_s <- 20
t_ss <- 10
peak_values_list <- get_max_min_values(
psa_data,
tmin = tmin,
tmax = tmax,
Dt_max = TRUE
)
peak_temporal_list <- get_relative_values(
psa_data,
peak_values_list,
t_s = t_s,
t_ss = t_ss
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.