dist_data_cdf-methods: The data cumulative distribution function

Description Usage Arguments Note Examples

Description

This is generic function for distribution objects. This function calculates the data or empirical cdf.

The functions dist_data_all_cdf and dist_all_cdf are only available for discrete distributions. Their main purpose is to optimise the bootstrap procedure, where generating a vector xmin:xmax is very quick. Also, when bootstrapping very large values can be generated.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
dist_all_cdf(m, lower_tail = TRUE, xmax = 1e+05)

dist_data_cdf(m, lower_tail = TRUE, xmax = 1e+05)

dist_data_all_cdf(m, lower_tail = TRUE, xmax = 1e+05)

## S4 method for signature 'discrete_distribution'
dist_data_cdf(m, lower_tail = TRUE, xmax = 1e+05)

## S4 method for signature 'discrete_distribution'
dist_data_all_cdf(m, lower_tail = TRUE, xmax = 1e+05)

## S4 method for signature 'ctn_distribution'
dist_data_cdf(m, lower_tail = TRUE, xmax = 1e+05)

Arguments

m

a distribution object.

lower_tail

logical; if TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x].

xmax

default 1e5. The maximum x value calculated when working out the CDF.

Note

This method does *not* alter the internal state of the distribution objects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
##########################################
#Load data and create distribution object#
##########################################
data(moby_sample)
m = displ$new(moby_sample)
m$setXmin(7);m$setPars(2)

##########################################
# The data cdf                           #
##########################################
dist_data_cdf(m)

Example output

 [1] 0.1164179 0.2298507 0.3014925 0.3671642 0.4208955 0.4656716 0.5104478
 [8] 0.5373134 0.5761194 0.6000000 0.6208955 0.6388060 0.6656716 0.6716418
[15] 0.6865672 0.6955224 0.7134328 0.7164179 0.7313433 0.7462687 0.7552239
[22] 0.7641791 0.7820896 0.7880597 0.7910448 0.7940299 0.7970149 0.8029851
[29] 0.8119403 0.8268657 0.8328358 0.8358209 0.8388060 0.8417910 0.8477612
[36] 0.8507463 0.8626866 0.8656716 0.8686567 0.8716418 0.8776119 0.8805970
[43] 0.8835821 0.8865672 0.8895522 0.8925373 0.8955224 0.8985075 0.9014925
[50] 0.9074627 0.9104478 0.9134328 0.9164179 0.9194030 0.9223881 0.9253731
[57] 0.9313433 0.9343284 0.9373134 0.9402985 0.9432836 0.9462687 0.9522388
[64] 0.9552239 0.9582090 0.9611940 0.9641791 0.9671642 0.9701493 0.9731343
[71] 0.9761194 0.9791045 0.9820896 0.9850746 0.9880597 0.9910448 0.9940299
[78] 0.9970149 1.0000000

poweRlaw documentation built on April 25, 2020, 9:06 a.m.