An Algorithm for Generating the Design Matrix for Multivariate Polynomial Least Squares Fitting
Sami F. Al-Hamdan
Journal of Digital Information Management, Vol. 5, No. 4, 2007.
DOI: 
Link: http://www.dirf.org/jdim/v5n4a6.asp
Abstract:
This paper presents an algorithm for generating the design matrix that is usually used for multivariate polynomial least square fitting. The design matrix is used in least squares fitting algorithm to construct a set of linear equations whose solution is the required polynomial coefficients. The developed algorithm was coded in MATLAB. The coded function named mv_polyfit(X,Y,ord) accepts as inputs two matrices: the first argument is a 2D matrix of the independent variable X, the second argument is the dependent variable vector Y, and the last argument is the required degree of the fitting polynomial. The function returns the coefficient vector C and the design matrix A. Number of data points (k) needed for the function should be large enough for the solution of the set of linear equations to exist.