Description Usage Arguments Details Value Warning Author(s) References See Also Examples
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.
1 | betagen(Nsim = 10^3)
|
Nsim |
Number of points to be represented on the subgraph, the default value being 10^3 |
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.
The function returns a graph, either on an existing graphical window or by creating a new graphical window, with two plots side-by-side.
This function is only intended to illustrate the principle at
work behind accept-reject. For Beta simulation, use rbeta
.
Christian P. Robert and George Casella
Chapter 3 of EnteR Monte Carlo Statistical Methods
rbeta
1 | betagen(Nsim=10^4)
|
Loading required package: MASS
Loading required package: coda
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.