Next: , Previous: Robust linear regression, Up: Least-Squares Fitting   [Index]


37.6 Troubleshooting

When using models based on polynomials, care should be taken when constructing the design matrix X. If the x values are large, then the matrix X could be ill-conditioned since its columns are powers of x, leading to unstable least-squares solutions. In this case it can often help to center and scale the x values using the mean and standard deviation:

x' = (x - mu)/sigma

and then construct the X matrix using the transformed values x'.