Description Usage Arguments Value Author(s) Examples
This function takes 0 to 4 arguments to use the Metropolis-Hastings sampler to generate Beta distributions. If no arguments are used, 1337 iterations are used to generate a Beta(2.5,5.5) distribution using uniform(0,1) distribution. The function also always prints the rejection rate.
1 | Beta.sim(n=1337,a=2.5,b=5.5,initVal=0.5)
|
n |
is a natural number that chooses the number of iterations for the simulation. |
a |
is a non-negative number that chooses the first parameter of the Beta distribution. |
b |
is a non-negative number that chooses the second parameter of the Beta distribution. |
initVal |
is a single number between 0 and 1 that chooses the starting value for the simulation. |
Returns a vector of numbers to be Beta(a,b) distribution, using the Metropolis-Hastings sampler.
Nguyen Khanh Le Ho & Emil H. Andersen
Department of Mathematics and Computer Science (IMADA)
University of Southern Denmark, Denmark
emila14@student.sdu.dk
ngho14@student.sdu.dk
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.