Contents Previous Next


DefineChiSqBins Method (BDKInput Object)

Description

Defines the bins used to calculate the chi-squared goodness-of-fit test. Note: The definition of these bins does not change how distributions are fit, but only the results of the chi-square test.

Syntax

object.DefineChiSqBins(binStyle As BDKChiSqBinStyles, Optional numBins as Integer, Optional autoMinMax as Boolean, Optional min as Double, Optional max as Double, Optional firstBinIsOpen as Boolean, Optional lastBinIsOpen as Boolean , Optional customBinArray)

Arguments

binStyle (Required BDKChiSqBinStyle) – the nature of the bins being defined. The options are:

numBins (Optional Integer) - the number of chi-square bins. The number of bins must be at least 2 and no more than 1000. If this parameter is not supplied, and binStyle is not BDKBinStyleCustom, the number of bins is determined based on the number of values in the data set. If binStyle is BDK4_BinStyleCustom, the size of the customBinArray must be one more than numBins.

autoMinMax (Optional Boolean) - for equal interval bin style only, set this argument to TRUE to indicate that the minimum of the first chi-square bin and maximum of the last chi-squared bin should be automatically set to the smallest and highest sample data point of the data set. If not set, the min and max parameters are used instead.

min (Optional Double) - for equal interval bin style only, and only if autoMinMax is FALSE, this determines the minimum value of the first chi-sq bin.

max (Optional Double) - for equal interval bin style only, and only if autoMinMax is FALSE, this determines the maximum value of the last chi-sq bin.

firstBinIsOpen (Optional Boolean) - for equal interval bin style only, set this to TRUE to indicate that the first bin extends from minus infinity to the min.

lastBinIsOpen (Optional Boolean) - for equal interval bin style only, set this to TRUE to indicate that the last bin extends from the max value to plus infinity.

customBinArray (Optional Array of Doubles) - for custom bin style only, the boundaries of the bins. The size of this array must be one more than the number specified in numBins. It is legal for the first value to be BDKMinusInfinity and the last value to be BDKPlusInfinity. All values must be monotonically increasing. Keep in mind that sample values that fall exactly on a bin boundary will fall in the leftmost bin.

Return Value

None.

Example

'"auto" number of equal probability bins:
InputObj.DefineChiSqBins(BDKBinStyleEqualProbabilities)
'5 equal interval bins from 0 to 100..
InputObj.DefineChiSqBins(BDKBinStyleEqualIntervals, 5, FALSE, 10, 100)
'same as previous example, except two more bins from '- to 0 and 100 to +:
InputObj.DefineChiSqBins(BDKBinStyleEqualIntervals, 7, FALSE, 10, 100, TRUE, TRUE)
'5 custom bins with boundaries at 0, 1.5, 3, 4.5, 12.5, 25
Dim binBoundaries#(1 to 6)
binBoundaries(1) = 0
binBoundaries(2) = 1.5
binBoundaries(3) = 3
binBoundaries(4) = 4.5
binBoundaries(5) = 12.5
binBoundaries(6) = 25
InputObj.DefineChiSqBins(BDKBinStyleCustom, 5, FALSE, FALSE, FALSE, FALSE, FALSE, binBoundaries)