gmm
Class GMMEstimator

java.lang.Object
  extended by gmm.GMMEstimator
Direct Known Subclasses:
AStar, FVHeuristic, GreedyCSS, GreedyDK, RandomEstimator

public abstract class GMMEstimator
extends java.lang.Object

This abstract class represents a estimator of the Generalized Mallows Model. It contains generic functionality that any estimator will need. Any particular estimator must inherit from this class.


Field Summary
protected  boolean GMM
           
protected  float logL
           
protected static int maxIters
           
protected  int n
           
protected  int[] pi
           
protected  float[][] Q
           
protected  long runningTime
           
protected  float[] theta
           
protected  float[] V
           
 
Constructor Summary
GMMEstimator(boolean GMM, float[][] Q)
           
 
Method Summary
protected  void computeLogL()
          Must be called by a subclass only after the theta values have been set.
protected  void computeThetas()
          Sets the theta values.
protected  void computeVjs()
          Sets the V_j values.
 float getAvgDk()
           
 float getLogL()
           
 float getLogLForQ(float[][] argQ)
           
 int[] getPi()
           
 long getRunningTime()
           
protected  float lnPsiJPrime(int j, float thetaJ)
           
protected  float minimizeF(float D)
           
protected  float minimizeFj(int j, float Vj)
           
 float minValueOfFj(int j, float Vj)
           
 void printLearnedModel(java.io.PrintWriter out)
           
protected  float PsiJ(int j, float thetaJ)
           
abstract  void run()
          This method causes the estimator to run, and estimate the GMM parameters.
protected  float sumOfLnPsiJPrime(int startJ, int endJ, float thetaJ)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GMM

protected boolean GMM

Q

protected float[][] Q

n

protected int n

pi

protected int[] pi

theta

protected float[] theta

V

protected float[] V

logL

protected float logL

runningTime

protected long runningTime

maxIters

protected static int maxIters
Constructor Detail

GMMEstimator

public GMMEstimator(boolean GMM,
                    float[][] Q)
Method Detail

run

public abstract void run()
                  throws java.lang.Exception
This method causes the estimator to run, and estimate the GMM parameters. Any estimator must provide a concrete implementation of this method.

Throws:
java.lang.Exception

getPi

public int[] getPi()
Returns:
the estimated modal ranking.

getAvgDk

public float getAvgDk()
Returns:
the average Kendall distance of estimated modal ranking pi from the rankings in the sample.

getLogL

public float getLogL()

getRunningTime

public long getRunningTime()

printLearnedModel

public void printLearnedModel(java.io.PrintWriter out)

PsiJ

protected float PsiJ(int j,
                     float thetaJ)

lnPsiJPrime

protected float lnPsiJPrime(int j,
                            float thetaJ)
Parameters:
j -
thetaJ -
Returns:
the derivative of ln psi_j(thetaJ), or g_j'(thetaJ).

sumOfLnPsiJPrime

protected float sumOfLnPsiJPrime(int startJ,
                                 int endJ,
                                 float thetaJ)

minimizeFj

protected float minimizeFj(int j,
                           float Vj)
Parameters:
j -
Vj -
Returns:
the value of theta_j >= 0 that minimizes the function f_j that comes up in GMM (multiple thetas case).

minValueOfFj

public float minValueOfFj(int j,
                          float Vj)
Parameters:
j -
Vj -
Returns:
the minimum value of the function f_j that comes up in GMM.

minimizeF

protected float minimizeF(float D)
Parameters:
D -
Returns:
the value of theta >= 0 that minimizes the function f that comes up in the Mallows Model (single theta case).

computeVjs

protected void computeVjs()
Sets the V_j values. Must be called by a subclass only after it has estimated the modal ranking pi.


computeThetas

protected void computeThetas()
Sets the theta values. Must be called by a subclass only after it has set the V_j values.


computeLogL

protected void computeLogL()
Must be called by a subclass only after the theta values have been set.


getLogLForQ

public float getLogLForQ(float[][] argQ)