User`s guide

Parametric Fitting
3-9
where X
T
is the transpose of the design matrix X. Solving for b,
In MATLAB, you can use the backslash operator to solve a system of
simultaneous linear equations for unknown coefficients. Because inverting
X
T
X can lead to unacceptable rounding errors, MATLAB uses QR
decomposition with pivoting, which is a very stable algorithm numerically.
Refer to Arithmetic Operators in the MATLAB documentation for more
information about the backslash operator and QR decomposition.
You can plug b back into the model formula to get the predicted response
values, .
A hat (circumflex) over a letter denotes an estimate of a parameter or a
prediction from a model. The projection matrix H is called the hat matrix,
because it puts the hat on y.
The residuals are given by
Refer to [1] or [2] for a complete description of the matrix representation of
least squares regression.
Weighted Linear Least Squares
As described in Basic Assumptions About the Error on page 3-5, it is usually
assumed that the response data is of equal quality and, therefore, has constant
variance. If this assumption is violated, your fit might be unduly influenced by
data of poor quality. To improve the fit, you can use weighted least squares
regression where an additional scale factor (the weight) is included in the
fitting process. Weighted least squares regression minimizes the error
estimate
bX
T
X()
1
X
T
y=
y
ˆ
y
ˆ
Xb Hy==
HXX
T
X()
1
X
T
=
ryy
ˆ
1 H()y==
Sw
i
y
i
y
ˆ
i
()
2
i 1=
n
=