public static class SiteLikelihood.NodeLikelihood
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
SiteLikelihood.NodeLikelihood(java.util.Map<java.lang.String,java.lang.Integer> states)
Constructor where all sates are allowed at a node
|
SiteLikelihood.NodeLikelihood(java.util.Map<java.lang.String,java.lang.Integer> states,
java.util.Set<java.lang.String> allowedStates)
Constructor where only some states are allowed at a node
|
SiteLikelihood.NodeLikelihood(java.util.Map<java.lang.String,java.lang.Integer> states,
java.lang.String allowedState)
Constructor where only a single state is allowed at a node
|
Modifier and Type | Method and Description |
---|---|
SiteLikelihood.NodeLikelihood |
clone() |
Real |
getLikelihood(int i)
Returns the partial likelihood for the state at position i.
|
Real |
getLikelihood(java.lang.String state)
Returns the partial likelihood for a given state
|
Real[] |
getLikelihoods()
Returns the partial likelihood for each state as an array.
|
void |
multiply(java.lang.String state,
double by)
This is a fudge to stop to allow this code to be reused in some
of the ancestor classes.
|
void |
multiply(java.lang.String state,
Real by)
This is a fudge to stop to allow this code to be reused in some
of the ancestor classes.
|
java.lang.String |
toString() |
public SiteLikelihood.NodeLikelihood(java.util.Map<java.lang.String,java.lang.Integer> states) throws SiteLikelihood.LikelihoodException
states
- Map from a state to it's position in the arraySiteLikelihood.LikelihoodException
- Thrown if a node is initalised to every state having zero probability
(most probably due to the state at the node not being in the model).public SiteLikelihood.NodeLikelihood(java.util.Map<java.lang.String,java.lang.Integer> states, java.util.Set<java.lang.String> allowedStates) throws SiteLikelihood.LikelihoodException
states
- Map from a state to it's position in the arrayallowedStates
- The allowed states at this stateSiteLikelihood.LikelihoodException
- Thrown if a node is initalised to every state having zero probability
(most probably due to the state at the node not being in the model).public SiteLikelihood.NodeLikelihood(java.util.Map<java.lang.String,java.lang.Integer> states, java.lang.String allowedState) throws SiteLikelihood.LikelihoodException
states
- Map from a state to it's position in the arrayallowedState
- The allowed state at this stateSiteLikelihood.LikelihoodException
- Thrown if a node is initalised to every state having zero probability
(most probably due to the state at the node not being in the model).public SiteLikelihood.NodeLikelihood clone()
clone
in class java.lang.Object
public void multiply(java.lang.String state, Real by)
state
- The state probility to multiplyby
- How much to mutliply the probabilty bypublic void multiply(java.lang.String state, double by)
state
- The state probility to multiplyby
- How much to mutliply the probabilty bypublic Real getLikelihood(java.lang.String state) throws SiteLikelihood.LikelihoodException
state
- The state to return the partial likelihood forSiteLikelihood.LikelihoodException
- Thrown if no likelihood
has been calculated for the given statepublic Real getLikelihood(int i)
i
- The positionpublic Real[] getLikelihoods()
public java.lang.String toString()
toString
in class java.lang.Object