Density (pdf / lpdf), distribution function (cdf / ccdf), quantile function (quant), random generation (rng), mean, standard deviation (sd), and marginal variants of the functions (mpdf, mlpf, mcdf, mccdf, mquant) for prior distributions.
# S3 method for class 'prior'
rng(x, n, ...)
# S3 method for class 'prior'
cdf(x, q, ...)
# S3 method for class 'prior'
ccdf(x, q, ...)
# S3 method for class 'prior'
lpdf(x, y, ...)
# S3 method for class 'prior'
pdf(x, y, ...)
# S3 method for class 'prior'
quant(x, p, ...)
# S3 method for class 'prior'
mcdf(x, q, ...)
# S3 method for class 'prior'
mccdf(x, q, ...)
# S3 method for class 'prior'
mlpdf(x, y, ...)
# S3 method for class 'prior'
mpdf(x, y, ...)
# S3 method for class 'prior'
mquant(x, p, ...)
pdf
(mpdf
) and lpdf
(mlpdf
) give
the (marginal) density and the log of (marginal) density,
cdf
(mcdf
) and ccdf
(mccdf
) give the
(marginal) distribution and the complement of (marginal) distribution function,
quant
(mquant
) give the (marginal) quantile function,
and rng
generates random deviates for an object of class 'prior'.
# create a standard normal prior distribution
p1 <- prior(distribution = "normal", parameters = list(mean = 1, sd = 1))
# generate a random sample from the prior
rng(p1, 10)
#> [1] 2.8692906 1.4251004 0.7613529 2.0584830 1.8864227 0.3807570
#> [7] 3.2061025 0.7449730 -0.4244947 0.8556004
# compute cumulative density function
cdf(p1, 0)
#> [1] 0.1586553
# obtain quantile
quant(p1, .5)
#> [1] 1
# compute probability density
pdf(p1, c(0, 1, 2))
#> [1] 0.2419707 0.3989423 0.2419707