Learn R Programming

mistr (version 0.0.6)

p.compdist: Distribution Function

Description

p is a generic function that evaluates the distribution function of a distribution object at given values.

Usage

# S3 method for compdist
p(O, q, lower.tail = TRUE, log.p = FALSE)

# S3 method for mixdist p(O, q, lower.tail = TRUE, log.p = FALSE)

p(O, q, lower.tail = TRUE, log.p = FALSE)

# S3 method for standist p(O, q, lower.tail = TRUE, log.p = FALSE)

# S3 method for trans_univdist p(O, q, lower.tail = TRUE, log.p = FALSE)

Value

Vector of computed results.

Arguments

O

distribution object.

q

vector of quantiles.

lower.tail

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

log.p

logical; if TRUE, probabilities \(p\) are given as \(log(p)\), default: FALSE.

Details

Methods of p function evaluates any offered distribution from the package mistr. The function makes use of the p[sufix] functions as pnorm or pbeta and thus, if a new distribution is added, these functions must be reachable through the search path.

Examples

Run this code
N <- normdist(1,3)
p(N, c(NA,1,3,5))

C <- cauchydist()
M <- mixdist(N, C, weights = c(0.5, 0.5))
p(M, c(NA,1,3,5))

CC <- compdist(N, C, weights = c(0.5, 0.5), breakpoints = 1)
CCC <- 2*C+5
p(CCC, c(NA,1,3,5))

Run the code above in your browser using DataLab