Learn R Programming

radiant.model (version 0.8.0)

simulater: Simulate data for decision analysis

Description

Simulate data for decision analysis

Usage

simulater(const = "", lnorm = "", norm = "", unif = "", discrete = "",
  binom = "", sequ = "", grid = "", data = "", form = "", seed = "",
  name = "", nr = 1000, dat = NULL)

Arguments

const

A string listing the constants to include in the analysis (e.g., "cost = 3; size = 4")

lnorm

A string listing the log-normally distributed random variables to include in the analysis (e.g., "demand 2000 1000" where the first number is the log-mean and the second is the log-standard deviation)

norm

A string listing the normally distributed random variables to include in the analysis (e.g., "demand 2000 1000" where the first number is the mean and the second is the standard deviation)

unif

A string listing the uniformly distributed random variables to include in the analysis (e.g., "demand 0 1" where the first number is the minimum value and the second is the maximum value)

discrete

A string listing the random variables with a discrete distribution to include in the analysis (e.g., "price 5 8 .3 .7" where the first set of numbers are the values and the second set the probabilities

binom

A string listing the random variables with a binomail distribution to include in the analysis (e.g., "crash 100 .01") where the first number is the number of trials and the second is the probability of success)

sequ

A string listing the start and end for a sequence to include in the analysis (e.g., "trend 1 100 1"). The number of 'steps' is determined by the number of simulations.

grid

A string listing the start, end, and step for a set of sequences to include in the analysis (e.g., "trend 1 100 1"). The number of rows in the expanded will over ride the number of simulations

data

Name of a dataset to be used in the calculations

form

A string with the formula to evaluate (e.g., "profit = demand * (price - cost)")

seed

To repeat a simulation with the same randomly generated values enter a number into Random seed input box.

name

To save the simulated data for further analysis specify a name in the Sim name input box. You can then investigate the simulated data by choosing the specified name from the Datasets dropdown in any of the other Data tabs.

nr

Number of simulations

dat

Data list from previous simulation. Used by repeater function

Value

A data.frame with the created variables

Details

See https://radiant-rstats.github.io/docs/model/simulater.html for an example in Radiant

See Also

summary.simulater to summarize results

plot.simulater to plot results

Examples

Run this code
# NOT RUN {
result <- simulater(const = "cost 3", norm = "demand 2000 1000",
                   discrete = "price 5 8 .3 .7",
                   form = "profit = demand * (price - cost)")

# }

Run the code above in your browser using DataLab