ra_run | R Documentation |
Run the stochastic model using a quantrra model table. In the model table in quantrra, each row represents a node in the scenario tree, with it's associated id, label, level of hierarchy, distribution and formula. Each node requires an id which is the short name used in the formulas, and a a label which is meant to provide a more detailed description of the node. The hierarchy level of the nodes will specify the order in which the nodes will be executed in the calculation of the risk; multiple nodes can be in the same hierarchy level. There are two types of nodes in quantrra: inputs and outputs. The input nodes are nodes that require the user specification of a probability distribution and the parameters associated. Output nodes are nodes that require the user to specify a formula or R function that will be executed using other nodes of lower hierarchy. A example model table is provided inside the package and can be accessed using 'quantrra::OIRSA'.
ra_run(m, nsim)
m |
Model file |
nsim |
Number of simulations |
A data frame with the values for each of the inputs and outputs
# define a model table using one of the provided examples
m <- quantrra::OIRSA
ra_run(m = m$nodes, nsim = 10) # Run the model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.