Type
- public class TreeSample<Type> extends Object
Constructor and Description |
---|
TreeSample() |
Modifier and Type | Method and Description |
---|---|
void |
addSample(Tree<Type> sample)
Adds a sample with all the weights set to 0.0.
|
void |
clear()
Clears out all the values stores in this sample.
|
void |
expoNormalize(boolean deterministic)
Sets self normalized weight for each entry to the appropriate self normalized
value for each entry.
|
void |
flatten(org.apache.commons.math3.random.RandomGenerator rg,
int size,
boolean deterministic)
Resamples the trees so that they all have uniform weight.
|
double |
getLogPropWeight(int entry)
Returns the log of the proposal probability for the given entry.
|
double |
getLogSumWeight(int entry)
Returns the value of the log of the sum of the proposal probabilities for
the given entry.
|
double |
getLogTargetWeight(int entry)
Returns the log of the target weight for the given entry.
|
Tree<Type> |
getSample(int number)
Returns the sample in the given position.
|
double |
getSelfNormalizedWeight(int entry)
Returns the weight derived by the different self normalization approaches.
|
double |
makeMaxBase(boolean deterministic,
double originalBase)
Computes a 'self normalized' value for adaption.
|
int |
populationSize()
Returns the size of the underlying population.
|
void |
resample(org.apache.commons.math3.random.RandomGenerator rg,
int size)
Resamples the trees assuming that getSelfNormalized weight already returns the
correct values.
|
void |
resampleWithNormalize(org.apache.commons.math3.random.RandomGenerator rg,
int size,
boolean deterministic)
Resamples the trees.
|
void |
setLogPropWeight(int entry,
double amount)
Sets the log of the proposal probability for the given entry.
|
void |
setLogSumWeight(int entry,
double amount)
Sets the value of the log of the sum of the proposal probabilities for
the given entry.
|
void |
setLogTargetWeight(int entry,
double amount)
Sets the log of the target weight for the given entry.
|
String |
toString() |
public void addSample(Tree<Type> sample)
sample
- public void setLogSumWeight(int entry, double amount)
entry
- amount
- public void setLogPropWeight(int entry, double amount)
entry
- amount
- public void setLogTargetWeight(int entry, double amount)
entry
- amount
- public double getLogPropWeight(int entry)
entry
- public double getLogSumWeight(int entry)
entry
- public double getLogTargetWeight(int entry)
entry
- public double getSelfNormalizedWeight(int entry)
entry
- public Tree<Type> getSample(int number)
number
- public void expoNormalize(boolean deterministic)
deterministic
- public int populationSize()
public void flatten(org.apache.commons.math3.random.RandomGenerator rg, int size, boolean deterministic)
rg
- size
- deterministic
- public void resampleWithNormalize(org.apache.commons.math3.random.RandomGenerator rg, int size, boolean deterministic)
rg
- size
- deterministic
- public void resample(org.apache.commons.math3.random.RandomGenerator rg, int size)
rg
- size
- public double makeMaxBase(boolean deterministic, double originalBase)
deterministic
- originalBase
- public void clear()
Copyright © 2017. All rights reserved.