-
Notifications
You must be signed in to change notification settings - Fork 2
GPCBasis
Generalized polynomial chaos (gPC) methods use the fact that for any given probability distribution with smooth probability density function (PDF) there exists a set of polynomials that is orthogonal with respect to the scalar product defined by the PDF. These polynomials are called the gPC basis polynomials.
GPCBasis[{x, distr}, n]
constructs the first gPC basis polynomials in x
up to order n
for the distribution distr
.
If you have k
random variables then GPCBasis
will return (k+n)! / (k! n!)
polynomials, where n
is the maximum order given as last argument.
Given a uniform distribution on the interval (-1,1), the first four polynomials in the gPC basis are
GPCBasis[{x, UniformDistribution[{-1, 1}]}, 4]
(* {1, Sqrt[3] x, 1/2 Sqrt[5] (-1 + 3 x^2), 1/2 Sqrt[7] (-3 x + 5 x^3), 3/8 (3 - 30 x^2 + 35 x^4)} *)
GPCBasis
works with multiple random variables:
GPCBasis[{x, UniformDistribution[{-1, 1}]}, {y, BetaDistribution[2, 3]}, 2]
(* {1, Sqrt[3] x, -2 + 5 y, 1/2 Sqrt[5] (-1 + 3 x^2), Sqrt[3] x (-2 + 5 y), Sqrt[10] (1 - 6 y + 7 y^2)} *)