Package edu.cmu.tetrad.search
Class MixtureModel
java.lang.Object
edu.cmu.tetrad.search.MixtureModel
Represents a Gaussian mixture model -- a dataset with data sampled from two or more multivariate Gaussian
distributions.
- 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()
double[][]
getData()
DataSet[]
int
getDistribution
(int caseNum) Classifies a given case into a model, based on which model has the highest gamma value for that case.double[][]
getMeans()
Matrix[]
double[]
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()- Returns:
- the mixed data set in array form
-
getMeans
public double[][] getMeans()- Returns:
- the means matrix
-
getWeights
public double[] getWeights()- Returns:
- the weights array
-
getVariances
- Returns:
- the variance matrix
-
getCases
public int[] getCases()- 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. -
getDemixedData
-
searchDemixedData
public double[] searchDemixedData()Perform an FGES search on each of the demixed data sets.- Returns:
- the BIC scores of the graphs returned by searches.
-