Learn R Programming

infutil (version 1.0)

rJeffreys: Randomly generate values distributed according to a Jeffreys prior

Description

This function generates values distributed according to a Jeffreys prior, using the probability integral transform.

Usage

rJeffreys(n, prior, range.int = c(-Inf, Inf))

Arguments

n
The number of values to be generated.
prior
A prior density in the form of a function, such as that returned by Jeffreys.
range.int
The integration range used in generating random deviates.

Value

A vector of values distributed according to the density specified by the prior function.

Details

This function generates random values distributed according to a Jeffreys prior (e.g., as used to estimate the criterion information utility) using the generalized inverse transformation of random uniform (0,1) values.

The prior must be specified as a function taking a quantile and returning a density, such as is returned by Jeffreys (note that prior could be any density function, not just a Jeffreys prior, in which case it would return random deviates distributed according to that density).

References

Robert, C. P., & Casella, G. (1999). Monte Carlo statistical methods. New York: Springer. Markon, K. E. (2013). Information utility: Quantifying the total psychometric information provided by a measure. Psychological Methods, 18, 15-35. doi: 10.1037/a0030638..

See Also

Jeffreys, which can be used to create a prior density function; also, iota.c, which uses rJeffreys to estimate the criterion information utility.

Examples

Run this code
ltm.lsat <- ltm(LSAT~z1, IRT=FALSE)
rJeffreys(100, Jeffreys(ltm.lsat))

Run the code above in your browser using DataLab