Learn R Programming

HuraultMisc (version 1.1.1)

extract_pdf: Extract probability density function from vector of samples

Description

Extract probability density function from vector of samples

Usage

extract_pdf(x, support = NULL, n_density = 2^7)

Arguments

x

Vector of samples from a distribution.

support

Vector of length 2 corresponding to the range of the distribution. Can be NULL.

n_density

Number of equally spaced points at which the density is to be estimated (better to use a power of 2).

Value

Dataframe with columns: Value, Density.

Examples

Run this code
# NOT RUN {
extract_pdf(rnorm(1e4))
# }

Run the code above in your browser using DataLab