jointRejectionSampler: math4800 project this file implemnts a funciton to sample...

Description Usage Arguments Value Examples

Description

This function returns a data frome with n elemtns from a joint continus random variable

Usage

1
jointRejectionSampler(n, jointpdf, lower, upper, C)

Arguments

n

number of observations. n must be an integer >0

jointpdf

a function that is the join pdf of the distribution.

lower

lower and upper limits of the of the distribution. Must be finite such that P(a ≤ X ≤ b \cap a ≤ Y ≤ b) = 1.

upper

upper and upper limits of the distribution

C

a numeric such that f(x,y) ≤ C for all values of x.

Value

data.frame of random deviate pairs

Examples

1
2
jointRejectionSampler(n = 1000, jointpdf = jointnorm, lower = 0, upper = 1, C = 1)
jointRejectionSampler(n = 1000, jointpdf = jointunif, lower = 0, upper = 1, C = 1)

brucker3/math4800 documentation built on May 16, 2019, 7:14 p.m.