gov.sandia.cognition.learning.algorithm.regression
Class LinearRegression.Statistic

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.method.AbstractConfidenceStatistic
          extended by gov.sandia.cognition.learning.algorithm.regression.LinearRegression.Statistic
All Implemented Interfaces:
ConfidenceStatistic, CloneableSerializable, Serializable, Cloneable
Enclosing class:
LinearRegression

public static class LinearRegression.Statistic
extends AbstractConfidenceStatistic

Computes regression statistics using a chi-square measure of the statistical significance of the learned approximator

See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.sandia.cognition.statistics.method.AbstractConfidenceStatistic
nullHypothesisProbability
 
Constructor Summary
LinearRegression.Statistic(Collection<Double> targets, Collection<Double> estimates, Collection<Double> weights, int numParameters)
          Creates a new instance of Statistic
LinearRegression.Statistic(Collection<Double> targets, Collection<Double> estimates, int numParameters)
          Creates a new instance of Statistic
 
Method Summary
 LinearRegression.Statistic clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 double getChiSquare()
          Getter for chiSquare
 double getDegreesOfFreedom()
          Getter for degreesOfFreedom
 double getMeanL1Error()
          Getter for meanL1Error
 int getNumParameters()
          Getter for numParameters
 int getNumSamples()
          Getter for numSamples
 double getRootMeanSquaredError()
          Getter for rootMeanSquaredError
 double getTargetEstimateCorrelation()
          Getter for targetEstimateCorrelation
 double getTestStatistic()
          Gets the statistic from which we compute the null-hypothesis probability.
 double getUnpredictedErrorFraction()
          Getter for unpredictedErrorFraction
 void setChiSquare(double chiSquare)
          Setter for chiSquare
protected  void setDegreesOfFreedom(double degreesOfFreedom)
          Setter for degreesOfFreedom
protected  void setMeanL1Error(double meanL1Error)
          Setter for meanL1Error
 void setNumParameters(int numParameters)
          Setter for numParameters
protected  void setNumSamples(int numSamples)
          Setter for numSamples
protected  void setRootMeanSquaredError(double rootMeanSquaredError)
          Setter fpr rootMeanSquaredError
protected  void setTargetEstimateCorrelation(double targetEstimateCorrelation)
          Setter for targetEstimateCorrelation
protected  void setUnpredictedErrorFraction(double unpredictedErrorFraction)
          Setter for unpredictedErrorFraction
 
Methods inherited from class gov.sandia.cognition.statistics.method.AbstractConfidenceStatistic
getNullHypothesisProbability, setNullHypothesisProbability, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinearRegression.Statistic

public LinearRegression.Statistic(Collection<Double> targets,
                                  Collection<Double> estimates,
                                  int numParameters)
Creates a new instance of Statistic

Parameters:
targets - Collection of ground-truth targets for the learned approximator
estimates - Collection of estimates from the learned approximator
numParameters - Number of parameters in the learned approximator

LinearRegression.Statistic

public LinearRegression.Statistic(Collection<Double> targets,
                                  Collection<Double> estimates,
                                  Collection<Double> weights,
                                  int numParameters)
Creates a new instance of Statistic

Parameters:
targets - Collection of ground-truth targets for the learned approximator
estimates - Collection of estimates from the learned approximator
weights - Collection of weights to apply to the corresponding target-estimate pair
numParameters - Number of parameters in the learned approximator
Method Detail

clone

public LinearRegression.Statistic clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractCloneableSerializable
Returns:
A clone of this object.

getRootMeanSquaredError

public double getRootMeanSquaredError()
Getter for rootMeanSquaredError

Returns:
Root mean-squared error of the targets and estimates

setRootMeanSquaredError

protected void setRootMeanSquaredError(double rootMeanSquaredError)
Setter fpr rootMeanSquaredError

Parameters:
rootMeanSquaredError - Root mean-squared error of the targets and estimates

getTargetEstimateCorrelation

public double getTargetEstimateCorrelation()
Getter for targetEstimateCorrelation

Returns:
Pearson Correlation between the targets and estimates, [-1,1]

setTargetEstimateCorrelation

protected void setTargetEstimateCorrelation(double targetEstimateCorrelation)
Setter for targetEstimateCorrelation

Parameters:
targetEstimateCorrelation - Pearson Correlation between the targets and estimates, [-1,1]

getUnpredictedErrorFraction

public double getUnpredictedErrorFraction()
Getter for unpredictedErrorFraction

Returns:
Fraction of variance unaccounted for in the predictions, [0,1]

setUnpredictedErrorFraction

protected void setUnpredictedErrorFraction(double unpredictedErrorFraction)
Setter for unpredictedErrorFraction

Parameters:
unpredictedErrorFraction - Fraction of variance unaccounted for in the predictions, [0,1]

getNumSamples

public int getNumSamples()
Getter for numSamples

Returns:
Number of samples used to create the Regression

setNumSamples

protected void setNumSamples(int numSamples)
Setter for numSamples

Parameters:
numSamples - Number of samples used to create the Regression

getDegreesOfFreedom

public double getDegreesOfFreedom()
Getter for degreesOfFreedom

Returns:
Degrees of freedom in the Regression = numSamples-numParameters

setDegreesOfFreedom

protected void setDegreesOfFreedom(double degreesOfFreedom)
Setter for degreesOfFreedom

Parameters:
degreesOfFreedom - Degrees of freedom in the Regression = numSamples-numParameters

getMeanL1Error

public double getMeanL1Error()
Getter for meanL1Error

Returns:
Average L1-norm error (absolute value difference) between the targets and estimates

setMeanL1Error

protected void setMeanL1Error(double meanL1Error)
Setter for meanL1Error

Parameters:
meanL1Error - Average L1-norm error (absolute value difference) between the targets and estimates

getNumParameters

public int getNumParameters()
Getter for numParameters

Returns:
Number of parameters in the learned approximator

setNumParameters

public void setNumParameters(int numParameters)
Setter for numParameters

Parameters:
numParameters - Number of parameters in the learned approximator

getChiSquare

public double getChiSquare()
Getter for chiSquare

Returns:
Gets the value of the chi-square variable, Total weighted sum-squared error between the targets and estimates

setChiSquare

public void setChiSquare(double chiSquare)
Setter for chiSquare

Parameters:
chiSquare - Gets the value of the chi-square variable, Total weighted sum-squared error between the targets and estimates

getTestStatistic

public double getTestStatistic()
Description copied from interface: ConfidenceStatistic
Gets the statistic from which we compute the null-hypothesis probability. In an ANOVA, this would be the "F" statistic. In a t-test, this would be the "t" value. And so forth.

Returns:
Confidence statistic used to compute the null-hypothesis probability.