prooneD: Single variable Rejection Sampling

Description Usage Arguments Value Examples

Description

This function 'prooneD(f,N,lb,up,vall,valu)' shows the probability of the given pdf (with one r.v.) the situation could be smaller than, large than or between any range

Usage

1
prooneD(f, N, lb, ub, vall = -Inf, valu = Inf)

Arguments

f

the pdf that we are sampling from

N

the nimber of attempted samples.

lb

lower bound of support of f

ub

upper bound of support of f

vall

lower value, default is -Inf

valu

upper value, default is Inf

Value

probability of given pdf (with one r.v.) and situation

Examples

1
2
3
4
5
f<- function(x) dnorm(x,-10,2)
prooneD(f,10000, Inf, Inf,vall=-10, valu=15)

f<- function(x) {ifelse(-1< x & x < 0, 2*(x+1), 0)}
prooneD(f,10000, -1, 0,valu=-0.5)

sissidong/4800-project documentation built on May 12, 2019, 8:45 a.m.