Package edu.cmu.tetrad.regression
Class RegressionResult
java.lang.Object
edu.cmu.tetrad.regression.RegressionResult
- All Implemented Interfaces:
TetradSerializable
,Serializable
Stores the various components of a regression result so they can be passed around together more easily.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRegressionResult
(boolean zeroInterceptAssumed, String[] regressorNames, int n, double[] b, double[] t, double[] p, double[] se, double r2, double rss, double alpha, Vector res) A result for a variety of regression algorithm. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
getCoef()
getCoef.int
getN()
Getter for the fieldn
.int
getNumRegressors.double[]
getP()
Getter for the fieldp
.getPreamble.double
getPredictedValue
(double[] x) getPredictedValue.String[]
Getter for the fieldregressorNames
.getResiduals.getResultsTable.double[]
getSe()
Getter for the fieldse
.double[]
getT()
Getter for the fieldt
.static RegressionResult
Generates a simple exemplar of this class to test serialization.toString()
toString.
-
Constructor Details
-
RegressionResult
public RegressionResult(boolean zeroInterceptAssumed, String[] regressorNames, int n, double[] b, double[] t, double[] p, double[] se, double r2, double rss, double alpha, Vector res) A result for a variety of regression algorithm.- Parameters:
zeroInterceptAssumed
- True iff a zero intercept was assumed in doing the regression, in which case this coefficient is provided; otherwise, not.regressorNames
- The list of regressor variable names, in order.n
- The sample size.b
- The list of coefficients, in order. If a zero intercept was not assumed, this list begins with the intercept.t
- The list of t-statistics for the coefficients, in order. If a zero intercept was not assumed, this list begins with the t statistic for the intercept.p
- The p-values for the coefficients, in order. If a zero intercept was not assumed, this list begins with the p value for the intercept.se
- The standard errors for the coefficients, in order. If a zero intercept was not assumed, this list begins with the standard error of the intercept.r2
- The R squared statistic for the regression.rss
- The residual sum of squares of the regression.alpha
- The alpha value for the regression, determining which regressors are taken to beres
- aVector
object
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
RegressionResult
object
-
getN
public int getN()Getter for the field
n
.- Returns:
- the number of data points.
-
getNumRegressors
public int getNumRegressors()getNumRegressors.
- Returns:
- the number of regressors.
-
getCoef
public double[] getCoef()getCoef.
- Returns:
- the array of regression coeffients.
-
getT
public double[] getT()Getter for the field
t
.- Returns:
- the array of t-statistics for the regression coefficients.
-
getP
public double[] getP()Getter for the field
p
.- Returns:
- the array of p-values for the regression coefficients.
-
getSe
public double[] getSe()Getter for the field
se
.- Returns:
- an array of objects
-
getRegressorNames
-
getPredictedValue
public double getPredictedValue(double[] x) getPredictedValue.
- Parameters:
x
- an array of objects- Returns:
- a double
-
toString
-
getResultsTable
-
getPreamble
-
getResiduals
-