Description Usage Arguments Value Author(s) References See Also Examples

The GPCE.sparse 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 where the sampled design is iteratively enriched until the expansion coefficients estimation, by regression, is accurate. Meanwile a relevant selection of the polynomial basis to keep in the expansion is carried out. A statistical and a global sensitivity analysis of the model is then carried out.

1 2 3 4 5 |

`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 |

`DesignLength` |
The length of the input design. By default set to |

`jmax` |
The maximum interaction order between the input variables |

`pmaxi` |
The maximum degree of the polynomial basis |

`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 error |

`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, 2010, *An adapive algorithm to build up sparse polynomial chaos expansions for stochastic finite element analysis*, Probabilistic Engineering Mechanics, 25, 183–197.

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 37 38 39 40 41 | ```
### CASE 1: model is a R function.
### Model definition: y= 1 + Phi_1(x1)*Phi_1(x2) + Phi_3(x2)
Model <- function(x){
PHerm = hermite.he.polynomials(7, normalized=FALSE)
y=1+unlist(polynomial.values(PHerm[2],x[,1]))*unlist(polynomial.values(PHerm[2],x[,2]))+
unlist(polynomial.values(PHerm[4],x[,2]))/sqrt(factorial(3))
return(y)
}
### Run the algorithm with the sparse regression method
ResultObject=GPCE.sparse(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.sparse(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.
Output=c(Output,Model(ResultObject$Design2Eval))
### Give the design and the calculated ouput to the tell function
ResultObject=tell(ResultObject,Output)
names(ResultObject)
###
``` |

```
Loading required package: randtoolbox
Loading required package: rngWELL
This is randtoolbox. For an overview, type 'help("randtoolbox")'.
Loading required package: orthopolynom
Loading required package: polynom
Loading required package: ks
Loading required package: lars
Loaded lars 1.2
[1] "h problem"
[1] "Entering PostProcessReg"
[1] "Entering EvalPCE"
[1] "TruncSet" "R2" "Q2" "Designs" "CoeffPCE"
[6] "Moments" "Sensitivity" "OutputDistib" "Args" "Output"
[1] "Designs" "Design2Eval" "Args"
[1] "Designs" "Design2Eval" "Output" "Args"
[1] "Entering PostProcessReg"
[1] "Entering EvalPCE"
[1] "TruncSet" "R2" "Q2" "Designs" "CoeffPCE"
[6] "Moments" "Sensitivity" "OutputDistib" "Args" "Output"
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.