Beta.sim: Beta Simulator

Description Usage Arguments Value Author(s) Examples

Description

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.

Usage

1
Beta.sim(n=1337,a=2.5,b=5.5,initVal=0.5)

Arguments

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.

Value

Returns a vector of numbers to be Beta(a,b) distribution, using the Metropolis-Hastings sampler.

Author(s)

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

Examples

1
2
Beta.sim()
Beta.sim(n=200)

Chaiji/LemilExamST522 documentation built on May 6, 2019, 9:55 a.m.