get_levels1d: Find lower, upper intervals enclosing certain masses of a...

Description Usage Arguments Details Value See Also Examples

View source: R/plot_contour.R

Description

get_levels1d returns values bounding specified masses.

Usage

1
get_levels1d(x, prob = 0.95)

Arguments

x

(vector) x data values.

prob

(vector) probability masses at which to define levels.

Details

Function to compute the lower and upper limits of intevals containing a fraction (prob) of the mass of the points x. If x are input data points, we compute the lower and upper quantiles. For for prob = 0.95 we find the 0.025 and 0.975 quantiles, between which are 95% of the data points.

Value

Vector of the x values (two for each element of prob). If prob = 0.95 then the lower, upper values enclose 95% of the mass of x.

See Also

chain_convergence, contour_matrix

Examples

1
2
3
n <- 1000
x <- rnorm(n)
get_levels1d(x, prob = c(0.5, 0.9))

svdataman/tonic documentation built on Aug. 2, 2019, 3:21 p.m.