Package com.imsl.stat
Class LinearRegression.CaseStatistics
java.lang.Object
com.imsl.stat.LinearRegression.CaseStatistics
- Enclosing class:
- LinearRegression
Inner Class
CaseStatistics allows for the computation of
predicted values, confidence intervals, and diagnostics for detecting
outliers and cases that greatly influence the fitted regression.-
Constructor Summary
ConstructorsConstructorDescriptionCaseStatistics(double[] x, double y) Deprecated.CaseStatistics(double[] x, double y, double w) Deprecated.TheCaseStatisticsconstructors have been deprecated in favor of getter methods inLinearRegression.CaseStatistics(double[] x, double y, double w, int pred) Deprecated.TheCaseStatisticsconstructors have been deprecated in favor of getter methods inLinearRegression.CaseStatistics(double[] x, double y, int pred) Deprecated.TheCaseStatisticsconstructors have been deprecated in favor of getter methods inLinearRegression. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]Deprecated.Recommend using specific getter methods.double[]Returns the Confidence Interval of the population mean for an observation.doubleReturns Cook's Distance for an observation.doubleReturns DFFITS for an observation.doubleReturns the Jackknife Residual for an observation.doubleReturns the Leverage for an observation.doubleReturns the observed response for an observation.doubleReturns the predicted response for an observation.double[]Returns the Prediction Interval of the predicted response for an observation.doubleReturns the Residual for an observation.doubleReturns the Standardized Residual for an observation.voidsetConLevelMean(double conpcm) Sets the confidence level for two-sided confidence intervals of the population mean.voidsetConLevelPred(double conpcp) Sets the confidence level for two-sided prediction intervals.
-
Constructor Details
-
CaseStatistics
public CaseStatistics(double[] x, double y) Deprecated.TheCaseStatisticsconstructors have been deprecated in favor of getter methods inLinearRegression.Constructor for case statistics for an observation.- Parameters:
x- adoublearray containing the independent (explanatory) variables. Its length must be equal to the number of variables set in the LinearRegression constructor.y- adoublerepresenting the dependent (response) variable
-
CaseStatistics
public CaseStatistics(double[] x, double y, double w) Deprecated.TheCaseStatisticsconstructors have been deprecated in favor of getter methods inLinearRegression.Constructor for case statistics for an observation and a weight.- Parameters:
x- adoublearray containing the independent (explanatory) variables. Its length must be equal to the number of variables set in the constructor.y- adoublerepresenting the dependent (response) variablew- adoublerepresenting the weight
-
CaseStatistics
public CaseStatistics(double[] x, double y, double w, int pred) Deprecated.TheCaseStatisticsconstructors have been deprecated in favor of getter methods inLinearRegression.Constructor for case statistics for a new observation, weight, and future response count for the desired prediction interval.- Parameters:
x- adoublearray containing the independent (explanatory) variables. Its length must be equal to the number of variables set in the constructor.y- adoublerepresenting the dependent (response) variablew- adoublerepresenting the weightpred- anintrepresenting the number of future responses for which the prediction interval is desired on the average of the future responses
-
CaseStatistics
public CaseStatistics(double[] x, double y, int pred) Deprecated.TheCaseStatisticsconstructors have been deprecated in favor of getter methods inLinearRegression.Constructor for case statistics for a new observation and future response count for the desired prediction interval.- Parameters:
x- adoublearray containing the independent (explanatory) variables. Its length must be equal to the number of variables set in the constructor.y- adoublerepresenting the dependent (response) variablepred- anintrepresenting the number of future responses for which the prediction interval is desired on the average of the future responses.
-
-
Method Details
-
getCaseStatistics
public double[] getCaseStatistics()Deprecated.Recommend using specific getter methods.Returns the case statistics for an observation.- Returns:
- a
double[12] array containing the case statistics. Elements 0 through 11 contain the following:Index Description 0 Observed response 1 Predicted response 2 Residual 3 Leverage 4 Standardized residual 5 Jackknife residual 6 Cook's distance 7 DFFITS 8,9 Confidence interval on the mean 10,11 Prediction interval
-
getObservedResponse
public double getObservedResponse()Returns the observed response for an observation.- Returns:
- a
doublecontaining the observed response for an observation
-
getPredictedResponse
public double getPredictedResponse()Returns the predicted response for an observation.- Returns:
- a
doublecontaining the predicted response for an observation
-
getResidual
public double getResidual()Returns the Residual for an observation.- Returns:
- a
doublecontaining the residual for an observation
-
getLeverage
public double getLeverage()Returns the Leverage for an observation.- Returns:
- a
doublecontaining the Leverage for an observation
-
getStandardizedResidual
public double getStandardizedResidual()Returns the Standardized Residual for an observation.- Returns:
- a
doublecontaining the Standardized Residual for an observation
-
getJackknifeResidual
public double getJackknifeResidual()Returns the Jackknife Residual for an observation.- Returns:
- a
doublecontaining the Jackknife Residual for an observation
-
getCooksDistance
public double getCooksDistance()Returns Cook's Distance for an observation.- Returns:
- a
doublecontaining Cook's Distance for an observation
-
getDFFITS
public double getDFFITS()Returns DFFITS for an observation.- Returns:
- a
doublecontaining the DFFITS value for an observation
-
getConfidenceInterval
public double[] getConfidenceInterval()Returns the Confidence Interval of the population mean for an observation.The width of the confidence interval depends on the confidence level set by
setConLevelMean(double).- Returns:
- a
double[2] array containing the Confidence Interval of the population mean at the given observation.
-
getPredictionInterval
public double[] getPredictionInterval()Returns the Prediction Interval of the predicted response for an observation.The width of the prediction interval depends on the confidence level set by
setConLevelPred(double).- Returns:
- a
double[2] array containing the Prediction Interval of the predicted response at the given observation
-
setConLevelPred
public void setConLevelPred(double conpcp) Sets the confidence level for two-sided prediction intervals.- Parameters:
conpcp- adoubleused to set the confidence level for two-sided prediction intervals of a predicted response. Note thatconpcpmust be in the interval0to1inclusive. That is, it must be expressed as a probability.Default:
conpcp=.95.
-
setConLevelMean
public void setConLevelMean(double conpcm) Sets the confidence level for two-sided confidence intervals of the population mean.- Parameters:
conpcm- adoubleused to set the confidence level for two-sided confidence intervals of the population mean. Note thatconpcmmust be in the interval0to1inclusive. That is, it must be expressed as a probability.Default:
conpcm=.95.
-
CaseStatisticsconstructors have been deprecated in favor of getter methods inLinearRegression.