OpasnetUtils/Interpret
From Opasnet
Moderator:Nobody (see all) Click here to sign up. 
This page is a stub. You may improve it into a full page. 
Upload data

Description
Interpret takes a vector or data.frame as argument. And returns a data.frame with certain textual inputs interpreted as probability distributions.
Example  Regular expression  Interpretation 

12 000  # #  12000. Text is interpreted as number if space removal makes it a number. 
14,23  #  14.23. Minus in the beginning of entry is interpreted as minus, not a sign for a range. 
50  125  #  #  Uniform distribution between 50 and 125. 
< 4  < #  Uniform distribution between 0 and 4. 
12 345  23.56  #  #  Uniform distribution between 12345 and 23.56. 
1  150  #  #  Loguniform distribution between 1 and 150 (Loguniformity is assumed if the ratio of upper to lower is > 100) 
3.1 ± 1.2 or 3.1 + 1.2  # ± # or # + #  Normal distribution with mean 3.1 and SD 1.2 
2.4 (1.8  3.0)  # (#  #)  Normal distribution with mean 2.4 and 95 % confidence interval from 1.8 to 3.0 
2.4 (2.0  3.2)  # (#  #)  Lognormal distribution with mean 2.4 and 95 % confidence interval from 2.0 to 3.0. Lognormality is assumed if the difference from mean to upper limit is => 50 % greater than from mean to lower limit. 
0:0.5:1  #:#:#  Triangular distribution. Inputs are always sorted so order of arguments doesn't matter. 
0; 1; 4  #;#;#  A random sample of the given values with replacement. Equal probabilities assumed. 
←arg4707: . Make a generic format "distribution,param1,param2,..." where "distribution" is the name of a distribution function to use wit parameters param1, param2,... . Jouni (talk) 16:56, 7 June 2019 (UTC) (type: truth; paradigms: science: defense)
Code
https://www.opasnet.org/svn/opasnet_utils/trunk/R/Interpret.r
See also
 A previous version of this code was called Input.interp
 Objectoriented programming in Opasnet
 Opasnet (R library)