quant: Calculate empirical quantile of the first entry in a vector

Description Usage Arguments Details Value Author(s) Examples

Description

quant inputs a vector and returns the empirical quantile of the first argument in the vector with respect to all entries in the vector. Used as part of the function validate for Bayesian software validation, this function is used to calculate the empirical quantile of a "true" parameter value with respect to a collection of posterior draws of that parameter.

Usage

1
quant(draws)

Arguments

draws

Vector of parameter draws, with entry of interest, i.e., the value whose quantile is being calculated, at the beginning.

Details

Calculates the rank of the first entry of the vector with respect to all other entries, subtracts .5, and divides by the length of the vector.

Value

The empirical quantile of the first entry of the vector, a scalar between 0 and 1.

Author(s)

Samantha Cook cook@stat.columbia.edu

Examples

1
2
3
	set.seed(314)
	x<-rnorm(1000)
	quant(x)

BayesValidate documentation built on May 1, 2019, 8:07 p.m.