legendrefit - function varargout = legendrefit(Y, N,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: function varargout = legendrefit(Y, N, method) %LEGENDREFIT Fitting data using a linear combination of Legendre polynomials % % A = legendrefit(Y, N, method) finds the column vector A which contains % weighting coefficients of the linear combination of a set of Legendre % polynomials up to order N. A(i) is the weight of P_{i-1}(x) which is % Legendre polynomial of order i-1. The fitting is optimum in the least % squares sense. If N is not specified, default order 2 is used. % % Three methods are available (just for fun): 'inv' (default) inverts the % normal equation matrix directly, while 'chol' and 'qr' find the solution % via Cholesky and QR decomposition, respectively. % % [A Y2] = legendrefit(...) returns the fitting (regression) result Y2, % i.e. Y2 = \sum_{i=1}^{N+1} A(i)*P_{i-1}(x). Residuals are then Y - Y2. % % [A Y2 r] = legendrefit(...) and [A Y2 r e] = legendrefit(...) further % return the Pearson's correlation coefficient r and root mean square % error (RMSE) e, respectively....
View Full Document

This note was uploaded on 09/19/2009 for the course MATH numerical taught by Professor Ford during the Spring '09 term at FAU.

Page1 / 3

legendrefit - function varargout = legendrefit(Y, N,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online