projectq3a: projectq3a

Description Usage Arguments Value Examples

Description

This function generates pairs of random deviates from a 2D continuous distribution defined on a square with the supplied joint probability density function via rejection sampling.

Usage

1
projectq3a(n, jpdf, a, b, C, ...)

Arguments

n

number of observations. If length(n) > 1, the length is taken to be the number required.

jpdf

a function that is the joint pdf of the distribution. Should use x and y as quantile arguments.

a, b

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

C

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

...

further arguments passed to or from other methods.

Value

data.frame of random deviate pairs

Examples

1
2
3
plot(projectq3a(n = 10000, jpdf = jdunif, a = 0, b = 1, C = 1))
plot(projectq3a(n = 10000, jpdf = jdunif, a = 0, b = 2, C = 1/4, min = 0, max = 2))
plot(projectq3a(n = 10000, jpdf = jdcirclecontour, a = -1, b = 1, C = 1))

schuelkem/samplr documentation built on May 6, 2019, 7:19 a.m.