public abstract class HSMMParameterEstimator extends ParameterEstimator
This actor implements the Expectation-Maximization(EM) algorithm for parameter estimation in a family of graphical stochastic models, known as the Hidden Semi-Markov Model family.
In addition to estimating the parameters of a hidden markov model,
References
[1] Jordan, Michael I., et al. An introduction to variational methods for graphical models, Springer Netherlands, 1998.
[2] Bilmes, Jeff A. A gentle tutorial of the EM algorithm and its application to parameter estimation for Gaussian mixture and hidden Markov models. International Computer Science Institute 4.510 (1998): 126.
ParameterEstimator| Red (ilgea) |
Entity.ContainedObjectsIterator| Modifier and Type | Field and Description |
|---|---|
protected double[][] |
_D |
protected double[][] |
_D0 |
protected double[] |
_dPriors0 |
protected double[] |
_durationPriors |
protected java.util.List<java.lang.Double> |
_likelihoodHistory |
protected int |
_maxDuration |
TypedIOPort |
clusterAssignments |
protected double[][] |
D_new |
TypedIOPort |
durationEstimates |
TypedIOPort |
durationPriorEstimates |
Parameter |
durationProbabilities |
Parameter |
maxStateDuration |
TypedIOPort |
modelLikelihood |
Parameter |
priorDurationDistribution |
_A0, _likelihood, _likelihoodThreshold, _nIterations, _nStates, _observations, _priorIn, _priors, _randomize, _transitionMatrix, A0, input, likelihood, likelihoodThreshold, maxIterations, newEstimates, nStates, priorDistribution, priorEstimates, randomizeGuessVectors, transitionMatrix_typesValid_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKSCOMPLETED, NOT_READY, STOP_ITERATING| Constructor and Description |
|---|
HSMMParameterEstimator(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
_checkForConvergence(int i)
Check whether the gradient-descent algorithm has converged
|
protected boolean |
_EMParameterEstimation()
Expectation-Maximization, which internally executes a gradient-descent algorithm
for parameter estimation.
|
protected void |
_initializeArrays()
Initialize arrays to be used in parameter estimation
|
protected abstract void |
_initializeEMParameters()
Initialize parameters used in ExpectationMaximization here
|
protected abstract void |
_iterateEM()
One step EM iteration
|
protected abstract void |
_updateEstimates()
Update parameter estimates
|
void |
attributeChanged(Attribute attribute)
React to a change in an attribute.
|
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace.
|
protected abstract double |
durationProbability(int y,
int hiddenState) |
protected abstract double |
emissionProbability(double y,
int hiddenState)
Computes the emission probability.
|
void |
fire()
Do nothing.
|
protected java.util.HashMap |
HSMMAlphaBetaRecursion(double[] y,
double[][] A,
double[] prior,
int nCategories) |
void |
preinitialize()
Create receivers and declare delay dependencies.
|
HMMAlphaBetaRecursion, HMMAlphaBetaRecursionNonNormalized_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, initialize, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspaceequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortListisFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminateaddInitializable, initialize, removeInitializable, wrapupdescription, getContainer, getDisplayName, getFullName, getName, getName, setNamegetDerivedLevel, getDerivedList, propagateValuepublic Parameter priorDurationDistribution
public Parameter durationProbabilities
public TypedIOPort durationEstimates
public TypedIOPort durationPriorEstimates
public TypedIOPort clusterAssignments
public Parameter maxStateDuration
public TypedIOPort modelLikelihood
protected double[] _durationPriors
protected double[][] D_new
protected double[][] _D0
protected double[][] _D
protected double[] _dPriors0
protected int _maxDuration
protected java.util.List<java.lang.Double> _likelihoodHistory
public HSMMParameterEstimator(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container - The container.name - The name of this actorIllegalActionException - If the actor cannot be contained
by the proposed container.NameDuplicationException - If the container already has an
actor with this name.public void attributeChanged(Attribute attribute) throws IllegalActionException
NamedObjattributeChanged in class ParameterEstimatorattribute - The attribute that changed.IllegalActionException - If the change is not acceptable
to this container (not thrown in this base class).public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
TypedAtomicActorclone in class ParameterEstimatorworkspace - The workspace for the new object.java.lang.CloneNotSupportedException - If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String),
NamedObj.setDeferringChangeRequests(boolean)public void preinitialize()
throws IllegalActionException
AtomicActorpreinitialize in interface Initializablepreinitialize in class AtomicActor<TypedIOPort>IllegalActionException - Not thrown in this base class.public void fire()
throws IllegalActionException
AtomicActorfire in interface Executablefire in class ParameterEstimatorIllegalActionException - Not thrown in this base class.protected boolean _EMParameterEstimation()
ParameterEstimator_EMParameterEstimation in class ParameterEstimatorprotected abstract double emissionProbability(double y,
int hiddenState)
ParameterEstimatoremissionProbability in class ParameterEstimatory - input observationhiddenState - index of hidden stateprotected abstract double durationProbability(int y,
int hiddenState)
protected void _initializeArrays()
throws IllegalActionException
ParameterEstimator_initializeArrays in class ParameterEstimatorIllegalActionExceptionprotected abstract void _initializeEMParameters()
ParameterEstimator_initializeEMParameters in class ParameterEstimatorprotected abstract void _iterateEM()
ParameterEstimator_iterateEM in class ParameterEstimatorprotected abstract boolean _checkForConvergence(int i)
ParameterEstimator_checkForConvergence in class ParameterEstimatori - Current iteration indexprotected abstract void _updateEstimates()
ParameterEstimator_updateEstimates in class ParameterEstimatorprotected java.util.HashMap HSMMAlphaBetaRecursion(double[] y,
double[][] A,
double[] prior,
int nCategories)