Difference between revisions of "Category:OpasnetUtils"

From Testiwiki
Jump to: navigation, search
(update)
(text moved to OpasnetUtils)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Opasnet]]
+
Pages that relate to the [[R]] package [[OpasnetUtils]] (previously called OpasnetBaseUtils).
[[Category:R tools]]
 
 
 
==OpasnetUtils features==
 
[[Modelling in Opasnet]] is done using R and the OpasnetUtils package provides most of the actual tools. Most of the package revolves around the ovariable-class.
 
 
 
===Ovariables===
 
The ovariable is a class defined by OpasnetUtils. It has eight separate "slots" that can be accessed using X@slot:
 
*name
 
**Name of <self> is a requirement since R doesn't support self reference.
 
*output
 
**Current definition of <self>.
 
**A single data.frame (a 2D table type in R)
 
**Not defined until <self> is evaluated.
 
*data
 
**A single data.frame that defines <self> as such.
 
**May include textual regular expressions that describe probability distributions which can be interpreted by [[OpasnetUtils/Interpret]].
 
*marginal
 
**A logical vector that indicates full marginal indices of @output.
 
*formula
 
**A function that defines <self>.
 
**Should return either a data.frame or an ovariable.
 
*dependencies
 
**A data.frame that contains names and Rtools or Opasnet tokens/identifiers of variables required for using @formula.
 
**Dependencies will be fetched and evaluated upon <self> evaluation.
 
*ddata
 
**A string containing an Opasnet identifier (i.e. Op_en1000).
 
**This identifier is used to download data from the Opasnet database for the @data slot upon <self> evaluation.
 
 
 
The general nature of ovariables means that they should not be modified to match a specific model but rather define the variable in question as extensively as possible under it's scope. To match the scope of specific models variables can be modified by supplying orders upstream (outwards in the recursion tree). These orders are checked for upon evaluation. For example decisions in decision analysis can be supplied this way:
 
#pick an endpoint
 
#make decision variables for any upstream variables
 
#evaluate endpoint
 
#optimize between options defined in decisions.
 
Other orders include: collapse of marginal columns by sums, means or sampling to reduce data size and passing input from model level without redefining the whole variable. It is also possible to redefine any specific variable before starting the recursive evaluation, in which case the recursion stops at the defined variable (dependencies are only fetched if they do not already exist to avoid unnecessary computation).
 
 
 
===Utilising ovariables===
 
Defining and analyzing endpoints of a model can be as easy as Fetching a relevant variable, evaluating it (using EvalOutput) and using some of the available functions (i.e. summary() for ovariables).
 
 
 
...
 
 
 
==Installation==
 
OpasnetUtils is available for any platforms capable for running R from the CRAN repository. Use the drop down menu in the RGui or the R command install.packages("OpasnetUtils") to download the most recent official release.
 
 
 
===SVN repository===
 
If you would like to acquire the most recent version, you are welcome to download and compile our source code which is available at https://www.opasnet.org/svn/opasnet_utils/trunk/. For most recent function definitions see [https://www.opasnet.org/svn/opasnet_utils/trunk/R/ the R sub folder]. Compilation on Windows machines requires R tools (See the CRAN homepage for more information).
 
 
 
==Files==
 
 
 
[[File:OpasnetUtils-manual.pdf]]
 

Latest revision as of 08:02, 30 November 2016

Pages that relate to the R package OpasnetUtils (previously called OpasnetBaseUtils).