11.2.12. rheia.UQ.pce.PCE
- class rheia.UQ.pce.PCE(Experiment)
Class which creates a Polynomial Chaos Expansion (PCE) object. A PCE is characterized by the following attributes:
Basis : PC basis functions
Coefficients : PC coefficients
Moments : Statistical moments
sensitivity : Sobol’ indices
- Parameters
RandomExperiment (obj) – RandomExperiment object, with information on the random samples.
- __init__(Experiment)
Methods
__init__(Experiment)calc_a(multindices)This method builds the matrix containing the basis functions evaluated at sample locations, i.e. the matrix A in Au = b.
calc_loo()This method evaluates the Leave-One-Out (LOO) error for the constructed PCE.
This method calculates the Sobol' indices Si of PCE.
create_distributions()Create the distributions, polynomial distributions and polynomial types based on the stochastic design space.
create_only_samples(create_only_samples)Add the generated samples to the samples file.
create_samples([size])Generate the samples for model evaluations.
create_samples_file()Creating the file that saved the input samples and model outputs.
draw(size)This module creates the probability density function and cumulative distribution function and writes the corresponding values to construct these values in the result files.
evaluate(eval_func, params)Evaluate the samples in the model and store the samples and outputs in the samples file.
Calculate the term <psii,psij>
get_statistics([mean, variance])This function calculates high order moments (up to order 2) by taking advantage of the fact that any permutation of indices will lead to the same value for the summand.
multindices(idx)This method returns a set of multi-indices
n_terms()This method sets the number of samples to 2*(p+n)!/p!n!, i.e the number of terms in the full PC expansion of order p in n random variables.
n_to_sum(n, s)This function creates a list of all possible vectors of length 'n' that sum to 's'
ols(a_matrix, b_matrix)Perform Ordinary Least Squares on the input matrices a_matrix and b_matrix.
This method prints an overview of the inputs and results of the PCE.
read_previous_samples(create_only_samples)Read the previously evaluated samples and store them for future PCE construction.
read_stoch_parameters([var_values])Read in the stochastic design space and save the information in a dictionary
run()Solve Ordinary Least Squares problem Full PC expansion is assumed containing n_terms(dimension,order)