ra_run: Run the stochastic model using a quantrra model table

View source: R/ra_run.R

ra_runR Documentation

Run the stochastic model using a quantrra model table

Description

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'.

Usage

ra_run(m, nsim)

Arguments

m

Model file

nsim

Number of simulations

Value

A data frame with the values for each of the inputs and outputs

Examples

# define a model table using one of the provided examples
m <- quantrra::OIRSA

ra_run(m = m$nodes, nsim = 10) # Run the model 


jpablo91/QuantRRA documentation built on July 3, 2024, 10:46 p.m.