Learn R Programming

algebraic.dist (version 0.9.1)

empirical_dist: Construct empirical distribution object.

Description

Construct empirical distribution object.

Usage

empirical_dist(data)

Value

An empirical_dist object.

Arguments

data

data to construct empirical distribution from. if matrix or data frame, each row is a joint observation, if a vector, each element is an observation. whatever data is, it must be convertible to a tibble.

Examples

Run this code
# Univariate empirical distribution from a vector
ed <- empirical_dist(c(1, 2, 3, 4, 5))
mean(ed)

# Multivariate empirical distribution from a matrix
mat <- matrix(c(1, 2, 3, 4, 5, 6), ncol = 2)
ed_mv <- empirical_dist(mat)
dim(ed_mv)

Run the code above in your browser using DataLab