betagen: Plot explaining accept-reject on a Beta(2.7,6.3) target

Description Usage Arguments Details Value Warning Author(s) References See Also Examples

View source: R/betagen.R

Description

This function of Nsim represents Nsim points simulated from either a uniform or a Beta(2,6) proposal in terms of their location above versus below the density of the Beta(2.7,6.3) target in order to explain accept-reject methods.

Usage

1
betagen(Nsim = 10^3)

Arguments

Nsim

Number of points to be represented on the subgraph, the default value being 10^3

Details

The R code can be modified for further use, but note that the bounds M in the program are hardcoded towards the current values of a and b.

Value

The function returns a graph, either on an existing graphical window or by creating a new graphical window, with two plots side-by-side.

Warning

This function is only intended to illustrate the principle at work behind accept-reject. For Beta simulation, use rbeta.

Author(s)

Christian P. Robert and George Casella

References

Chapter 3 of EnteR Monte Carlo Statistical Methods

See Also

rbeta

Examples

1
betagen(Nsim=10^4)

Example output

Loading required package: MASS
Loading required package: coda

mcsm documentation built on May 2, 2019, 10:16 a.m.

Related to betagen in mcsm...