Welcome to DABI_UQToolbox’s documentation!

Contents:

Created on Wed Jul 11 10:40:30 2012

@author: Daniele Bigoni (dabi@imm.dtu.dk)

@version: 0.1

DABIUncertaintyQuantificationToolbox is the collection of tools for Uncertainty Quantification.

@copyright: 2012 Daniele Bigoni

Created on Thu Apr 26 15:15:21 2012

@author: dabi

class DABI_UQToolbox.DABIUncertaintyQuantification.MEPCM_Element(el, dists, distsCond, Ns)[source]
TensorVandermonde(x, usekron=True)[source]

Takes a 2d-array (preferibly (N,DIM)) or list (of array of points for each dimension) If kron == True : take kron product of 1D vandermonde matrices If kron == False : take column multiplication of 1D matrices

isInElement(x)[source]

Takes a 2d-array (preferibly (N,DIM)) or list (of array of points for each dimension)

class DABI_UQToolbox.DABIUncertaintyQuantification.MEPCM_Forest(el1D=None, dists1D=None, distsCond1D=None, Ns1D=None)[source]
refine(toRefIndices, toRefDims, toRefOrders)[source]

refineOrder: 0 = let the order be equal to the parent element. 1 = drop the order of 1

DABI_UQToolbox.DABIUncertaintyQuantification.Experiments(f, samples, params, paramUpdate, action)[source]

Compute the Experiments f on the samples. The implementation uses MPI for parallel computations. INPUT:

  • f : experiment function handle. Signature: f( params )
  • samples : nd-array with the set of samples grouped by the first dimension
  • params: set of parameters to be passed to the experiment
  • action: post processing action
OUTPUT:
Array of computed values, ordered by the first dimension of the array.
DABI_UQToolbox.DABIUncertaintyQuantification.KLExpansion1D(C, N, scFun=None, totVar=1.0)
KLExpansion1D(): Computes the 1D KL expansion of the covariance matrix C, using the
Legendre-Gauss-Loabatto rule for the solution to the generalized eigenvalue problem A * u = lmb * M * u
Syntax:
(x,val,vec,var,Nvar) = KLExpansion1D(C,N,[scFun=None],[totVar=1.])
Input:
  • C = (function) Covariance function C(x1,x2)
  • N = (1d-array,float) number of discretization points
  • scFun = (function) scaling function of coordinates from Legendre-Gauss-Lobatto points to real domain of C(x1,x2)
  • totVar = (float) total variance to be represented by the output KL-expansion
Output:
  • x = (1d-array, float) Legendre-Gauss-Lobatto nodes used
  • val = (1d-array, float) eigenvalues
  • vec = (2d-array, float) normalized eigenvectors. The eigenvector vec[:,i] corresponds to the eigenvalue val[i].
  • var = (float) total variance represented
  • Nvar = (int) number of modes to be consider in order to achieve totVar
DABI_UQToolbox.DABIUncertaintyQuantification.LatinHyperCube(dists, N, experiment, params, paramUpdate, postProc)

Run Latin Hyper Cube Simulations

DABI_UQToolbox.DABIUncertaintyQuantification.MonteCarlo(dists, N, experiment, params, paramUpdate, postProc)[source]

Run Monte Carlo Simulations

DABI_UQToolbox.DABIUncertaintyQuantification.PCM_Tensor(dist, poly, distPoly, N)[source]

Generates the full tensor grid using the list of distributions of the parameters space approximated by the selected polynomials. INPUT:

dist: list of n distributions representing the n-Dimensional random space poly: list of n polynomials (class DABISpectral1D) used for approximating each

of the directions in the random space

distPoly: list of n standard distributions associated to the polynomial selected Ns: list of n integers for the order of polynomial expansion in each direction allocBasis: boolean. True if you want the tensor basis.

OUTPUT: dictionary with the following attributes
‘x’: tensor product of collocation points in the standard distributions ‘w’: tensor product of the weights for cubature/projection rules (sum to 1 or prod(gamma0) respectively) ‘vals’: tensor product of collocation points ‘V’: tensor basis functions
DABI_UQToolbox.DABIUncertaintyQuantification.QuasiMonteCarlo(dists, N, experiment, params, paramUpdate, postProc, skip=None)[source]

