Description Usage Arguments Value Examples
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.
1 | projectq3a(n, jpdf, a, b, C, ...)
|
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. |
data.frame of random deviate pairs
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.