public class HSMMMultinomialEstimator extends HSMMParameterEstimator
A hidden semi-markov model estimator, configured as an Explicit-Duration Hidden Markov Model (EDHMM) with multinomial emissions.
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected double[][] |
_B
Emission distributions Bij = P(Yt=j | qt = i).
|
protected int[] |
_nCategories
Number of categories.
|
protected int[] |
clusters
Inferred cluster assignments.
|
TypedIOPort |
emissionEstimates
An output that defines a probability mass estimate of the multinomial
observation probabilities.
|
Parameter |
nCategories
Number of categories in the multinomial distribution.
|
Parameter |
observationDimension
Dimension of each observation array.
|
Parameter |
observationProbabilities
An input guess array that defines a probability mass, defining the multinomial
observation probabilities.
|
protected double[] |
prior_new
Updated state prior belief.
|
_D, _D0, _dPriors0, _durationPriors, _etaDimension, _likelihoodHistory, _maxDuration, clusterAssignments, D_new, durationEstimates, durationPriorEstimates, durationProbabilities, maxStateDuration, priorDurationDistribution
_A0, _likelihood, _likelihoodThreshold, _nIterations, _nStates, _obsDimension, _observations, _priorIn, _priors, _randomize, _transitionMatrix, A0, input, likelihood, likelihoodOut, 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, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
HSMMMultinomialEstimator(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
_checkForConvergence(int iterations)
Check whether the gradient-descent algorithm has converged.
|
protected void |
_initializeEMParameters()
Initialize parameters used in ExpectationMaximization here.
|
protected void |
_iterateEM()
One step EM iteration.
|
protected 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 double |
durationProbability(int y,
int hiddenState)
Return the duration probability of duration y at hidden state.
|
protected double |
emissionProbability(double[] y,
int hiddenState)
Computes the emission probability.
|
void |
fire()
Do nothing.
|
_EMParameterEstimation, _initializeArrays, HSMMAlphaBetaRecursion, preinitialize
HMMAlphaBetaRecursion
_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, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, initialize, removeInitializable, wrapup
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public TypedIOPort emissionEstimates
public Parameter observationProbabilities
public Parameter observationDimension
public Parameter nCategories
protected int[] clusters
protected double[][] _B
protected int[] _nCategories
protected double[] prior_new
public HSMMMultinomialEstimator(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
NamedObj
attributeChanged
in class HSMMParameterEstimator
attribute
- 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
TypedAtomicActor
clone
in class HSMMParameterEstimator
workspace
- 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 fire() throws IllegalActionException
AtomicActor
fire
in interface Executable
fire
in class HSMMParameterEstimator
IllegalActionException
- Not thrown in this base class.protected double emissionProbability(double[] y, int hiddenState)
ParameterEstimator
emissionProbability
in class HSMMParameterEstimator
y
- input observationhiddenState
- index of hidden stateprotected boolean _checkForConvergence(int iterations)
ParameterEstimator
_checkForConvergence
in class HSMMParameterEstimator
iterations
- Current iteration indexprotected void _initializeEMParameters()
ParameterEstimator
_initializeEMParameters
in class HSMMParameterEstimator
protected void _iterateEM()
ParameterEstimator
_iterateEM
in class HSMMParameterEstimator
protected void _updateEstimates()
ParameterEstimator
_updateEstimates
in class HSMMParameterEstimator
protected double durationProbability(int y, int hiddenState)
HSMMParameterEstimator
durationProbability
in class HSMMParameterEstimator
y
- The duration indexhiddenState
- The hidden state index