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.
- 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()
int
getN()
int
double[]
getP()
double
getPredictedValue
(double[] x) String[]
double[]
getSe()
double[]
getT()
static RegressionResult
Generates a simple exemplar of this class to test serialization.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 be
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization. -
getN
public int getN()- Returns:
- the number of data points.
-
getNumRegressors
public int getNumRegressors()- Returns:
- the number of regressors.
-
getCoef
public double[] getCoef()- Returns:
- the array of regression coeffients.
-
getT
public double[] getT()- Returns:
- the array of t-statistics for the regression coefficients.
-
getP
public double[] getP()- Returns:
- the array of p-values for the regression coefficients.
-
getSe
public double[] getSe() -
getRegressorNames
-
getPredictedValue
public double getPredictedValue(double[] x) -
toString
-
getResultsTable
-
getPreamble
-
getResiduals
-