dens: Arbitrary Distribution

Description Usage Arguments See Also Examples

Description

Density, distribution function, quantile function, and random generation for the density() object. Each function calls the appropriate function from the output of smooth_density().

Usage

1
2
3
4
5
6
7
ddens(sdens, x)

pdens(sdens, q)

qdens(sdens, p)

rdens(sdens, n)

Arguments

sdens

List outputted by smooth_density().

x

vector of quantiles.

q

vector of quantiles.

p

vector of probabilities (should be between 0 and 1).

n

number of observations.

See Also

stats::[dpqr]*() distribution functions and logspline package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(123)
data <- rnorm(10000)
dens <- density(data)

sdens <- smooth_density(dens)

ddens(sdens, 2)
pdens(sdens, 2)
qdens(sdens, 0.977)
rdens(sdens, 10L)

brshallo/densdpqr documentation built on Dec. 19, 2021, 11:49 a.m.