Description Usage Arguments Details Value Notes See Also Examples
get_levels2d returns density levels enclosing specified masses.
1 | get_levels2d(img, prob = 0.95)
|
img |
(list) containing three components: |
prob |
(vector) probability masses at which to define levels. |
Function to compute the density levels at which to draw contour lines in
order to enclose a fraction prob of the mass.
Vector of the density levels (one for each element of prob).
If prob = 0.95 then a contour a level contains 95% of the mass.
The input img should be a list with three components:
img$z is a vector of nx evenly spaced x positions,
img$y is a vector of ny evenly spaced y position,
img$z is an nx*ny array of z values at the
(x, y) coordinates.
chain_convergence, contour_matrix
1 2 3 4 5 | n <- 1000
x <- rnorm(n)
y <- x + rnorm(n)
img <- hist2d(x, y, npix = 11)
get_levels2d(img, prob = c(0.5, 0.9))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.