Run Quasi Monte Carlo Simulations

DABI_UQToolbox.DABIUncertaintyQuantification.UQ_MEPCM_Tensor(domain, solve, params, solvePostProcessing, paramUpdate, refOrder, minRefOrd=2, maxRefOrd=2, iMax=10, gamma=0.5, theta1=0.01, theta2=0.75)[source]
DESCRIPTION:
UQ_MEPCM_Tensor(solve,params,solvePostProcessing,dists,paramUpdate,polys,distsPoly,N,method) Performs Uncertainty Quantification analysis of the system described by rhs using the Probabilistic Collocation Method by Tensor Product of the random space.
INPUT:
domain: (MEPCM_Forest object) initial domain on which to evaluate the functions solve: function handle to the experiment to be quantified. Signature: sol = solve(sample,params) params: parameters to be passed to the ODE system (these contain the uncertain parameter as well) solvePostProcessing: post processing function called after all the simulation have been run. Signature: solsEl = solvePostProcessing(solsEl). It returns properly aligned solutions per element, meaning that for the solutions in each element solsEl[i] contains an [Ncoll x NDOF] array. paramUpdate: function handle for updating the set of uncertain parameters. Signature: params = paramUpdate(params,sample) refinement: 0 = No refinement, 1 = refinement + partial limiting, 2 = refinement + final limiting iMax: maximum number of refinement iterations gamma: parameter for adaptivity refinement criteria theta1: parameter for adaptivity refinement criteria theta2: parameter for the dimensional refinement criteria
OUTPUT: dictionary with the following attributes
domain: MEPCM_Forest object solsEl: (list #<multi-dim El>) solutions at collocation points per each element meanSol: estimated mean varSol: estimated variance uHatEl: (list #<multi-dim El>) Galerkin coefficients (available only if method == ‘projection’) fEval: total number of solve evalutations
DABI_UQToolbox.DABIUncertaintyQuantification.UQ_PCM_Tensor(solve, params, solvePostProcessing, dists, paramUpdate, polys, distsPoly, Ns, method)[source]
DESCRIPTION:
UQ_PCM_Tensor(solve,params,solvePostProcessing,dists,paramUpdate,polys,distsPoly,N,method) Performs Uncertainty Quantification analysis of the system described by rhs using the Probabilistic Collocation Method by Tensor Product of the random space.
INPUT:
  • solve: function handle to the experiment to be quantified. Signature: sol = solve(sample,params)
  • params: parameters to be passed to the ODE system (these contain the uncertain parameter as well)
  • solvePostProcessing: post processing function called after all the simulation have been run. Signature: sols = solvePostProcessing(sols)
  • dists: list of n scipy.stats distribution functions for each uncertain parameter
  • paramUpdate: function handle for updating the set of uncertain parameters. Signature: params = paramUpdate(params,sample)
  • polys: list of n DABISpectral1D polynomials using for approximating the distribution of the random parameters
  • distsPoly: list of n standard distributions associated to the selected approximating polynomials
  • Ns: list of n integers for the order of polynomial expansion in each random direction
  • method: ‘projection’ use projection rule in order to compute statistics, ‘cubature’ use cubature rule in order to compute statistics
OUTPUT: dictionary with the following attributes
  • ‘Samples’: list of collocation points (samples) used for UQ
  • ‘Y’: solutions at collocation points
  • ‘YHat’: Galerkin coefficients (available only if method == ‘projection’)
  • ‘meanSol’: estimated mean
  • ‘varSol’: estimated variance
DABI_UQToolbox.DABIUncertaintyQuantification.UQ_SparseGrid(solve, params, solvePostProcessing, dists, paramUpdate, method, k, sym=1)[source]
DESCRIPTION:
UQ_PCM_Tensor(solve,params,solvePostProcessing,dists,paramUpdate,polys,distsPoly,N,method) Performs Uncertainty Quantification analysis of the system described by rhs using the Probabilistic Collocation Method by Tensor Product of the random space.
INPUT:
  • solve: function handle to the experiment to be quantified. Signature: sol = solve(sample,params)
  • params: parameters to be passed to the ODE system (these contain the uncertain parameter as well)
  • solvePostProcessing: post processing function called after all the simulation have been run. Signature: sols = solvePostProcessing(sols)
  • dists: list of n scipy.stats distribution functions for each uncertain parameter
  • paramUpdate: function handle for updating the set of uncertain parameters. Signature: params = paramUpdate(params,sample)
  • method: Sparse Grid method selected. See description below.
  • k: accuracy of the Sparse Grid rule
  • sym: [optional, default = 1] symmetry parameter for Sparse Grid package
OUTPUT: dictionary with the following attributes
  • ‘Samples’: list of collocation points (samples) used for UQ
  • ‘Y’: solutions at collocation points
  • ‘meanSol’: estimated mean
  • ‘varSol’: estimated variance
Description:
The methods available for sparse grid are:
  • KPU = Nested rule for unweighted integral over [0,1]
  • KPN = Nested rule for integral with Gaussian weight
  • GQU = Gaussian quadrature for unweighted integral over [0,1] (Gauss-Legendre)
  • GQN = Gaussian quadrature for integral with Gaussian weight (Gauss-Hermite)
  • func = any function provided by the user that accept level l and returns nodes n and weights w for univariate quadrature rule with polynomial exactness 2l-1 as [n w] = feval(func,level)
DABI_UQToolbox.DABIUncertaintyQuantification.gPC_MultiIndex(dist, poly, distPoly, N)[source]

Generates the Multi Index basis Vandermonde matrix using the list of distributions of the parameters space approximated by the selected polynomials. INPUT:

dist: list of n distributions representing the n-Dimensional random space poly: list of n polynomials (class DABISpectral1D) used for approximating each

of the directions in the random space

distPoly: list of n standard distributions associated to the polynomial selected N: maximum polynomial order in the basis NI: (int) number of points in which to evaluate the basis functions for precise cubature rules quadTypes: (list, DABISpectral1D.AVAIL_POINTS) list of n types of quadrature points among Gauss, Gauss-Lobatto and Gauss-Radau. If None, Gauss quadrature points are used. left: (list,float) list of left values used by ORTHPOL for Gauss-Lobatto rules (the dimensions where the value is not used can be set to anything) right: (list,float) list of left values used by ORTHPOL for Gauss-Lobatto rules (the dimensions where the value is not used can be set to anything) end: (list,float) list of left values used by ORTHPOL for Gauss-Radau rules (the dimensions where the value is not used can be set to anything) warnings: True if you want to read warning on memory allocation

OUTPUT: dictionary with the following attributes
x: tensor product of collocation points in the standard distributions w: tensor product of the weights for cubature/projection rules (sum to 1 or prod(gamma0) respectively) vals: tensor product of collocation points V: Pascal’s simplex of the basis functions
DABI_UQToolbox.sobol_lib.scramble(X)[source]

Scramble function as in Owen (1997)

Reference:

[1]Saltelli, A., Chan, K., Scott, E.M., “Sensitivity Analysis”
DABI_UQToolbox.sobol_lib.scrambled_sobol_generate(k, N, skip, leap)[source]

Scramble function as in Owen (1997)

Reference:

[1]Saltelli, A., Chan, K., Scott, E.M., “Sensitivity Analysis”
DABI_UQToolbox.sobol_lib.sobol_generate(k, N, skip, leap)[source]

Skip and leap sobol sequence

Reference:

[1]Saltelli, A., Chan, K., Scott, E.M., “Sensitivity Analysis”

DABI Cut ANOVA

Created on Wed Mar 13 09:03:41 2013

@author: Daniele Bigoni (dabi@dtu.dk)

Description

This module is used to construct High Dimensionar Model Representation using cut-HDMR based on spectral methods from the module DABISpectralToolbox.DABISpectral1D. Additionally the cut-HDMR can be used to compute the associated ANOVA-HDMR.

Indices and tables

Table Of Contents

This Page