monte_carlo: Monte Carlo Simulation on a Decision Tree

View source: R/monte_carlo.R

monte_carloR Documentation

Monte Carlo Simulation on a Decision Tree

Description

Conducts a Monte Carlo simulation over a provided decision tree for a specified number of runs. Optionally, the function can save the random options selected for the analysis in a .csv file named "MC options.csv".

Usage

monte_carlo(tree, num_runs, write_to_file = NULL)

Arguments

tree

Tree object to be used in the simulation.

num_runs

numeric indicating the number of Monte Carlo simulations to be executed.

write_to_file

character Name of the file created to save the Monte Carlo's results. If NULL, don't write any file. Default is NULL

Value

A matrix containing the results of the Monte Carlo simulation.

Examples

tree <- dexisensitivity::masc2
MC <- monte_carlo(tree, 100)


dexisensitivity documentation built on Oct. 30, 2024, 1:08 a.m.