Description Usage Arguments See Also Examples
View source: R/sample_diagnostics.R
plot
method for class "ru". For d = 1
a histogram of the
simulated values is plotted with a the density function superimposed.
The density is normalized crudely using the trapezium rule. For
d = 2
a scatter plot of the simulated values is produced with
density contours superimposed. For d > 2
pairwise plots of the
simulated values are produced.
1 2 3 4 5 
x 
an object of class "ru", a result of a call to 
y 
Not used. 
... 
Additional arguments passed on to 
n 
A numeric scalar. Only relevant if

prob 
Numeric vector. Only relevant for d = 2. The contour lines are drawn such that the respective probabilities that the variable lies within the contour are approximately prob. 
ru_scale 
A logical scalar. Should we plot data and density on the scale used in the ratioofuniforms algorithm (TRUE) or on the original scale (FALSE)? 
rows 
A numeric scalar. When 
xlabs, ylabs 
Numeric vectors. When 
points_par 
A list of arguments to pass to

summary.ru
for summaries of the simulated values
and properties of the ratioofuniforms algorithm.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29  # Lognormal density 
x < ru(logf = dlnorm, log = TRUE, d = 1, n = 1000, lower = 0, init = 1)
## Not run:
plot(x)
## End(Not run)
# Improve appearance using arguments to plot() and hist()
## Not run:
plot(x, breaks = seq(0, ceiling(max(x$sim_vals)), by = 0.25),
xlim = c(0, 10))
## End(Not run)
# Twodimensional normal with positive association 
rho < 0.9
covmat < matrix(c(1, rho, rho, 1), 2, 2)
log_dmvnorm < function(x, mean = rep(0, d), sigma = diag(d)) {
x < matrix(x, ncol = length(x))
d < ncol(x)
 0.5 * (x  mean) %*% solve(sigma) %*% t(x  mean)
}
x < ru(logf = log_dmvnorm, sigma = covmat, d = 2, n = 1000, init = c(0, 0))
## Not run:
plot(x)
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.