Package weka.classifiers.functions.pace

# Class NormalMixture

java.lang.Object
weka.classifiers.functions.pace.MixtureDistribution
weka.classifiers.functions.pace.NormalMixture

All Implemented Interfaces:
  `RevisionHandler`, `TechnicalInformationHandler`

public class NormalMixture extends MixtureDistribution
Class for manipulating normal mixture distributions.

For more information see:

Wang, Y (2000). A new approach to fitting linear models in high dimensional spaces. Hamilton, New Zealand.
Wang, Y., Witten, I. H.: Modeling for optimal probability prediction. In: Proceedings of the Nineteenth International Conference in Machine Learning, Sydney, Australia, 650-657, 2002. BibTeX:

     @phdthesis{Wang2000,
        address = {Hamilton, New Zealand},
        author = {Wang, Y},
        school = {Department of Computer Science, University of Waikato},
        title = {A new approach to fitting linear models in high dimensional spaces},
        year = {2000}
     }

     @inproceedings{Wang2002,
        address = {Sydney, Australia},
        author = {Wang, Y. and Witten, I. H.},
        booktitle = {Proceedings of the Nineteenth International Conference in Machine Learning},
        pages = {650-657},
        title = {Modeling for optimal probability prediction},
        year = {2002}
     }

Version:
  $Revision: 1.5 $
Author:
  Yong Wang (yongwang@cs.waikato.ac.nz)

## Field Summary

### Fields inherited from class weka.classifiers.functions.pace.MixtureDistribution

`NNMMethod, PMMethod`

## Constructor Summary

Constructors
Constructor
Description
`NormalMixture()`
Contructs an empty NormalMixture

## Method Summary

Modifier and Type
Method
Description
`double`
`empiricalBayesEstimate(double x)`
Returns the empirical Bayes estimate of a single value.
`DoubleVector`
`empiricalBayesEstimate(DoubleVector x)`
Returns the empirical Bayes estimate of a vector.
`double`
`f(double x)`
Computes the value of f(x) given the mixture.
`DoubleVector`
`f(DoubleVector x)`
Computes the value of f(x) given the mixture, where x is a vector.
`PaceMatrix`
`fittingIntervals(DoubleVector data)`
Contructs the set of fitting intervals for mixture estimation.
`String`
`getRevision()`
Returns the revision string.
`double`
`getSeparatingThreshold()`
Gets the separating threshold value.
`double`
`getTrimingThreshold()`
Gets the triming thresholding value.
`double`
`h(double x)`
Computes the value of h(x) given the mixture.
`DoubleVector`
`h(DoubleVector x)`
Computes the value of h(x) given the mixture, where x is a vector.
`double`
`hf(double x)`
Computes the value of h(x) / f(x) given the mixture.
`static void`
`main(String[] args)`
Method to test this class
`DoubleVector`
`nestedEstimate(DoubleVector x)`
Returns the optimal nested model estimate of a vector.
`PaceMatrix`
`probabilityMatrix(DoubleVector s, PaceMatrix intervals)`
Contructs the probability matrix for mixture estimation, given a set of support points and a set of intervals.
`boolean`
`separable(DoubleVector data, int i0, int i1, double x)`
Return true if a value can be considered for mixture estimatino separately from the data indexed between i0 and i1
`void`
`setSeparatingThreshold(double t)`
Sets the separating threshold value
`void`
`setTrimingThreshold(double t)`
Sets the triming thresholding value.
`DoubleVector`
`subsetEstimate(DoubleVector x)`
Returns the estimate of optimal subset selection.
`DoubleVector`
`supportPoints(DoubleVector data, int ne)`
Contructs the set of support points for mixture estimation.
`String`
`toString()`
Converts to a string
`void`
`trim(DoubleVector x)`
Trims the small values of the estaimte

### Methods inherited from class weka.classifiers.functions.pace.MixtureDistribution

`empiricalProbability, fit, fit, fitForSingleCluster, getMixingDistribution, getTechnicalInformation, setMixingDistribution`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### NormalMixture

public NormalMixture()
Contructs an empty NormalMixture

## Method Details

### getSeparatingThreshold

public double getSeparatingThreshold()
Gets the separating threshold value. This value is used by the method separatable

