Learn R Programming

poweRlaw (version 0.60.3)

dist_cdf: The cumulative distribution function (cdf)

Description

This is a generic function for calculating the cumulative distribution function (cdf) of distribution objects. This is similar to base R's pnorm for the normal distribution. The dist_cdf function calculates the cumulative probability distribution for the current parameters and xmin value.

Usage

dist_cdf(m, q = NULL, lower_tail = FALSE)
"dist_cdf"(m, q = NULL, lower_tail = TRUE)
"dist_all_cdf"(m, lower_tail = TRUE, xmax = 1e+05)
"dist_cdf"(m, q = NULL, lower_tail = TRUE)
"dist_all_cdf"(m, lower_tail = TRUE, xmax = 1e+05)
"dist_cdf"(m, q = NULL, lower_tail = TRUE)
"dist_all_cdf"(m, lower_tail = TRUE, xmax = 1e+05)
"dist_cdf"(m, q = NULL, lower_tail = TRUE)
"dist_all_cdf"(m, lower_tail = TRUE, xmax = 1e+05)
"dist_cdf"(m, q = NULL, lower_tail = TRUE)
"dist_all_cdf"(m, lower_tail = TRUE, xmax = 1e+05)
"dist_cdf"(m, q = NULL, lower_tail = TRUE)
"dist_all_cdf"(m, lower_tail = TRUE, xmax = 1e+05)
"dist_cdf"(m, q = NULL, lower_tail = TRUE)
"dist_all_cdf"(m, lower_tail = TRUE, xmax = 1e+05)
"dist_cdf"(m, q = NULL, lower_tail = TRUE)
"dist_all_cdf"(m, lower_tail = TRUE, xmax = 1e+05)

Arguments

m
a distribution object.
q
a vector values where the function will be evaluated. If q is NULL (default), then the data values will be used.
lower_tail
logical; if TRUE (default), probabilities are $P[X \le x]$, otherwise, $P[X > x]$.
xmax
default 1e5. The maximum x value calculated when working out the CDF.

Examples

Run this code
##########################################
#Load data and create distribution object#
##########################################
data(moby_sample)
m = displ$new(moby_sample)
m$setXmin(7); m$setPars(2)

##########################################
#Calculate the CDF at a particular values#
##########################################
dist_cdf(m, 10:15)

########################################## 
#Calculate the CDF at the data values    #
##########################################
dist_cdf(m)

Run the code above in your browser using DataLab