edu.ucla.stat.SOCR.modeler
Class ChiSquareFit_Modeler

java.lang.Object
  extended by edu.ucla.stat.SOCR.modeler.Modeler
      extended by edu.ucla.stat.SOCR.modeler.ChiSquareFit_Modeler
All Implemented Interfaces:
java.awt.event.ItemListener, java.util.EventListener

public class ChiSquareFit_Modeler
extends Modeler
implements java.awt.event.ItemListener

This class Designs a ChiSquare Fit model fitting curve.


Field Summary
 ChiSquareDistribution ChiSquareDistr
           
 javax.swing.table.TableColumn clm2
           
 JSci.maths.DoubleVector coeffs
           
 javax.swing.JTextField dfParamField
           
 javax.swing.JLabel dfParamLabel
           
 javax.swing.JCheckBox estimateParams
           
 float kernalVar
           
 javax.swing.JTextField kernalVarField
           
 javax.swing.JCheckBox rawCheck
           
static int SLICE_SIZE
           
 javax.swing.JCheckBox userParams
           
 
Fields inherited from class edu.ucla.stat.SOCR.modeler.Modeler
CONTINUOUS_DISTRIBUTION_TYPE, DISCRETE_DISTRIBUTION_TYPE, FOURIER_TYPE, MIXED_DISTRIBUTION_TYPE, WAVELET_TYPE
 
Constructor Summary
ChiSquareFit_Modeler()
          This method initializes the applet, including the toolbar, scatterplot, and statistics table.
ChiSquareFit_Modeler(javax.swing.JPanel controlpanel)
          ChiSquareFit_Modeler Constructor.
 
Method Summary
 void addParams(javax.swing.JPanel controlpanel)
           
 void fitCurve(float[] rawDat, double minx, double maxx, javax.swing.JTextArea resultPanelTextArea, boolean rescaleClicked, boolean scaleUp, boolean initReset)
          takes data along with x, y limits and fits a pdf to the data range and stores the resulting model fit in data arrays that must be returned by calls to returnModelX() and returnModelY()
 void fitCurve(float[] rawDat, float minx, float maxx, double mu0, double sigma, boolean plotBlocks, boolean scaleUp)
          fitCurve for ChiSquare Model
 void fitCurve(float[] rawDat, float minx, float maxx, javax.swing.JTextArea resultPanelTextArea, boolean rescaleClicked, boolean scaleUp, boolean initReset)
           
 double[] generateSamples(int sampleCount)
          generates samples from the distribution and returns a double[] data type
 java.lang.String getDescription()
          return the description for this modeler
 double getGraphLowerLimit()
           
 double getGraphUpperLimit()
           
 java.lang.String getInstructions()
          Returns the instructions for using this modeler
 double getLowerLimit()
          return the allowable x limit values.
 int getModelCount()
          return the number of models to be plotted.
 int getModelType()
          returns one if model is of distribution and needs to be rescaled for display.
 java.lang.String getResearch()
          Returns the references for this modeler
 double getUpperLimit()
          return the allowaable x limit values.
 boolean isContinuous()
           
 void itemStateChanged(java.awt.event.ItemEvent event)
           
 void registerObservers(ObservableWrapper o)
           
 double[] returnModelX()
          returns the fitted model values for X axis
 double[] returnModelY()
          returns the fitted densisty for corresponding X axis values
 void setSliceSize(int size)
           
 void toggleParams(boolean istrue)
           
 boolean useInitButton()
          What is this method used for?
 
Methods inherited from class edu.ucla.stat.SOCR.modeler.Modeler
getKSModelTestString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

estimateParams

public javax.swing.JCheckBox estimateParams

userParams

public javax.swing.JCheckBox userParams

ChiSquareDistr

public ChiSquareDistribution ChiSquareDistr

kernalVar

public float kernalVar

dfParamField

public javax.swing.JTextField dfParamField

dfParamLabel

public javax.swing.JLabel dfParamLabel

coeffs

public JSci.maths.DoubleVector coeffs

clm2

public javax.swing.table.TableColumn clm2

kernalVarField

public javax.swing.JTextField kernalVarField