Returns:
  the separating threshold

### setSeparatingThreshold

public void setSeparatingThreshold(double t)
Sets the separating threshold value

Parameters:
  `t` - the threshold value

### getTrimingThreshold

public double getTrimingThreshold()
Gets the triming thresholding value. This value is usef by the method trim.

Returns:
  the triming thresholding

### setTrimingThreshold

public void setTrimingThreshold(double t)
Sets the triming thresholding value.

Parameters:
  `t` - the triming thresholding

### separable

public boolean separable(DoubleVector data, int i0, int i1, double x)
Return true if a value can be considered for mixture estimatino separately from the data indexed between i0 and i1

Specified by:
  `separable` in class `MixtureDistribution`
Parameters:
  `data` - the data supposedly generated from the mixture
  `i0` - the index of the first element in the group
  `i1` - the index of the last element in the group
  `x` - the value
Returns:
  true if the value can be considered

### supportPoints

public DoubleVector supportPoints(DoubleVector data, int ne)
Contructs the set of support points for mixture estimation.

Specified by:
  `supportPoints` in class `MixtureDistribution`
Parameters:
  `data` - the data supposedly generated from the mixture
  `ne` - the number of extra data that are suppposedly discarded earlier and not passed into here
Returns:
  the set of support points

### fittingIntervals

public PaceMatrix fittingIntervals(DoubleVector data)
Contructs the set of fitting intervals for mixture estimation.

Specified by:
  `fittingIntervals` in class `MixtureDistribution`
Parameters:
  `data` - the data supposedly generated from the mixture
Returns:
  the set of fitting intervals

### probabilityMatrix

public PaceMatrix probabilityMatrix(DoubleVector s, PaceMatrix intervals)
Contructs the probability matrix for mixture estimation, given a set of support points and a set of intervals.

Specified by:
  `probabilityMatrix` in class `MixtureDistribution`
Parameters:
  `s` - the set of support points
  `intervals` - the intervals
Returns:
  the probability matrix

### empiricalBayesEstimate

public double empiricalBayesEstimate(double x)
Returns the empirical Bayes estimate of a single value.

Parameters:
  `x` - the value
Returns:
  the empirical Bayes estimate

### empiricalBayesEstimate

public DoubleVector empiricalBayesEstimate(DoubleVector x)
Returns the empirical Bayes estimate of a vector.

Parameters:
  `x` - the vector
Returns:
  the empirical Bayes estimate

### nestedEstimate

public DoubleVector nestedEstimate(DoubleVector x)
Returns the optimal nested model estimate of a vector.

Parameters:
  `x` - the vector
Returns:
  the optimal nested model estimate

### subsetEstimate

public DoubleVector subsetEstimate(DoubleVector x)
Returns the estimate of optimal subset selection.

Parameters:
  `x` - the vector
Returns:
  the estimate of optimal subset selection

### trim

public void trim(DoubleVector x)
Trims the small values of the estaimte

Parameters:
  `x` - the estimate vector

### hf

public double hf(double x)
Computes the value of h(x) / f(x) given the mixture. The implementation avoided overflow.

Parameters:
  `x` - the value
Returns:
  the value of h(x) / f(x)

### h

public double h(double x)
Computes the value of h(x) given the mixture.

Parameters:
  `x` - the value
Returns:
  the value of h(x)

### h

public DoubleVector h(DoubleVector x)
Computes the value of h(x) given the mixture, where x is a vector.

Parameters:
  `x` - the vector
Returns:
  the value of h(x)

### f

public double f(double x)
Computes the value of f(x) given the mixture.

Parameters:
  `x` - the value
Returns:
  the value of f(x)

### f

public DoubleVector f(DoubleVector x)
Computes the value of f(x) given the mixture, where x is a vector.

Parameters:
  `x` - the vector
Returns:
  the value of f(x)

### toString

public String toString()
Converts to a string

Overrides:
  `toString` in class `MixtureDistribution`
Returns:
  a string representation

### getRevision

public String getRevision()
Returns the revision string.

Returns:
  the revision

### main

public static void main(String[] args)
Method to test this class

Parameters:
  `args` - the commandline arguments - ignored