public interface RuleWeighting
Modifier and Type | Method and Description |
---|---|
void |
adapt(TreeSample<Rule> treSamp,
boolean deterministic)
Adapts the proposal distribution with the assumption that
treSamp is an importance sample generated from this proposal distribution.
|
TreeAutomaton |
getAutomaton()
Returns the underlying tree automaton from which the rules and start
states are drawn.
|
double |
getLogProbability(int state,
int number)
Returns the log of the probability of choosing the rule identified by the number given the state.
|
double |
getLogProbability(Rule r)
Returns the proposal probability of the given rule given its parent.
|
double |
getLogTargetProbability(Tree<Rule> sample)
Returns the unnormalized probability of the given tree in the target
distribution.
|
int |
getNumberOfStartStates()
Returns the overall number of start states available.
|
Rule |
getRuleByNumber(int state,
int number)
Returns the rule identified by the given state and number.
|
int |
getRuleNumber(int state,
double choicePoint)
Returns the number of the first rule such that the cumulative probability of
the earlier rules plus this one is larger than choicePoint.
|
int |
getStartStateByNumber(int number)
Returns the start state with the given number.
|
int |
getStartStateNumber(double choicePoint)
Returns the start first start state such that the cumulative probability
of earlier start states plus this one is larger than choicePoint.
|
double |
getStateStartLogProbability(int number)
Returns the log of the proposal probability of the given start state.
|
void |
prepareProbability(int state)
Tells the class to recompute the proposal probabilities for the rules of the given state.
|
void |
prepareStartProbability()
Recomputes the proposal probabilities for the start states.
|
void |
reset()
Resets any adaption of the proposal distribution.
|
double getLogProbability(int state, int number)
state
- number
- void prepareProbability(int state)
state
- int getRuleNumber(int state, double choicePoint)
state
- choicePoint
- Rule getRuleByNumber(int state, int number)
state
- number
- double getStateStartLogProbability(int number)
number
- int getStartStateByNumber(int number)
number
- int getStartStateNumber(double choicePoint)
choicePoint
- void prepareStartProbability()
int getNumberOfStartStates()
void reset()
void adapt(TreeSample<Rule> treSamp, boolean deterministic)
treSamp
- deterministic
- indicates whether we can assume the underlying
automaton to be unambiguous.TreeAutomaton getAutomaton()
double getLogTargetProbability(Tree<Rule> sample)
sample
- double getLogProbability(Rule r)
r
- Copyright © 2017. All rights reserved.