Description Usage Arguments Value
View source: R/MHAlogrithmUni.R
Metropolis-Hastings Algorithm to sample data from univariate distribution
1 2 3 4 5 6 7 | MHAlogrithmuni(
TargetDensity,
CGDensity = "Normal",
xinit = 0,
sigma = 1,
niter = 1000
)
|
TargetDensity |
A function: The PDF of target density function from which the users want to sample. This should be as a function of x. |
CGDensity |
Candidate Generating Density function (default is normal distribution) |
xinit |
A scalar: The starting point of the algorithm |
sigma |
A scalar: The standard deviation of the Candidate Generating Density |
niter |
A scalar: The number of data to sample |
Return the data collection sampled from the MH Algorithm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.