Class MixtureModel
java.lang.Object
edu.cmu.tetrad.search.work_in_progress.MixtureModel
Represents a Gaussian mixture model -- a dataset with data sampled from two or more multivariate Gaussian
distributions.
- Version:
- $Id: $Id
- Author:
- Madelyn Glymour
-
Constructor Summary
ConstructorsConstructorDescriptionMixtureModel(DataSet data, double[][] dataArray, double[][] meansArray, double[] weightsArray, Matrix[] variancesArray, double[][] gammaArray) Constructs a mixture model from a mixed data set, a means matrix, a weights array, a variance matrix, and a gamma matrix. -
Method Summary
Modifier and TypeMethodDescriptionint[]getCases()Getter for the fieldcases.double[][]getData()Getter for the fielddata.DataSet[]getDemixedData.intgetDistribution(int caseNum) Classifies a given case into a model, based on which model has the highest gamma value for that case.double[][]getMeans()getMeans.Matrix[]getVariances.double[]getWeights.double[]Perform an FGES search on each of the demixed data sets.
-
Constructor Details
-
MixtureModel
public MixtureModel(DataSet data, double[][] dataArray, double[][] meansArray, double[] weightsArray, Matrix[] variancesArray, double[][] gammaArray) Constructs a mixture model from a mixed data set, a means matrix, a weights array, a variance matrix, and a gamma matrix.- Parameters:
data- the mixed data setdataArray- the mixed data set in array formmeansArray- the means matrixweightsArray- the weights arrayvariancesArray- the variance matrixgammaArray- the gamma matrix
-
-
Method Details
-
getData
public double[][] getData()Getter for the field
data.- Returns:
- the mixed data set in array form
-
getMeans
public double[][] getMeans()getMeans.
- Returns:
- the means matrix
-
getWeights
public double[] getWeights()getWeights.
- Returns:
- the weights array
-
getVariances
getVariances.
- Returns:
- the variance matrix
-
getCases
public int[] getCases()Getter for the field
cases.- Returns:
- an array assigning each case an integer corresponding to a model
-
getDistribution
public int getDistribution(int caseNum) Classifies a given case into a model, based on which model has the highest gamma value for that case.- Parameters:
caseNum- a int- Returns:
- a int
-
getDemixedData
getDemixedData.
- Returns:
- an array of
DataSetobjects
-
searchDemixedData
Perform an FGES search on each of the demixed data sets.- Returns:
- the BIC scores of the graphs returned by searches.
- Throws:
InterruptedException- if any.
-