  ### B.8 Matrix decompositions & quadratures

The following statements are used to decompose matrices (or datasets) or to produce abscissae and weights for approximating integrals via Gaussian quadratures.

 Syntax Arguments and performed function L = chol(X); L is a lower-triangular matrix such that: L*L′= X X must be a symmetric and positive-deﬁnite matrix or dataset If X is not positive deﬁnite an error is produced [v, V] = eig(X); If X is an $M\phantom{\rule{0.3em}{0ex}}×\phantom{\rule{0.3em}{0ex}}M$ symmetric matrix then v is an $M\phantom{\rule{0.3em}{0ex}}×\phantom{\rule{0.3em}{0ex}}1$ vector that contains the eigenvalues of X and V is an $M\phantom{\rule{0.3em}{0ex}}×\phantom{\rule{0.3em}{0ex}}M$ matrix that contains the corresponding eigenvectors, such that: V*diag(v)*inv(V)= X X must be a symmetric matrix or dataset Only the lower triangular part of X is used for the decomposition. This means that if X is not symmetric, BayES will not produce a warning or error message [x, w] = quadrature(n $\left[$, s$\right]$); x is an n$\phantom{\rule{0.3em}{0ex}}×\phantom{\rule{0.3em}{0ex}}1$ vector of abscissae and w an n$\phantom{\rule{0.3em}{0ex}}×\phantom{\rule{0.3em}{0ex}}1$ vector of corresponding weights for a Gaussian quadrature. Depending on the value of the optional argument, the abscissae and weights could be for a Gauss-Laguerre or Gauss-Hermite quadrature.For the Gauss-Laguerre quadrature it holds:${\sum }_{i=1}^{n}$ w${}_{i}\cdot f\left($x${}_{i}\right)\approx {\int }_{0}^{+\infty }{e}^{-x}f\left({x}_{i}\right)\text{d}x$For the Gauss-Hermite quadrature it holds:${\sum }_{i=1}^{n}$ w${}_{i}\cdot f\left($x${}_{i}\right)\approx {\int }_{-\infty }^{\infty }{e}^{-{x}^{2}}f\left({x}_{i}\right)\text{d}x$ i must be an integer between 2 and 300; s must be equal to either "laguerre" or "hermite". The default value for s is "laguerre", for which the abscissae and weights are for a Gauss-Laguerre quadrature.

Share this content:    © 2016–20 Grigorios Emvalomatis