edu.ucla.stat.SOCR.modeler
Class BetaFit_Modeler

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

public class BetaFit_Modeler
extends java.lang.Object
implements Modeler, java.awt.event.ItemListener

This class Designs a Beta model fitting curve.


Field Summary
 BetaGeneralDistribution dBeta
           
 javax.swing.JCheckBox estimateParams
           
 float kernalVar
           
 javax.swing.JTextField kernalVarField
           
 javax.swing.JTextField leftLimitField
           
 javax.swing.JLabel leftLimitLabel
           
 javax.swing.JTextField leftParamField
           
 javax.swing.JLabel leftParamLabel
           
 javax.swing.JTextField rightLimitField
           
 javax.swing.JLabel rightLimitLabel
           
 javax.swing.JTextField rightParamField
           
 javax.swing.JLabel rightParamLabel
           
static int SLICE_SIZE
           
 javax.swing.JCheckBox userParams
           
 
Fields inherited from interface edu.ucla.stat.SOCR.core.Modeler
CONTINUOUS_DISTRIBUTION_TYPE, DISCRETE_DISTRIBUTION_TYPE, FOURIER_TYPE, MIXED_DISTRIBUTION_TYPE, WAVELET_TYPE
 
Constructor Summary
BetaFit_Modeler()
           
BetaFit_Modeler(javax.swing.JPanel controlpanel)
           
 
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)
           
 void fitCurve(float[] rawDat, float minx, float 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()
 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 -- like tutorial/instriction for users.
 double getGraphLowerLimit()
           
 double getGraphUpperLimit()
           
 java.lang.String getInstructions()
          return the instructions for using this modeler
 double getLowerLimit()
          return the allowaable 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()
          return 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 toggleParams(boolean istrue)
           
 boolean useInitButton()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dBeta

public BetaGeneralDistribution dBeta

estimateParams

public javax.swing.JCheckBox estimateParams

userParams

public javax.swing.JCheckBox userParams

leftParamField

public javax.swing.JTextField leftParamField

leftParamLabel

public javax.swing.JLabel leftParamLabel

rightParamField

public javax.swing.JTextField rightParamField

rightParamLabel

public javax.swing.JLabel rightParamLabel

leftLimitField

public javax.swing.JTextField leftLimitField

leftLimitLabel

public javax.swing.JLabel leftLimitLabel

rightLimitField

public javax.swing.JTextField rightLimitField

rightLimitLabel

public javax.swing.JLabel rightLimitLabel

kernalVar

public float kernalVar

kernalVarField

public javax.swing.JTextField kernalVarField

SLICE_SIZE

public static final int SLICE_SIZE
See Also:
Constant Field Values
Constructor Detail

BetaFit_Modeler

public BetaFit_Modeler()

BetaFit_Modeler

public BetaFit_Modeler(javax.swing.JPanel controlpanel)
Method Detail

addParams

public void addParams(javax.swing.JPanel controlpanel)

registerObservers

public void registerObservers(ObservableWrapper o)
Specified by:
registerObservers in interface Modeler

getLowerLimit

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

Specified by:
getLowerLimit in interface Modeler
Returns:

getUpperLimit

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

Specified by:
getUpperLimit in interface Modeler
Returns:

toggleParams

public void toggleParams(boolean istrue)

returnModelX

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

Specified by:
returnModelX in interface Modeler
Returns:

returnModelY

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

Specified by:
returnModelY in interface Modeler
Returns:

getModelCount

public int getModelCount()
Description copied from interface: 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

Specified by:
getModelCount in interface Modeler
Returns:

generateSamples

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

Specified by:
generateSamples in interface Modeler
Returns:

itemStateChanged

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

fitCurve

public void fitCurve(float[] rawDat,
                     double minx,
                     double maxx,
                     javax.swing.JTextArea resultPanelTextArea,
                     boolean rescaleClicked,
                     boolean scaleUp,
                     boolean initReset)
Specified by:
fitCurve in interface Modeler

fitCurve

public void fitCurve(float[] rawDat,
                     float minx,
                     float maxx,
                     javax.swing.JTextArea resultPanelTextArea,
                     boolean rescaleClicked,
                     boolean scaleUp,
                     boolean initReset)
Description copied from interface: 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()

Specified by:
fitCurve in interface Modeler

getModelType

public int getModelType()
Description copied from interface: 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.

Specified by:
getModelType in interface Modeler

getDescription

public java.lang.String getDescription()
return the description for this modeler -- like tutorial/instriction for users.

Specified by:
getDescription in interface Modeler

getInstructions

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

Specified by:
getInstructions in interface Modeler

getResearch

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

Specified by:
getResearch in interface Modeler

isContinuous

public boolean isContinuous()
Specified by:
isContinuous in interface Modeler

getGraphLowerLimit

public double getGraphLowerLimit()
Specified by:
getGraphLowerLimit in interface Modeler

getGraphUpperLimit

public double getGraphUpperLimit()
Specified by:
getGraphUpperLimit in interface Modeler

useInitButton

public boolean useInitButton()
Specified by:
useInitButton in interface Modeler