public class ClusMog
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int[] |
bracket
cluster brackets on the input samples
|
static int |
max_n
maximum number of Gaussian components
|
double[] |
mean
mean parameters for the Gaussian components
|
static int |
min_sample_size_per_cluster
minimum sample size per output cluster
|
int |
n
actual number of Gaussian components
|
protected int |
ns
number of input samples
|
protected double[] |
sample
array of input samples
|
double[] |
var
variance parameters for the Gaussian components
|
double[] |
weight
weights associated with the Gaussian components
|
Constructor and Description |
---|
ClusMog()
default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
cluster(int n,
double[] center,
int ns,
double[] sample)
Compute/recover the parameters of a mixture-of-Gaussian distribution
from given independent samples.
|
(package private) void |
computeWeights()
Compute cluster weights.
|
(package private) void |
expectation()
(Re-)compute cluster centers while holding cluster brackets fixed.
|
(package private) void |
initEM()
Initialize the EM (expectation-maximization) iterations.
|
(package private) void |
maximization()
(Re-)compute cluster brackets while holding cluster centers fixed.
|
(package private) double |
measure()
Compute a measure of total quantization error.
|
(package private) void |
printMog(java.lang.String label,
int n,
double[] weight,
double[] mean,
double[] var)
Print out the clustering configuration.
|
static void |
random(int n,
double[] center,
int ns,
double[] sample,
java.util.Random rng)
Compute an initial configuration of cluster centers uniformly distributed
over the range of the input samples, for subsequent iterative refinement.
|
(package private) void |
setCenters(int n,
double[] center)
Initialize cluster centers for EM iterations.
|
(package private) void |
setSamples(int ns,
double[] sample)
Specify the input samples to work with.
|
static void |
uniform(int n,
double[] center,
int ns,
double[] sample)
Compute an initial configuration of cluster centers uniformly spaced
over the range of the input samples, for subsequent iterative refinement.
|
public static final int max_n
public int n
public final double[] weight
public final double[] mean
public final double[] var
protected int[] bracket
protected int ns
protected double[] sample
public static final int min_sample_size_per_cluster
public void cluster(int n, double[] center, int ns, double[] sample)
n
- number of clusters (Gaussian components) to outputcenter
- initial cluster centers for iterative refinementns
- number of input samplessample
- input samples; will be sorted in ascending order during usepublic static void uniform(int n, double[] center, int ns, double[] sample)
n
- number of clusters to outputcenter
- initial uniform cluster centers to computens
- number of input samplessample
- array of input samplespublic static void random(int n, double[] center, int ns, double[] sample, java.util.Random rng)
n
- number of clusters to outputcenter
- initial uniform cluster centers to computens
- number of input samplessample
- array of input samplesrng
- random number generatorvoid setCenters(int n, double[] center)
void setSamples(int ns, double[] sample)
void initEM()
void expectation()
void maximization()
double measure()
void computeWeights()
void printMog(java.lang.String label, int n, double[] weight, double[] mean, double[] var)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.