Package 'CompPareto'

Title: Discrete Composite Distributions with Pareto Tails
Description: The package contains basic functions for discrete composite distributions with Pareto tails.
Authors: Bowen Liu [aut, cre], Malwane M.A. Ananda [aut]
Maintainer: Bowen Liu <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2025-01-25 04:03:24 UTC
Source: https://github.com/liuaber/comppareto

Help Index


The probability density function (pdf) of a composite distribution with Pareto tail

Description

dcomppareto returns the density of a composite distribution with a Pareto upper tail at a point x, with a specified distribution at the lower tail.

Usage

dcomppareto(x, spec, alpha = 1, theta = 1, log = FALSE, ...)

Arguments

x

A scalar or vector of positive values at which the density needs to be evaluated

spec

The selection of the lower tail (head) distribution

alpha

The shape parameter of the Pareto distribution

theta

The scale parameter of Pareto, also serve as the location parameter of the composite model

log

logical; if TRUE, probability p are given as log(p)

...

The parameter of the lower tail (head) distribution

Value

an object of the same length of x as the density evaluated at x

Examples

x<-1:100
dcomppareto(x, "lnorm", 0.4, 1, meanlog = 1, sdlog = 0.8)
dcomppareto(x, "weibull", alpha = 1.5, theta = 1.5, shape = 2, scale = 2)

The probability mass function (pmf) of a discrete composite distribution with Pareto tail

Description

dwdcomppareto returns the pmf of a discrete composite distribution with a Pareto upper tail at a point x, with a specified distribution at the lower tail.

Usage

dwdcomppareto(x, spec, alpha, theta, log = FALSE, ...)

Arguments

x

A scalar or vector of nonnegative integer values at which the probability mass needs to be evaluated

spec

The selection of the lower tail (head) distribution

alpha

The shape parameter of the Pareto distribution

theta

The scale parameter of Pareto, also serve as the location parameter of the composite model

log

logical; if TRUE, probability p are given as log(p)

...

The parameter of the lower tail (head) distribution

Value

an object of the same length of x as the probability mass evaluated at x

Examples

x<-1:100
dwdcomppareto(x, "lnorm", 0.4, 1, meanlog = 1, sdlog = 0.8)
dwdcomppareto(x, "weibull", alpha = 1.5, theta = 1.5, shape = 2, scale = 2)

The cumulative distribution function (CDF) of a composite distribution with Pareto tail

Description

pcomppareto returns the CDF of a composite distribution with a Pareto upper tail at x, with a specified distribution at the lower tail.

Usage

pcomppareto(
  x,
  spec,
  alpha = 1,
  theta = 1,
  lower.tail = TRUE,
  log.p = FALSE,
  ...
)

Arguments

x

A scalar or vector of positive values at which the CDF needs to be evaluated

spec

The selection of the lower tail (head) distribution

alpha

The shape parameter of the Pareto distribution

theta

The scale parameter of Pareto, also serve as the location parameter of the composite model

lower.tail

logical; if FALSE, the upper tail probability is provided

log.p

logical; if TRUE, probability p are given as log(p)

...

The parameter of the lower tail (head) distribution

Value

an object of the same length of x as the CDF evaluated at x

Examples

x<-1:100
pcomppareto(x, "lnorm", 0.4, 1, meanlog = 1, sdlog = 0.8)
pcomppareto(x, "weibull", alpha = 1.5, theta = 1.5, shape = 2, scale = 2)

The cumulative distribution function (CDF) of a discrete composite distribution with Pareto tail

Description

pwdcomppareto returns the CDF of a discrete composite distribution with a Pareto upper tail at x, with a specified distribution at the lower tail.

Usage

pwdcomppareto(x, spec, alpha, theta, log.p = FALSE, ...)

Arguments

x

A scalar or vector of positive values at which the CDF needs to be evaluated

spec

The selection of the lower tail (head) distribution

alpha

The shape parameter of the Pareto distribution

theta

The scale parameter of Pareto, also serve as the location parameter of the composite model

log.p

logical; if TRUE, probability p are given as log(p)

...

The parameter of the lower tail (head) distribution

Value

an object of the same length of x as the CDF evaluated at x

Examples

x<-1:100
pwdcomppareto(x, "lnorm", 0.4, 1, meanlog = 1, sdlog = 0.8)
pwdcomppareto(x, "weibull", alpha = 1.5, theta = 1.5, shape = 2, scale = 2)

The quantile function of a composite distribution with Pareto tail

Description

qcomppareto returns the quantile of a composite distribution with a Pareto upper tail given p, with a specified distribution at the lower tail.

Usage

qcomppareto(p, spec, alpha = 1, theta = 1, log.p = FALSE, ...)

Arguments

p

vector of probabilities

spec

The selection of the lower tail (head) distribution

alpha

The shape parameter of the Pareto distribution

theta

The scale parameter of Pareto, also serve as the location parameter of the composite model

log.p

logical; if TRUE, probability p are given as log(p)

...

The parameter of the lower tail (head) distribution

Value

an object of the same length of x as the CDF evaluated at x

Examples

p <-seq(0.01,0.99,b=0.01)
qcomppareto(p, "weibull", alpha = 1.5, theta = 1.5, shape = 2, scale = 2)

The quantile function of a discrete composite distribution with Pareto tail

Description

qwdcomppareto returns the quantile of a composite distribution with a Pareto upper tail given p, with a specified distribution at the lower tail.

Usage

qwdcomppareto(p, spec, alpha, theta, log = FALSE, ...)

Arguments

p

vector of probabilities

spec

The selection of the lower tail (head) distribution

alpha

The shape parameter of the Pareto distribution

theta

The scale parameter of Pareto, also serve as the location parameter of the composite model

log

logical; if TRUE, probability p are given as log(p)

...

The parameter of the lower tail (head) distribution

Value

an object of the same length of x as the CDF evaluated at x

Examples

p <-seq(0.1,0.9,b=0.1)
qcomppareto(p, "weibull", alpha = 1.5, theta = 1.5, shape = 2, scale = 2)

Generating random number from a discrete composite distribution with Pareto tail

Description

rcomppareto returns a random sample of a composite distribution with a Pareto upper tail, with a specified distribution at the lower tail.

Usage

rcomppareto(n, spec, alpha = 1, theta = 1, ...)

Arguments

n

number of observations

spec

The selection of the lower tail (head) distribution

alpha

The shape parameter of the Pareto distribution

theta

The scale parameter of Pareto, also serve as the location parameter of the composite model

...

The parameter of the lower tail (head) distribution

Value

an object of the same length of n

Examples

n<-100
rcomppareto(n,"weibull", alpha = 1.5, theta = 1.5, shape = 2, scale = 2)

Generating random number from a discrete composite distribution with Pareto tail

Description

rwdcomppareto returns a random sample of a discrete composite distribution with a Pareto upper tail, with a specified distribution at the lower tail.

Usage

rwdcomppareto(n, spec, alpha = 1, theta = 1, ...)

Arguments

n

number of observations

spec

The selection of the lower tail (head) distribution

alpha

The shape parameter of the Pareto distribution

theta

The scale parameter of Pareto, also serve as the location parameter of the composite model

...

The parameter of the lower tail (head) distribution

Value

an object of the same length of n

Examples

n<-10
rcomppareto(n,"weibull", alpha = 1.5, theta = 1.5, shape = 2, scale = 2)