naginterfaces.library.correg.linregm_​coeffs_​noconst

naginterfaces.library.correg.linregm_coeffs_noconst(n, sspz, rz)[source]

linregm_coeffs_noconst performs a multiple linear regression with no constant on a set of variables whose sums of squares and cross-products about zero and correlation-like coefficients are given.

For full information please refer to the NAG Library document for g02ch

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/g02/g02chf.html

Parameters
nint

, the number of cases used in calculating the sums of squares and cross-products and correlation-like coefficients.

sspzfloat, array-like, shape

must be set to , the sum of cross-products about zero for the th and th variables, for , for ; terms involving the dependent variable appear in row and column .

rzfloat, array-like, shape

must be set to , the correlation-like coefficient for the th and th variables, for , for ; coefficients involving the dependent variable appear in row and column .

Returns
resultfloat, ndarray, shape

The following information:

, the sum of squares attributable to the regression;

, the degrees of freedom attributable to the regression;

, the mean square attributable to the regression;

, the value for the analysis of variance;

, the sum of squares of deviations about the regression;

, the degrees of freedom of deviations about the regression;

, the mean square of deviations about the regression;

, the total sum of squares;

, the total degrees of freedom;

, the standard error estimate;

, the coefficient of multiple correlation;

, the coefficient of multiple determination;

, the coefficient of multiple determination corrected for the degrees of freedom.

coeffloat, ndarray, shape

For , the following information:

, the regression coefficient for the th variable.

, the standard error of the regression coefficient for the th variable.

, the value of the regression coefficient for the th variable.

rznvfloat, ndarray, shape

The inverse of the matrix of correlation-like coefficients for the independent variables; that is, the inverse of the matrix consisting of the first rows and columns of .

czfloat, ndarray, shape

The modified inverse matrix, , where

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

The partition of which requires inversion is not positive definite.

(errno )

The refinement following the actual inversion has failed.

Notes

No equivalent traditional C interface for this routine exists in the NAG Library.

linregm_coeffs_noconst fits a curve of the form

to the data points

such that

The function calculates the regression coefficients, , (and various other statistical quantities) by minimizing

The actual data values are not provided as input to the function. Instead, input to the function consists of:

  1. The number of cases, , on which the regression is based.

  2. The total number of variables, dependent and independent, in the regression, .

  3. The number of independent variables in the regression, .

  4. The matrix of sums of squares and cross-products about zero of all the variables in the regression; the terms involving the dependent variable, , appear in the th row and column.

  5. The matrix of correlation-like coefficients for all the variables in the regression; the correlations involving the dependent variable, , appear in the th row and column.

The quantities calculated are:

  1. The inverse of the partition of the matrix of correlation-like coefficients, , involving only the independent variables. The inverse is obtained using an accurate method which assumes that this sub-matrix is positive definite (see Further Comments).

  2. The modified matrix, , where

    where is the th element of the inverse matrix of as described in (a) above. Each element of is thus the corresponding element of the matrix of correlation-like coefficients multiplied by the corresponding element of the inverse of this matrix, divided by the corresponding element of the matrix of sums of squares and cross-products about zero.

  3. The regression coefficients:

    where is the sum of cross-products about zero for the independent variable and the dependent variable .

  4. The sum of squares attributable to the regression, , the sum of squares of deviations about the regression, , and the total sum of squares, :

    , the sum of squares about zero for the dependent variable, ;

    .

  5. The degrees of freedom attributable to the regression, , the degrees of freedom of deviations about the regression, , and the total degrees of freedom, :

  6. The mean square attributable to the regression, , and the mean square of deviations about the regression, :

  7. The value for the analysis of variance:

  8. The standard error estimate:

  9. The coefficient of multiple correlation, , the coefficient of multiple determination, , and the coefficient of multiple determination corrected for the degrees of freedom, :

  10. The standard error of the regression coefficients:

  11. The values for the regression coefficients:

References

Draper, N R and Smith, H, 1985, Applied Regression Analysis, (2nd Edition), Wiley