View source: R/temp_situations.R
temp_situations | R Documentation |
This function simulates a situation, e.g. a conflict, that arises with a certain probability, generates an impact as long as it persists, and has a certain chance of being resolved.
temp_situations(
n,
p_occurrence,
p_resolution,
normal_outcome = 1,
situation_outcome = 0,
var_CV_normal = 0,
var_CV_situation = 0
)
n |
integer; number of values to produce |
p_occurrence |
chance that a situation (e.g. conflict) occurs (probability btw. 0 and 1) |
p_resolution |
chance that the situation disappears (e.g. the conflict gets resolved) (probability btw. 0 and 1) |
normal_outcome |
output value for vector elements that aren't affected by the situation (can be subject to random variation, if var_CV_normal is specified). Defaults to 1. |
situation_outcome |
output value for vector elements that are affected by the situation (can be subject to random variation, if var_CV_situation is specified). Defaults to 0. |
var_CV_normal |
desired coefficient of variation for 'normal' vector elements (in percent). Defaults to 0. |
var_CV_situation |
desired coefficient of variation for elements of the vector that are affected by the situation (in percent). Defaults to 0. |
vector of n numeric values, representing a variable time series, which simulates the effects of a situation that arises with a probability p_occurrence and disappears again with a probability p_resolution
Eike Luedeling
temp_situations(n=30,p_occurrence=0.2,p_resolution=0.5)
temp_situations(n=30,p_occurrence=0.2,p_resolution=0.5,
normal_outcome=10,situation_outcome=100,var_CV_normal=10,
var_CV_situation=40)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.