Difference between revisions of "OpasnetUtils/Interpret"

From Testiwiki
Jump to: navigation, search
m (Description)
m
 
Line 31: Line 31:
 
| 0:0.5:1 || #:#:# ||Triangular distribution. Inputs are always sorted so order of arguments doesn't matter.
 
| 0:0.5:1 || #:#:# ||Triangular distribution. Inputs are always sorted so order of arguments doesn't matter.
 
|}
 
|}
 +
 +
{{comment|# |This would be nice as well: 2;4;7: Each entry (2, 4, and 7 in this case) are equally likely to occur. Entries can also be text.|--[[User:Jouni|Jouni]] 19:45, 24 January 2013 (EET)}}
  
 
==Code==
 
==Code==
Line 38: Line 40:
 
==See also==
 
==See also==
  
 +
* A previous version of this code was called [http://en.opasnet.org/en-opwiki/index.php?title=Input.interp&oldid=25631 Input.interp]
 
* [[Object-oriented programming in Opasnet]]
 
* [[Object-oriented programming in Opasnet]]
 
* [[Opasnet (R library)]]
 
* [[Opasnet (R library)]]

Latest revision as of 17:45, 24 January 2013



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.

--# : This would be nice as well: 2;4;7: Each entry (2, 4, and 7 in this case) are equally likely to occur. Entries can also be text. --Jouni 19:45, 24 January 2013 (EET)

Code

https://www.opasnet.org/svn/opasnet_utils/trunk/R/Interpret.r

See also