ObservationType
- Type of observationParameterType
- Type of parameters to inferpublic static class RejectionSampling.DefaultUpdater<ObservationType,ParameterType> extends AbstractCloneableSerializable implements RejectionSampling.Updater<ObservationType,ParameterType>
Modifier and Type | Field and Description |
---|---|
protected BayesianParameter<ParameterType,? extends ProbabilityFunction<ObservationType>,? extends ProbabilityFunction<ParameterType>> |
conjuctive
Defines the parameter that connects the conditional and prior
distributions.
|
protected int |
proposals
Number of proposals suggested
|
protected java.lang.Double |
scale
Scale factor to multiply the sampler function by to envelop the
conjunctive distribution.
|
Constructor and Description |
---|
DefaultUpdater()
Default constructor.
|
DefaultUpdater(BayesianParameter<ParameterType,? extends ProbabilityFunction<ObservationType>,? extends ProbabilityFunction<ParameterType>> conjuctive)
Creates a new instance of DefaultUpdater
|
DefaultUpdater(BayesianParameter<ParameterType,? extends ProbabilityFunction<ObservationType>,? extends ProbabilityFunction<ParameterType>> conjuctive,
java.lang.Double scale,
ProbabilityFunction<ParameterType> sampler)
Creates a new instance of DefaultUpdater
|
DefaultUpdater(BayesianParameter<ParameterType,? extends ProbabilityFunction<ObservationType>,? extends ProbabilityFunction<ParameterType>> conjuctive,
ProbabilityFunction<ParameterType> sampler)
Creates a new instance of DefaultUpdater
|
Modifier and Type | Method and Description |
---|---|
double |
computeAcceptanceProbability(ParameterType parameter,
java.lang.Iterable<? extends ObservationType> data)
Computes the probability of accepting the parameter for the given
data.
|
UnivariateGaussian.PDF |
computeGaussianSampler(java.lang.Iterable<? extends ObservationType> data,
java.util.Random random,
int numSamples)
Computes a Gaussian sample for the parameter, assuming it has is
a Double, using importance sampling.
|
double |
computeOptimalScale(java.lang.Iterable<? extends ObservationType> data)
Computes the optimal scale factor for enveloping the conjunctive
distribution with the sampler function given the data
|
BayesianParameter<ParameterType,? extends ProbabilityFunction<ObservationType>,? extends ProbabilityFunction<ParameterType>> |
getConjuctive()
Getter for conjunctive
|
int |
getProposals()
Getter for proposals
|
ProbabilityFunction<ParameterType> |
getSampler()
Getter for sampler
|
java.lang.Double |
getScale()
Getter for scale
|
ParameterType |
makeProposal(java.util.Random random)
Samples from the parameter prior
|
void |
setConjuctive(BayesianParameter<ParameterType,? extends ProbabilityFunction<ObservationType>,? extends ProbabilityFunction<ParameterType>> conjuctive)
Setter for conjunctive
|
protected void |
setProposals(int proposals)
Setter for proposals
|
void |
setSampler(ProbabilityFunction<ParameterType> sampler)
Setter for sampler
|
void |
setScale(java.lang.Double scale)
Setter for scale
|
clone
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone
protected BayesianParameter<ParameterType,? extends ProbabilityFunction<ObservationType>,? extends ProbabilityFunction<ParameterType>> conjuctive
protected java.lang.Double scale
protected int proposals
public DefaultUpdater()
public DefaultUpdater(BayesianParameter<ParameterType,? extends ProbabilityFunction<ObservationType>,? extends ProbabilityFunction<ParameterType>> conjuctive)
conjuctive
- Defines the parameter that connects the conditional and prior
distributions.public DefaultUpdater(BayesianParameter<ParameterType,? extends ProbabilityFunction<ObservationType>,? extends ProbabilityFunction<ParameterType>> conjuctive, ProbabilityFunction<ParameterType> sampler)
conjuctive
- Defines the parameter that connects the conditional and prior
distributions.sampler
- Distribution from which we sample and envelop the conjunctive
distribution.public DefaultUpdater(BayesianParameter<ParameterType,? extends ProbabilityFunction<ObservationType>,? extends ProbabilityFunction<ParameterType>> conjuctive, java.lang.Double scale, ProbabilityFunction<ParameterType> sampler)
conjuctive
- Defines the parameter that connects the conditional and prior
distributions.scale
- Scale factor to multiply the sampler function by to envelop the
conjunctive distribution.sampler
- Distribution from which we sample and envelop the conjunctive
distribution.public double computeAcceptanceProbability(ParameterType parameter, java.lang.Iterable<? extends ObservationType> data)
RejectionSampling.Updater
computeAcceptanceProbability
in interface RejectionSampling.Updater<ObservationType,ParameterType>
parameter
- Parameter to considerdata
- Data to consider.public ParameterType makeProposal(java.util.Random random)
RejectionSampling.Updater
makeProposal
in interface RejectionSampling.Updater<ObservationType,ParameterType>
random
- Random number generator.public BayesianParameter<ParameterType,? extends ProbabilityFunction<ObservationType>,? extends ProbabilityFunction<ParameterType>> getConjuctive()
public void setConjuctive(BayesianParameter<ParameterType,? extends ProbabilityFunction<ObservationType>,? extends ProbabilityFunction<ParameterType>> conjuctive)
conjuctive
- Defines the parameter that connects the conditional and prior
distributions.public double computeOptimalScale(java.lang.Iterable<? extends ObservationType> data)
data
- Data to considerpublic UnivariateGaussian.PDF computeGaussianSampler(java.lang.Iterable<? extends ObservationType> data, java.util.Random random, int numSamples)
data
- (Sub)set of the data to use to estimate the Gaussianrandom
- Random number generatornumSamples
- Number of samples to create the Gaussian... doesn't need to be
very large.public java.lang.Double getScale()
public void setScale(java.lang.Double scale)
scale
- Scale factor to multiply the sampler function by to envelop the
conjunctive distribution.public int getProposals()
protected void setProposals(int proposals)
proposals
- Number of proposals suggestedpublic ProbabilityFunction<ParameterType> getSampler()
public void setSampler(ProbabilityFunction<ParameterType> sampler)
sampler
- Distribution from which we sample and envelop the conjunctive
distribution.