Fits a multiple linear regression model with or without an intercept.
For a list of all members of this type, see LinearRegression Members.
System.Object
Imsl.Stat.LinearRegression
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
Fits a multiple linear regression model with or without an intercept. If the constructor argument hasIntercept is true, the multiple linear regression model is
hasIntercept is false, LinearRegression computes estimates of the regression coefficients by minimizing the sum of squares of the deviations of the observed response
from the fitted response
hasIntercept is true; the total sum of squares is the sum of squares of the deviations of hasIntercept is false, the total sum of squares is the sum of squares of In order to compute a least-squares solution, LinearRegression performs an orthogonal reduction of the matrix of regressors to upper triangular form. Givens rotations are used to reduce the matrix. This method has the advantage that the loss of accuracy resulting from forming the crossproduct matrix used in the normal equations is avoided, while not requiring the storage of the full matrix of regressors. The method is described by Lawson and Hanson, pages 207-212.
From a general linear model fitted using the
's as the weights, inner class LinearRegression.CaseStatistics can also compute predicted values, confidence intervals, and diagnostics for detecting outliers and cases that greatly influence the fitted regression. Let
be a column vector containing elements of the
-th row of
. Let
. The leverage is defined as
Let
denote the residual
The
th jackknife residual or deleted residual involves the difference between
and its predicted value based on the data set in which the
th case is deleted. This difference equals
. The jackknife residual is obtained by standardizing this difference. The residual mean square for the regression in which the
th case is deleted is
Cook's distance for the
th case is a measure of how much an individual case affects the estimated regression coefficients. It is given by
DFFITS, like Cook's distance, is also a measure of influence. For the
th case, DFFITS is computed by the formula
Often predicted values and confidence intervals are desired for combinations of settings of the effect variables not used in computing the regression fit. This can be accomplished using a single data matrix by including these settings of the variables as part of the data matrix and by setting the response equal to Double.NaN. LinearRegression will omit the case when performing the fit and a predicted value and confidence interval for the missing response will be computed from the given settings of the effect variables.
Namespace: Imsl.Stat
Assembly: ImslCS (in ImslCS.dll)
LinearRegression Members | Imsl.Stat Namespace | Example1 | Example2