Class GammaMixtureDistribution
- java.lang.Object
-
- dev.nm.stat.hmm.mixture.distribution.GammaMixtureDistribution
-
- All Implemented Interfaces:
MixtureDistribution
public class GammaMixtureDistribution extends Object implements MixtureDistribution
The HMM states use the Gamma distribution to model the observations.- See Also:
- dev.nm.stat.distribution.univariate.GammaDistribution
- ref/hmm/hmm_M_step1
- Wikipedia: Gamma distribution distribution
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GammaMixtureDistribution.Lambda
the Gamma distribution parameters
-
Constructor Summary
Constructors Constructor Description GammaMixtureDistribution(GammaMixtureDistribution.Lambda[] lambda, boolean isShapeEstimated, boolean isScaleEstimated, double epsilon, int maxIterations)
Constructs a Gamma distribution for each state in the HMM model.GammaMixtureDistribution(GammaMixtureDistribution.Lambda[] lambda, int maxIterations)
Constructs a Gamma distribution for each state in the HMM model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GammaMixtureDistribution.Lambda[]
getMStepParams(double[] observations, Vector[] u)
Maximize, for each state, the log-likelihood of the distribution with respect to the observations and current estimators.GammaMixtureDistribution.Lambda[]
getParams()
Get the parameters, for each state, of the distribution.ProbabilityDistribution[]
newDistributions()
Get the distributions (possibly differently parameterized) for all states.MixtureDistribution
newMixtureDistribution(Object[] param)
Construct a new distribution from a set of parameters, one set per state.RandomNumberGenerator[]
newRandomNumberGenerators()
Get the random number generators corresponding to the distributions (possibly differently parameterized) for all states.
-
-
-
Constructor Detail
-
GammaMixtureDistribution
public GammaMixtureDistribution(GammaMixtureDistribution.Lambda[] lambda, boolean isShapeEstimated, boolean isScaleEstimated, double epsilon, int maxIterations)
Constructs a Gamma distribution for each state in the HMM model.- Parameters:
lambda
- the distribution parametersisShapeEstimated
- indicate whether the shape parameterk
is to be estimatedisScaleEstimated
- indicate whether the scale parametertheta
is to be estimatedepsilon
- a precision parameter: when a number |x| ≤ ε, it is considered 0maxIterations
- the maximum number of iterations in each M-step
-
GammaMixtureDistribution
public GammaMixtureDistribution(GammaMixtureDistribution.Lambda[] lambda, int maxIterations)
Constructs a Gamma distribution for each state in the HMM model.- Parameters:
lambda
- the distribution parametersmaxIterations
- the maximum number of iterations in each M-step
-
-
Method Detail
-
getParams
public GammaMixtureDistribution.Lambda[] getParams()
Description copied from interface:MixtureDistribution
Get the parameters, for each state, of the distribution.- Specified by:
getParams
in interfaceMixtureDistribution
- Returns:
- the parameters, for each state, of the distribution
-
newRandomNumberGenerators
public RandomNumberGenerator[] newRandomNumberGenerators()
Description copied from interface:MixtureDistribution
Get the random number generators corresponding to the distributions (possibly differently parameterized) for all states.- Specified by:
newRandomNumberGenerators
in interfaceMixtureDistribution
- Returns:
- the random number generators corresponding to the distributions
-
newDistributions
public ProbabilityDistribution[] newDistributions()
Description copied from interface:MixtureDistribution
Get the distributions (possibly differently parameterized) for all states.- Specified by:
newDistributions
in interfaceMixtureDistribution
- Returns:
- the distributions
-
getMStepParams
public GammaMixtureDistribution.Lambda[] getMStepParams(double[] observations, Vector[] u)
Description copied from interface:MixtureDistribution
Maximize, for each state, the log-likelihood of the distribution with respect to the observations and current estimators.- Specified by:
getMStepParams
in interfaceMixtureDistribution
- Parameters:
observations
- the observationsu
- this is in eq. (4.13) of Zucchini and MacDonald (2009), p. 65- Returns:
- the MLE estimators
-
newMixtureDistribution
public MixtureDistribution newMixtureDistribution(Object[] param)
Description copied from interface:MixtureDistribution
Construct a new distribution from a set of parameters, one set per state.- Specified by:
newMixtureDistribution
in interfaceMixtureDistribution
- Parameters:
param
- the parameters of the distribution, one set per state- Returns:
- a new HMM distribution
-
-