Interpret textual data into probability distributions using regular expressions.
interpret(idata, N = NULL, rescol = "Result", dbug = FALSE, ...)
input, character
or data.frame
number of iterations
name of result column, defaults to "Result"
use TRUE
to turn on debug prints
excess arguments are ignored
Returns a data.frame
with an "Iter" column added. Uninterpretable values are converted to NA
s.
Interpretation rules are as follows: Empty space is stripped away. "X-Y" defines a uniform distribution between X and Y, if Y/X is greater than 100 then logarithmic uniform distribution is assumed. Negative X and Y are determined by the number of "-": if 2, X is negative; if 3, both are. "<X" defines a uniform distribution between 0 and X. "X+-Y" defines a normal distribution with mean X and sd Y. "X(Y-Z)" defines a normal distribution where Y-Z is assumed the 95-percent confidence interval, from which sd is determined. If distance from mean to the higher boundary is 50-percent higher than to lower boundary log normality is assumed. "X:Y:Z" defines a triangular distribution with min, mode and max (can be given in any order). "X1;X2;...;Xn" defines a random unbiased sample (with replacement) between the given elements. Numeric values are left as is. See http://en.opasnet.org/w/Interpret for a table.
See also: http://en.opasnet.org/
interpret(c("1-4", "1-1000"), N = 5)
Run the code above in your browser using DataLab