Gauss–Hermite quadrature

From testwiki
Jump to navigation Jump to search

Template:Short description

Weights versus xi for four choices of n

In numerical analysis, Gauss–Hermite quadrature is a form of Gaussian quadrature for approximating the value of integrals of the following kind:

∫−∞+∞e−x2f(x)dx.

In this case

∫−∞+∞e−x2f(x)dx≈∑i=1nwif(xi)

where n is the number of sample points used. The xi are the roots of the physicists' version of the Hermite polynomial Hn(x) (i = 1,2,...,n), and the associated weights wi are given by [1]

wi=2n−1n!πn2[Hn−1(xi)]2.

Example with change of variable

Consider a function h(y), where the variable y is normally distributed: y∼𝒩(μ,σ2). The expectation of h corresponds to the following integral:

E[h(y)]=∫−∞+∞1σ2πexp⁡(−(y−μ)22σ2)h(y)dy

As this does not exactly correspond to the Hermite polynomial, we need to change variables:

x=y−μ2σ⇔y=2σx+μ

Coupled with the integration by substitution, we obtain:

E[h(y)]=∫−∞+∞1πexp⁡(−x2)h(2σx+μ)dx

leading to:

E[h(y)]≈1π∑i=1nwih(2σxi+μ)

As an illustration, in the simplest non-trivial case, with n=2, we have x1=−12,x2=12 and w1=w2=π2, so the estimate reduces to:

E[h(y)]≈12(h(μ−σ)+h(μ+σ))

– i.e. the average of the function's values one standard deviation below and above the mean.

References

  1. ↑ Abramowitz, M & Stegun, I A, Handbook of Mathematical Functions, 10th printing with corrections (1972), Dover, Template:ISBN. Equation 25.4.46.

Template:Numerical integration