Description Usage Arguments Details Value Examples

This function implements single variable rejection samping for rvs with bounded support and which have have bounded pdf. we expect N/maxf sample

1 | ```
oneDSAMPLE(f, N, lb, ub, maxf)
``` |

`f` |
the pdf that we are sampling from |

`N` |
the number of attempted samples |

`lb` |
the lower bound of support f |

`nb` |
the upper bound of support f |

`mxaf` |
bound on f |

Here are more details about the algorithm that we are using

A vector containing samples from pdf

1 2 3 4 | ```
betaPDF <- function(x){
ifelse(0<x&x <1, 2*x, 0)}
oneDSAMPLE(f = betaPDF, N=100, lb=0, ub = 1, maxf = 2)
hist(oneDSAMPLE(f = betaPDF, N=100, lb=0, ub = 1, maxf = 2))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.