rawCheck

public javax.swing.JCheckBox rawCheck

SLICE_SIZE

public static int SLICE_SIZE
Constructor Detail

ChiSquareFit_Modeler

public ChiSquareFit_Modeler()
This method initializes the applet, including the toolbar, scatterplot, and statistics table.


ChiSquareFit_Modeler

public ChiSquareFit_Modeler(javax.swing.JPanel controlpanel)
ChiSquareFit_Modeler Constructor.

Method Detail

registerObservers

public void registerObservers(ObservableWrapper o)
Overrides:
registerObservers in class Modeler

addParams

public void addParams(javax.swing.JPanel controlpanel)

getModelType

public int getModelType()
Description copied from class: Modeler
returns one if model is of distribution and needs to be rescaled for display. Returns 0 if model does not require scaling. EG: Polynomial fit is type 0 and normal distribution is type 1.

Overrides:
getModelType in class Modeler

getLowerLimit

public double getLowerLimit()
Description copied from class: Modeler
return the allowable x limit values. This method should return the lower limit. eg: for a normal distribution lowerlimit = NEGATIVE_INFINITY

Overrides:
getLowerLimit in class Modeler

getUpperLimit

public double getUpperLimit()
Description copied from class: Modeler
return the allowaable x limit values. This method should return the upper limit. eg: for a normal distribution upperlimit = POSITIVE_INFINITY

Overrides:
getUpperLimit in class Modeler

returnModelX

public double[] returnModelX()
Description copied from class: Modeler
returns the fitted model values for X axis

Overrides:
returnModelX in class Modeler

returnModelY

public double[] returnModelY()
Description copied from class: Modeler
returns the fitted densisty for corresponding X axis values

Overrides:
returnModelY in class Modeler

toggleParams

public void toggleParams(boolean istrue)

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent event)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

generateSamples

public double[] generateSamples(int sampleCount)
Description copied from class: Modeler
generates samples from the distribution and returns a double[] data type

Overrides:
generateSamples in class Modeler

getModelCount

public int getModelCount()
Description copied from class: Modeler
return the number of models to be plotted. If n models are returned, the vectors from returnModelX and returnModelY will be split into n equal sub sections and plotted

Overrides:
getModelCount in class Modeler
Returns:

fitCurve

public void fitCurve(float[] rawDat,
                     double minx,
                     double maxx,
                     javax.swing.JTextArea resultPanelTextArea,
                     boolean rescaleClicked,
                     boolean scaleUp,
                     boolean initReset)
Description copied from class: Modeler
takes data along with x, y limits and fits a pdf to the data range and stores the resulting model fit in data arrays that must be returned by calls to returnModelX() and returnModelY()

Overrides:
fitCurve in class Modeler

fitCurve

public void fitCurve(float[] rawDat,
                     float minx,
                     float maxx,
                     javax.swing.JTextArea resultPanelTextArea,
                     boolean rescaleClicked,
                     boolean scaleUp,
                     boolean initReset)

fitCurve

public void fitCurve(float[] rawDat,
                     float minx,
                     float maxx,
                     double mu0,
                     double sigma,
                     boolean plotBlocks,
                     boolean scaleUp)
fitCurve for ChiSquare Model


getDescription

public java.lang.String getDescription()
Description copied from class: Modeler
return the description for this modeler

Overrides:
getDescription in class Modeler

getInstructions

public java.lang.String getInstructions()
Returns the instructions for using this modeler

Overrides:
getInstructions in class Modeler

getResearch

public java.lang.String getResearch()
Returns the references for this modeler

Overrides:
getResearch in class Modeler

isContinuous

public boolean isContinuous()
Overrides:
isContinuous in class Modeler

getGraphLowerLimit

public double getGraphLowerLimit()
Overrides:
getGraphLowerLimit in class Modeler

getGraphUpperLimit

public double getGraphUpperLimit()
Overrides:
getGraphUpperLimit in class Modeler

useInitButton

public boolean useInitButton()
Description copied from class: Modeler
What is this method used for?

Overrides:
useInitButton in class Modeler

setSliceSize

public void setSliceSize(int size)