Description Usage Arguments Value Author(s) References See Also Examples
The GPCE.lar function implements a polynomial chaos expansion of a given model or an external model. The strategy for the expansion of the model into a polynomial chaos basis is the adaptive sparse method based on the least angle regression. A statistical and a global sensitivity analysis of the model is then carried out.
1 2 3 4 5 6 7 8 9 10 11 |
Model |
a function defining the model to analyze or NULL if the model is external |
PCSpace |
The space where the expansion is achieved. Options are Gaussian, Uniform and Physic. Physic use the same distributions as the input ones for the expansion |
InputDim |
Dimension of the input |
InputDistrib |
Distribution of the input. Options are |
ParamDistrib |
Parameters of the input distributions |
Q2tgt |
Fix the accuracy of the expansion fitting.
By default |
Eps |
Common epsilon for the selection of the basis.
By default set to |
EpsForw |
Epsilon used for the forward selection of
the basis. By default set to |
EpsBack |
Epsilon used for the forward selection of
the basis. By default set to |
EnrichStep |
Number of samples to add to the experimental design. By default set to |
jmax |
The maximum interaction order between the input variables |
pmaxi |
The maximum degree of the polynomial basis |
DesignLength |
The length of the input design. By default set to |
SeedSob |
Seed for the Sobol design generation |
Designs |
A list containing the Sobol design, the input distributions design, the polynomial chaos design and the design length |
Output |
Vector of the model output |
TruncSet |
Matrix of the kept sparse polynomial basis. TruncSet_ij is the jth polynomial degree associated to the ith variable |
CoeffPCE |
Vector of the expansion coefficients associated to the |
R2 |
The R2 PCE approximation oerror |
Q2 |
The Q2 PCE approximation error |
Moments |
A list containing the fourth first moments of the output: mean, variance, standard deviation, skweness and kurtosis |
Sensitivity |
A list containing the sobol sensitivity indices and the sobol total sensitivity indices |
OutputDistrib |
A list containing a kernel estimation of the output distribution and the associated bandwidth |
Munoz Zuniga Miguel
G. Blatman and B. Sudret, 2011, Adapive sparse polynomial chaos expansion based on least angle regression, Journal of Computational Physics, 230, 2345–2367.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ### CASE 1: model is a R function.
### Model definition: y= 1 + Phi_1(x1)*Phi_1(x2)
Model <- function(x){
PHerm = hermite.he.polynomials(5, normalized=FALSE)
y=1+unlist(polynomial.values(PHerm[2],x[,1]))*unlist(polynomial.values(PHerm[2],x[,2]))
return(y)
}
### Run the algorithm with the lar regression method
ResultObject=GPCE.lar(Model=Model, PCSpace="Gaussian", InputDim=3, InputDistrib=rep("Gaussian",3))
names(ResultObject)
###
### CASE 2: external model (for the example the function Model will be used externaly).
### initialized Output
Output=c()
### Get a first design
ResultObject=GPCE.lar(PCSpace="Gaussian",InputDim=3,InputDistrib=rep("Gaussian",3))
names(ResultObject)
### Calculate the model output for the given design and concatenate the model output results
### into the output vector
Output=c(Output,Model(ResultObject$Design2Eval))
### Give the design and the calculated ouput to the tell function
ResultObject=tell(ResultObject,Output)
names(ResultObject)
### If the expansion has been calculated the function tell return the full expansion
### paramaters, the moments analysis, the sensitivity analysis and the output distribution
### If not the function tell() return an enriched design.
### In the later case the user calculate the output externally and give them
### to the tell function with the previous ResultObject for further calculation.
### See GPCE.sparse documentation for an example.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.