SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.regression.linear.ols
Class Residuals

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.regression.linear.Residuals
      extended by com.numericalmethod.suanshu.stats.regression.linear.ols.Residuals

public class Residuals
extends Residuals

Residual analysis of the results of an Ordinary Least Square linear regression model.

Once a regression model has been constructed, it may be important to confirm the goodness of fit of the model and the statistical significance of the estimated parameters. Commonly used checks of goodness of fit include the R-squared, analysis of the pattern of residuals and hypothesis testing. Statistical significance can be checked by an F-test of the overall fit, followed by t-tests of individual parameters.

See Also:

Field Summary
 double AR2
          diagnostic measure: the adjusted R-squared
 double f
          diagnostic measure: F statistics mean of regression / mean squared error = sum((y_i_hat-y_mean)^2) / mean squared error [(TSS-RSS)/n] / [RSS/(m-n)] y_i_hat are the fitted values of the regression.
 ImmutableMatrix hHat
          projection matrix H-hat
 ImmutableVector leverage
          leverage; the bigger the leverage for an observation, the bigger influence on the prediction
 double R2
          diagnostic measure: the R-squared
 double RSS
          diagnostic measure: the sum of squared residuals, Σ(ε^2)
 double stderr
          the standard error of the residuals
 double TSS
          diagnostic measure: the total sum of squares, Σ((y-y_mean)^2)
 ImmutableVector wFitted
          the weighted, fitted values
 ImmutableVector wResiduals
          the weighted residuals
 
Fields inherited from class com.numericalmethod.suanshu.stats.regression.linear.Residuals
fitted, problem, residuals
 
Method Summary
 ImmutableVector standardized()
          standard residual = residual / v1 / RSS / (m-n)
 ImmutableVector studentized()
          studentized residual = standardized * sqrt((m-n-1) / (n-m-standardized))
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wFitted

public final ImmutableVector wFitted
the weighted, fitted values


wResiduals

public final ImmutableVector wResiduals
the weighted residuals


stderr

public final double stderr
the standard error of the residuals


RSS

public final double RSS
diagnostic measure: the sum of squared residuals, Σ(ε^2)


TSS

public final double TSS
diagnostic measure: the total sum of squares, Σ((y-y_mean)^2)


R2

public final double R2
diagnostic measure: the R-squared


AR2

public final double AR2
diagnostic measure: the adjusted R-squared


f

public final double f
diagnostic measure: F statistics
mean of regression / mean squared error = sum((y_i_hat-y_mean)^2) / mean squared error [(TSS-RSS)/n] / [RSS/(m-n)]
y_i_hat are the fitted values of the regression.

See Also:
"p.69, equation (2.60). Applied linear regression models. Kutner, Nachtsheim and Neter. 4th edition."

hHat

public final ImmutableMatrix hHat
projection matrix H-hat

See Also:
"p.168 Section 8.1, Chapter 8. Applied Linear Regression, 3rd edition, 2005. Sanford Weisberg. Wiley-Interscience."

leverage

public final ImmutableVector leverage
leverage; the bigger the leverage for an observation, the bigger influence on the prediction

Method Detail

standardized

public ImmutableVector standardized()
standard residual = residual / v1 / RSS / (m-n)

Returns:
standardized residuals

studentized

public ImmutableVector studentized()
studentized residual = standardized * sqrt((m-n-1) / (n-m-standardized))

Returns:
studentized residuals
See Also:
  • "p.90 (4.15). Section 4.3. Regression Analysis by Example, 3rd edition, 2000. Chatterjee, Hadi and Price. Wiley Series in Probability and Statistics."
  • @see Wikipedia: Studentized residual

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.