Orthogonal Polynomials
The stochastic discretization of random variables involves global polynomials that are orthogonal with respect to the involved random distribution of the y_m
. These polynomials can be generated by some recurrence relation with coefficients that depend on the distribution.
Recurrence relations
Orthogonal polynomials $H_n$ with respect to some weight function $\omega$, i.e.,
\[\int_\Gamma \omega(y) H_{n}(y) H_m(y) dy = N^2_{nm}\delta_{nm}\]
where
\[ N_{nn} := \| H_n \|_{\omega}^2 := \int_\Gamma \omega(y) H_{n}(y) H_n(y) dy\]
satisfy the three-term recurrence relation
\[\begin{aligned} H_{n+2}(y) & = (a_n y-b_n) H_{n+1}(y) - c_n H_{n}(y) \end{aligned}\]
initialized by $H_0 = 0$ and $H_1 = 1$.
ExtendableASGFEM.evaluate!
— Methodevaluate!(
y,
basis::Type{<:OrthogonalPolynomialType},
n::Integer,
x::Real
)
Evaluates the first n+1 orthogonal polynomials at a single x and write result into y
ExtendableASGFEM.evaluate
— Methodevaluate(
basis::Type{<:OrthogonalPolynomialType},
n::Integer,
x::Real
) -> Any
Evaluates the first n+1 orthogonal polynomials at a single x
ExtendableASGFEM.evaluate
— Methodevaluate(
basis::Type{<:OrthogonalPolynomialType},
n::Integer,
x::AbstractArray{T, 1}
) -> Any
Evaluates the first n+1 orthogonal polynomials at a vector of x
ExtendableASGFEM.normalise_recurrence_coefficients
— Methodnormalise_recurrence_coefficients(
OBT::Type{<:OrthogonalPolynomialType},
k
) -> Tuple{Any, Any, Any}
Changes the recurrence coefficients, such that basis functions are normalized.
LinearAlgebra.norm
— Methodnorm(basis::Type{<:OrthogonalPolynomialType}, n; gr) -> Any
computes the norms of the first n+1 polynomials by Gauss quadrature
Legendre Polynomials (uniform distribution)
For the weight function $\omega(y) = 1/2$ in the interval $[-1,1]$ (uniform distribution), take $a_n = (2n+1)/(n+1)$, $b_n = 0$ and $c_n = n/(n+1)$. The norms of the resulting Legendre polynomials are given by
\[ \| H_n \|^2_\omega = \frac{2}{2n+1}\]
ExtendableASGFEM.LegendrePolynomials
— Typeabstract type LegendrePolynomials <: OrthogonalPolynomialType
Type for dispatching Legendre Polynomials
ExtendableASGFEM.distribution
— Methoddistribution(
_::Type{LegendrePolynomials}
) -> Distributions.Uniform{Float64}
Returns the distribution associated to the Legendre polynomial
ExtendableASGFEM.norms
— Methodnorms(_::Type{LegendrePolynomials}, k) -> Any
Returns the norm of the k-th Legendre polynomial
ExtendableASGFEM.recurrence_coefficients
— Methodrecurrence_coefficients(
_::Type{LegendrePolynomials},
k::Integer
) -> Tuple{Int64, Any, Any}
Returns the recurrence coefficients for the k-th Legendre polynomial
Hermite Polynomials (normal distribution)
For the weight function $\omega(y) = \exp(-y^2/2)/(2\pi)$ (normal distribution), take $a_n = 1$, $b_n = 0$ and $c_n = n$. Then, the first six polynomials read
\[\begin{aligned} H_0 & = 0\\ H_1 & = 1\\ H_2 & = y\\ H_3 & = y^2 - 1\\ H_4 & = y^3 - 3y\\ H_5 & = y^4 - 6y^2 +3\\ \end{aligned}\]
and their norms are given by
\[ \| H_n \|^2_\omega = n!\]
ExtendableASGFEM.HermitePolynomials
— Typeabstract type HermitePolynomials <: OrthogonalPolynomialType
Type for dispatching Hermite Polynomials
ExtendableASGFEM.distribution
— Methoddistribution(
_::Type{HermitePolynomials}
) -> Distributions.Normal{Float64}
Returns the distribution associated to the Hermite polynomial
ExtendableASGFEM.norms
— Methodnorms(_::Type{HermitePolynomials}, k) -> Any
Returns the norm of the k-th Hermite polynomial
ExtendableASGFEM.recurrence_coefficients
— Methodrecurrence_coefficients(
_::Type{HermitePolynomials},
k::Integer
) -> Tuple{Int64, Int64, Integer}
Returns the recurrence coefficients for the k-th Legendre polynomial