Package edu.cmu.tetrad.data
Class Histogram
java.lang.Object
edu.cmu.tetrad.data.Histogram
Model for a conditional histogram for mixed continuous and discrete variables.
- Version:
- $Id: $Id
- Author:
- josephramsey
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddConditioningVariable(String variable, double low, double high) Adds a continuous conditioning variables, conditioning on a range of values.voidaddConditioningVariable(String variable, int value) Adds a discrete conditioning variable, conditioning on a particular value.double[]getContinuousData(String variable) A convenience method to return the data for a particular named continuous variable.Getter for the fielddataSet.int[]getFrequencies.doublegetMax()For a continuous target, returns the maximum value of the values histogrammed, for the unconditioned data.doublegetMin()For a continuous target, returns the minimum value of the values histogrammed, for the unconditioned data.intgetN()For a continuous target, returns the number of values histogrammed.Getter for the fieldtarget.getTargetNode.voidremoveConditioningVariable(String variable) Removes a conditioning variable.voidsetNumBins(int numBins) For a continuous target, sets the number of bins for the histogram.
- 
Constructor Details
- 
Method Details- 
addConditioningVariableAdds a continuous conditioning variables, conditioning on a range of values.- Parameters:
- variable- The name of the variable in the data set.
- low- The low end of the conditioning range.
- high- The high end of the conditioning range.
 
- 
addConditioningVariableAdds a discrete conditioning variable, conditioning on a particular value.- Parameters:
- variable- The name of the variable in the data set.
- value- The value to condition on.
 
- 
removeConditioningVariableRemoves a conditioning variable.- Parameters:
- variable- The name of the conditioning variable to remove.
 
- 
setNumBinspublic void setNumBins(int numBins) For a continuous target, sets the number of bins for the histogram.- Parameters:
- numBins- The number of bins.
 
- 
getFrequenciespublic int[] getFrequencies()getFrequencies. - Returns:
- the counts for the histogram, one count for each target, in an integer array.
 
- 
getMaxpublic double getMax()For a continuous target, returns the maximum value of the values histogrammed, for the unconditioned data.- Returns:
- a double
 
- 
getMinpublic double getMin()For a continuous target, returns the minimum value of the values histogrammed, for the unconditioned data.- Returns:
- a double
 
- 
getNpublic int getN()For a continuous target, returns the number of values histogrammed. This may be less than the sample size of the data set because of conditioning.- Returns:
- a int
 
- 
getContinuousDataA convenience method to return the data for a particular named continuous variable.- Parameters:
- variable- The name of the variable.
- Returns:
- an array of objects
 
- 
getDataSetGetter for the field dataSet.- Returns:
- the data set for this histogram.
 
- 
getTargetGetter for the field target.- Returns:
- the target node being histogrammed. Could be continuous or discrete.
 
- 
getTargetNodegetTargetNode. - Returns:
- a Nodeobject
 
 
-