Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

EmpiricalDistribution

Generating function "EmpiricalDistribution"


Description

Generates an object of class "DiscreteDistribution"

Usage

EmpiricalDistribution(data, .withArith=FALSE, .withSim=FALSE, 
                        .lowerExact = TRUE, .logExact = FALSE,
                        .DistrCollapse = getdistrOption("DistrCollapse"),
                        .DistrCollapse.Unique.Warn = 
                             getdistrOption("DistrCollapse.Unique.Warn"),
                        .DistrResolution = getdistrOption("DistrResolution"),
                        Symmetry = NoSymmetry())

Arguments

data

numeric vector with data.

.withArith

normally not set by the user, but if determining the entries supp, prob distributional arithmetics was involved, you may set this to TRUE.

.withSim

normally not set by the user, but if determining the entries supp, prob simulations were involved, you may set this to TRUE.

.lowerExact

normally not set by the user: whether the lower.tail=FALSE part is calculated exactly, avoing a “1-.”.

.logExact

normally not set by the user: whether in determining slots d,p,q, we make particular use of a logarithmic representation to enhance accuracy.

.DistrCollapse

controls whether in generating a new discrete distribution, support points closer together than .DistrResolution are collapsed.

.DistrCollapse.Unique.Warn

controls whether there is a warning whenever collapsing occurs or when two points are collapsed by a call to unique() (default behaviour if .DistrCollapse is FALSE)

.DistrResolution

minimal spacing between two mass points in a discrete distribution

Symmetry

you may help R in calculations if you tell it whether the distribution is non-symmetric (default) or symmetric with respect to a center; in this case use Symmetry=SphericalSymmetry(center).

Details

The function is a simple utility function providing a wrapper to the generating function DiscreteDistribution.

Typical usage is

EmpiricalDistribution(data)

Value

Object of class "DiscreteDistribution"

Author(s)

See Also

Examples

x <- rnorm(20)
D1 <- EmpiricalDistribution(data = x)
D1

plot(D1)

distr

Object Oriented Implementation of Distributions

v2.8.0
LGPL-3
Authors
Florian Camphausen [ctb] (contributed as student in the initial phase --2005), Matthias Kohl [aut, cph], Peter Ruckdeschel [cre, cph], Thomas Stabla [ctb] (contributed as student in the initial phase --2005), R Core Team [ctb, cph] (for source file ks.c/ routines 'pKS2' and 'pKolmogorov2x')
Initial release
2019-03-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.