collectParams: Collect Parameters

Description Usage Arguments Value Examples

View source: R/collectParams.R

Description

Collects from the global environment the list of values necessary to execute GUMCV and GUMS1/2 on model fExpr. The names of the variables should be consistent with the parameters of fExpr. For a variable named 'var', the mean value is seached in variable var, the standard uncertainty in var.mu, the pdf in var.pdf, and the degrees of freedom in var.df.

Usage

1
collectParams(fExpr, mc = TRUE)

Arguments

fExpr

An expression or a function object.

mc

Flag to detect data for Monte Carlo sampling.

Value

A list containing:

x.names

vector of names for the input parameters

x.mu

vector of mean values for the input parameters

x.u

vector of standard uncertainties for the input parameters

x.pdf

vector of pfd names for the input parameters

x.df

vector of degrees of freedom for the input parameters

fExpr

same as input

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
fExpr = function(V,T,a,c) T*V + V^2/(2*a*c) 

V = 130 /3.6 ; V.u = 4/3.6         ; V.pdf = "norm"
T = 1        ; T.u = 0.5 / 3^0.5   ; T.pdf = "unif"
a = 5        ; a.u = 0.5           ; a.pdf = "norm"        
c = 0.7      ; c.u = 0.2/6         ; c.pdf = "norm"
# Collect parameters in environment
params=collectParams(fExpr)
# GUM
G = with(params, 
         gumCV(fExpr=fExpr,x.mu=x.mu,x.u=x.u)
         )

ppernot/rgumlib documentation built on May 25, 2019, 11:24 a.m.