density_at: Density Probability at a Given Value

Description Usage Arguments Examples

View source: R/estimate_density.R

Description

Compute the density value at a given point of a distribution (i.e., the value of the y axis of a value x of a distribution).

Usage

1
density_at(posterior, x, precision = 2^10, method = "kernel", ...)

Arguments

posterior

Vector representing a posterior distribution.

x

The value of which to get the approximate probability.

precision

Number of points of density data. See the n parameter in density.

method

Density estimation method. Can be "kernel" (default), "logspline" or "KernSmooth".

...

Currently not used.

Examples

1
2
3
4
library(bayestestR)
posterior <- distribution_normal(n = 10)
density_at(posterior, 0)
density_at(posterior, c(0, 1))

DominiqueMakowski/bayestestR documentation built on July 27, 2021, 4:12 p.m.