N = 101; x = seq(0.0, 1.0, len = N); alpha = 0.7
ox = expand.grid(x, x)
z = dfgm(ox[,1], ox[,2], alpha=alpha)
contour(x, x, matrix(z, N, N), col="blue")
z = pfgm(ox[,1], ox[,2], alpha=alpha)
contour(x, x, matrix(z, N, N), col="blue")
plot(r <- rfgm(n = 3000, alpha = alpha), col = "blue")
par(mfrow = c(1, 2))
hist(r[, 1]) # Should be uniform
hist(r[, 2]) # Should be uniform
Run the code above in your browser using DataLab