R: Get the order of canonical polynomial chaos expansion
indexCardinal
R Documentation
Get the order of canonical polynomial chaos expansion
Description
For a d-dimensional polynomial chaos expansion up to order p, there are a total of M polynomials, determine from get(d,p). Each polynomial $phi_m(x)$ is expressed as the product of the polynomial from each random variables, i.e. $phi_m(x) = phi_m,1(x_1)phi_m,2(x_2)...phi_m,d(x_d)$, each with a different polynomial order. We can thus very succintly denote phi_m(x) with a n-tuple vector containing the polynomial order from each dimension and the entire canonical PCE expansion can be express as a (m x n) matrix.
Usage
indexCardinal(d,p,m,index)
Arguments
d
Number of input random variables
p
Order of the polynomial chaos expansion
m
Pointer to the current n-tuple vector being calculated
index
A dummy variable that stores the polynoial order calculated so far
Value
Index
A (m x d) matrix that donates the polynomial order for each random variables in the canonical construction of PCE
Author(s)
Jordan Ko
References
R. Ghanem and P. Spanos, 1991, Stochastic Finite Elements: A Spectral Approach. Berlin: Springer.
J. Ko, 2009, Applications of the generalized polynomial chaos to the numerical simulationof stochastic shear flows, Doctoral thesis, Universit'e Paris VI.
See Also
getM
Examples
d <- 3
p <- 5
m <- getM(d,p)
index <- indexCardinal(d,p)
print(t(index))
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(GPC)
Loading required package: randtoolbox
Loading required package: rngWELL
This is randtoolbox. For overview, type 'help("randtoolbox")'.
Loading required package: orthopolynom
Loading required package: polynom
Loading required package: ks
Loading required package: KernSmooth
KernSmooth 2.23 loaded
Copyright M. P. Wand 1997-2009
Loading required package: misc3d
Loading required package: mvtnorm
Loading required package: rgl
Loading required package: lars
Loaded lars 1.2
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GPC/indexCardinal.Rd_%03d_medium.png", width=480, height=480)
> ### Name: indexCardinal
> ### Title: Get the order of canonical polynomial chaos expansion
> ### Aliases: indexCardinal
>
> ### ** Examples
>
> d <- 3
> p <- 5
> m <- getM(d,p)
> index <- indexCardinal(d,p)
> print(t(index))
[,1] [,2] [,3]
[1,] 0 0 0
[2,] 1 0 0
[3,] 0 1 0
[4,] 0 0 1
[5,] 2 0 0
[6,] 1 1 0
[7,] 1 0 1
[8,] 0 2 0
[9,] 0 1 1
[10,] 0 0 2
[11,] 3 0 0
[12,] 2 1 0
[13,] 2 0 1
[14,] 1 2 0
[15,] 1 1 1
[16,] 1 0 2
[17,] 0 3 0
[18,] 0 2 1
[19,] 0 1 2
[20,] 0 0 3
[21,] 4 0 0
[22,] 3 1 0
[23,] 3 0 1
[24,] 2 2 0
[25,] 2 1 1
[26,] 2 0 2
[27,] 1 3 0
[28,] 1 2 1
[29,] 1 1 2
[30,] 1 0 3
[31,] 0 4 0
[32,] 0 3 1
[33,] 0 2 2
[34,] 0 1 3
[35,] 0 0 4
[36,] 5 0 0
[37,] 4 1 0
[38,] 4 0 1
[39,] 3 2 0
[40,] 3 1 1
[41,] 3 0 2
[42,] 2 3 0
[43,] 2 2 1
[44,] 2 1 2
[45,] 2 0 3
[46,] 1 4 0
[47,] 1 3 1
[48,] 1 2 2
[49,] 1 1 3
[50,] 1 0 4
[51,] 0 5 0
[52,] 0 4 1
[53,] 0 3 2
[54,] 0 2 3
[55,] 0 1 4
[56,] 0 0 5
>
>
>
>
>
> dev.off()
null device
1
>