Learn R Programming

twopexp (version 0.1.0)

tpexp: The two-parameter exponential distribution(tpexp)

Description

Density, distribution function, quantile function, and random generation function for the two-parameter exponential distribution with theta and beta

Usage

dtpexp(x, theta = 0, beta = 1, log = FALSE)

ptpexp(q, theta = 0, beta = 1, lower.tail = TRUE, log.p = FALSE)

qtpexp(p, theta = 0, beta = 1, lower.tail = TRUE, log.p = FALSE)

rtpexp(n, theta = 0, beta = 1)

Value

dtpexp gives the density, ptpexp gives the distribution function, qtpexp gives the quantile function, and rtpexp generates random samples.

Arguments

x, q

vector of quantile.

theta

location parameter, where \(\theta > 0\).

beta

scale parameter, where \(\beta > 0\) and \(rate=1/\beta\).

log, log.p

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

lower.tail

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

p

vector of probabilities

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Examples

Run this code

x <- c(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0)
dtpexp(x,theta=0,beta=1)
dtpexp(x,theta=0,beta=1,log=TRUE)

q <- c(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0)
ptpexp(q,theta = 0, beta = 1)
ptpexp(q,theta=0, beta = 1, lower.tail = FALSE)

q <- c(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0)
p<- ptpexp(q,theta = 0, beta = 1); p
qtpexp(p,theta=0, beta = 1)

rtpexp(5, theta=0, beta=1)
rtpexp(10, theta=1, beta=1.5)

Run the code above in your browser using DataLab