Options (9)
Scale (2)
If f has multiple peaks, the algorithm can get stuck in the one nearest to the starting point:
Use a larger "Scale" to explore the whole landscape:
JumpDistribution (2)
Use a discrete jump distribution to approximate discrete distributions:
Multivariate example:
WorkingPrecision (1)
Use WorkingPrecision to get higher precision in parameter estimates:
ShowRejectionRate (2)
Use "ShowRejectionRate" to see the rejection rate of the process:
"ShowRejectionRate" can be used to select an optimal "Scale" for the method ("RejectionRate" is usually advised to be between 50% and 80% [see References]):
LogProbability (1)
Use "LogProbability" to generate samples from a distribution defined by the Log of its PDF:
Applications (4)
Generate sample data using BernoulliDistribution:
Define a prior distribution for the parameter (in this case, the Jeffreys prior):
Use Bayes's rule and multiply the Likelihood with the prior to get an f function, which is proportional to the posterior distribution of the parameter:
Use MetropolisHastingsSequence to generate one thousand samples of the θ parameter and create a Histogram:
Infer the parameter of a UniformDistribution (also know as the German tank problem). First, generate a small sample of data using UniformDistribution:
Define a prior distribution for the parameter (in this case, the non-normalizable Jeffreys prior):
Use Bayes's rule and multiply the Likelihood with the prior to get a function that is proportional to the posterior distribution of the parameter:
Use MetropolisHastingsSequence to generate one thousand samples of the θ parameter and generate a Histogram:
Generate sample data using NormalDistribution:
Define a prior distribution for the parameter (in this case, the scale-free non-normalizable prior):
Use Bayes's rule and multiply the Likelihood with the prior to get a function that is proportional to the posterior distribution of the parameter:
Use MetropolisHastingsSequence to generate one thousand samples of the {μ,σ} pair of parameters and generate a Histogram3D:
Generating a sample from distribution with PDF
defined on a circle:
Possible Issues (2)
The parameter thin should be an integer greater than 0:
The dimension of the parameter-dependent "JumpDistribution" must match the number of variables: