propsens {ipptoolbox} | R Documentation |
Routines for propagating BPAs and sensitivity analysis.
dsevalmc(fhandle, x, mcIT, optimizer = dsbound, corr = NULL, samples = NULL, fnoptions = NULL) dssensitivity(x, parnums, fhandle, uncfn, mcIT, pinch_samples, pinch_type = NULL, optimizer = dsmonotonous, fnoptions = NULL)
fhandle |
Function handle of type f(x,...), where x is the vector of uncertain variables. |
x |
List of BPAs representing each variable |
mcIT |
Number of Monte Carlo iterations |
optimizer |
Optimizer for solving interval problems. Currently implemented: "dsbound" for monotonously increasing functions, "dsmonotonous" for monotonous functions (unknown direction) and "dsopt" for local optimization using L-BFGS. |
corr |
Optional: In case of dependent inputs: Vector of correlations |
samples |
Currently known samples of the function |
fnoptions |
options to pass to fhandle |
parnums |
Array of parameter numbers for which a sensitivity analysis should be performed. |
uncfn |
Uncertainty function handle (e.g. dsaggwidth). Needs to return a single numeric value for a BPA. |
pinch_samples |
Number of different pinches of an input. |
pinch_type |
Optional: Pinch a 'distribution' (default), 'interval' or 'point'. |
The Monte Carlo propagation engine is the core of the toolbox. It allows propagating BPAs through arbitrary functions. The user can define the amount of Monte Carlo samples and the optimization method. Currently, four methods are implemented (dsbound, dsmonotonous, dsmonotonous2, dsopt).
The example illustrates the propagation process. Two functions are defined, f1 being monotonous and f2 nonmonotonous. The inputs dss1 and dss2 are defined as pboxes. The correlation is set to 0.5. Then, dss1 and dss2 are propagated through f1 under independence and dependence. In the next step, dsevalmc uses the optimizer dsopt to propagate x through f2. The method dssensitivity is called with the aggregated width measure to calculate AW sensitivity.
dsevalmc |
Returns list with two elements: [[1]] contains the result, [[2]] all calculated function points. |
Philipp Limbourg <p.limbourg@uni-due.de>
Ferson, S., J. Hajagos, et al. (2004). Dependence in Dempster-Shafer theory and probability bounds analysis. Sandia Report. Albuquerque, USA, Sandia National Laboratories.
Limbourg, P., R. Savic, et al. (2007). Fault Tree Analysis in an Early Design Stage using the Dempster-Shafer Theory of Evidence. European Conference on Safety and Reliability - ESREL 2007, Stavanger, Norway, Taylor and Francis.
print("Define monotonous function f1 and nonmonotonous function f2"); f1=(function(x){ z <- sqrt(abs(x[,1]+ 2*x[,2]));}); f2=(function(x){ z <- sin(x[,1]+ x[,2]);}); print("Create input BPAs x"); mu1=dsstruct(c(2,3,1)); mu2=dsstruct(c(4,4,1)); dss1=dsodf('qnorm',200,mu1); dss2=dsodf('qnorm',500,mu2); x=list(dss1,dss2) correlations=0.5; print("Propagate through f1 under independence assumption / correlation 0.5"); y_f1_independent=dsevalmc(f1,x,1000) y_f1_dependent=dsevalmc(f1,x,1000,dsbound,correlations) print("Propagate through f2 using optimization"); y_f2=dsevalmc(f2,x,1000,dsopt) print("Plot results:"); dscdf(y_f1_independent[[1]]) dscdf(y_f1_dependent[[1]]) dscdf(y_f2[[1]]) print("Sensitivity on AW measure, inputs 1 & 2"); s=dssensitivity(x,c(1,2),f1,dsaggwidth,20,100,'distribution'); print(s)