org.codehaus.jet.regression.estimators
Class AbstractInformationCriterionEstimator

java.lang.Object
  extended by org.codehaus.jet.regression.estimators.AbstractInformationCriterionEstimator
All Implemented Interfaces:
InformationCriterionEstimator
Direct Known Subclasses:
AkaikeInformationCriterionEstimator, HannanQuinnInformationCriterionEstimator, SchwarzInformationCriterionEstimator

public abstract class AbstractInformationCriterionEstimator
extends java.lang.Object
implements InformationCriterionEstimator

Abstract base class for implementations of InformationCriterionEstimator

Author:
Mauro Talevi

Constructor Summary
protected AbstractInformationCriterionEstimator()
          Creates an AbstractInformationCriterionEstimator with a defaultregression estimator
protected AbstractInformationCriterionEstimator(MultipleLinearRegressionEstimator regression)
          Creates an AbstractInformationCriterionEstimator with a given regression estimator
 
Method Summary
 void addData(double[] y)
          Adds sample data
protected abstract  double calculateIC(int p, int t, double var)
           
protected  double calculateYVariance(int p)
          Calculates the variance on the sample for a given lag order
protected static MultipleLinearRegressionEstimator createDefaultRegressionEstimator()
           
 double estimateIC(int p)
          Estimates the IC value for a given lag order
protected  int getSampleSize()
           
 int minimiseIC(int minLag, int maxLag)
          Minimise the IC value for a given lag order interval
protected  double[] toRegressands(double[] y, int p)
          Converts sample to regression regressand
protected  double[][] toRegressors(double[] y, int p)
          Converts sample to regression regressors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractInformationCriterionEstimator

protected AbstractInformationCriterionEstimator()
Creates an AbstractInformationCriterionEstimator with a defaultregression estimator


AbstractInformationCriterionEstimator

protected AbstractInformationCriterionEstimator(MultipleLinearRegressionEstimator regression)
Creates an AbstractInformationCriterionEstimator with a given regression estimator

Parameters:
regression - the GeneralLinearRegression
Method Detail

addData

public void addData(double[] y)
Description copied from interface: InformationCriterionEstimator
Adds sample data

Specified by:
addData in interface InformationCriterionEstimator
Parameters:
y - the array of size T representing the y sample

minimiseIC

public int minimiseIC(int minLag,
                      int maxLag)
Description copied from interface: InformationCriterionEstimator
Minimise the IC value for a given lag order interval

Specified by:
minimiseIC in interface InformationCriterionEstimator
Parameters:
minLag - the minimum lag order used
maxLag - the maximum lag order used
Returns:
The lag order that minimises the IC

getSampleSize

protected int getSampleSize()

calculateYVariance

protected double calculateYVariance(int p)
Calculates the variance on the sample for a given lag order

Parameters:
p - the lag order
Returns:
The variance obtained from the regression

toRegressands

protected double[] toRegressands(double[] y,
                                 int p)
Converts sample to regression regressand

Parameters:
y - the sample
p - the lag order
Returns:
The [n-p,1] array of regressands

toRegressors

protected double[][] toRegressors(double[] y,
                                  int p)
Converts sample to regression regressors

Parameters:
y - the sample
p - the lag order
Returns:
The [n-p,p] array of regressors

estimateIC

public double estimateIC(int p)
Description copied from interface: InformationCriterionEstimator
Estimates the IC value for a given lag order

Specified by:
estimateIC in interface InformationCriterionEstimator
Parameters:
p - the lag order used
Returns:
The value of the IC

calculateIC

protected abstract double calculateIC(int p,
                                      int t,
                                      double var)

createDefaultRegressionEstimator

protected static MultipleLinearRegressionEstimator createDefaultRegressionEstimator()


Copyright © 2006-2007. All Rights Reserved.