Package 'gendist'

Title: Generated Probability Distribution Models
Description: Computes the probability density function (pdf), cumulative distribution function (cdf), quantile function (qf) and generates random values (rg) for the following general models : mixture models, composite models, folded models, skewed symmetric models and arc tan models.
Authors: Shaiful Anuar Abu Bakar
Maintainer: Shaiful Anuar Abu Bakar <[email protected]>
License: GPL (>= 2)
Version: 2.0
Built: 2024-12-16 06:37:45 UTC
Source: CRAN

Help Index


Generated Probability Distribution Models

Description

Computes the probability density function (pdf), cumulative distribution function (cdf), quantile function (qf) and generates random values (rg) for the following general models : mixture models, composite models, folded models, skewed symmetric models and arc tan models.

Details

Package: gendist
Type: Package
Version: 2.0
Date: 2019-01-30
License: GPL (>=2)

All the models use parent distribution(s) and thus flexible to incorporate many exisiting probability distributions.

Author(s)

Shaiful Anuar Abu Bakar

Maintainer: Shaiful Anuar Abu Bakar <[email protected]>

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Gomez-Deniz, E., & Calderin-Ojeda, E. Modelling insurance data with the pareto arctan distribution. ASTIN Bulletin, 1-22.
Cooray, K., & Ananda, M. M. (2005). Modeling actuarial data with a composite lognormal-Pareto model. Scandinavian Actuarial Journal, 2005(5), 321-334.
Scollnik, D. P. (2007). On composite lognormal-Pareto models. Scandinavian Actuarial Journal, 2007(1), 20-33.
Nadarajah, S., & Bakar, S. A. A. (2014). New composite models for the Danish fire insurance data. Scandinavian Actuarial Journal, 2014(2), 180-187.
Bakar, S. A., Hamzah, N. A., Maghsoudi, M., & Nadarajah, S. (2015). Modeling loss data using composite models. Insurance: Mathematics and Economics, 61, 146-154.
Brazauskas, V., & Kleefeld, A. (2011). Folded and log-folded-t distributions as models for insurance loss data. Scandinavian Actuarial Journal, 2011(1), 59-74.
Pearson, K. (1894). Contributions to the mathematical theory of evolution. Philosophical Transactions of the Royal Society of London. A, 71-110.
Azzalini, A. (1985). A class of distributions which includes the normal ones. Scandinavian journal of statistics, 171-178.


Probabilty density function of arc tan model.

Description

Computes pdf of the arc tan model.

Usage

darctan(x, alpha, spec, arg, log = FALSE)

Arguments

x

scalar or vector of values to compute the pdf.

alpha

the value of α\alpha parameter, α>0\alpha>0.

spec

a character string specifying the parent distribution (for example, "lnorm" if the parent distribution corresponds to the lognormal).

arg

list of arguments/parameters of the parent distribution.

log

logical; if TRUE, log(pdf) are returned.

Details

The pdf of arc tan model with parameter α\alpha has a general form of:

f(x)=1arctan(α)αg(x)1+(α(1G(x)))2f(x) = \frac{1}{\arctan(\alpha)} \frac{\alpha g(x)}{1 + (\alpha (1-G(x)))^{2}}

for axba\leq x\leq b where aa and bb follow the support of g(x)g(x). arctan\arctan denote the inverse function of tangent. g(x)g(x) and G(x)G(x) are the pdf and cdf of parent distribution, respectively. Note also that α>0\alpha>0.

Value

An object of the same length as x, giving the pdf values computed at x.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Gomez-Deniz, E., & Calderin-Ojeda, E. Modelling insurance data with the pareto arctan distribution. ASTIN Bulletin, 1-22.

Examples

x=runif(10, min=0, max=1)
y=darctan(x, alpha=0.5, spec="lnorm", arg=list(meanlog=1,sdlog=2) )

Probabilty density function of composite model.

Description

Computes pdf of the composite model.

Usage

dcomposite(x, spec1, arg1, spec2, arg2, initial = 1, log = FALSE)

Arguments

x

scalar or vector of values to compute the pdf.

spec1

a character string specifying the head parent distribution (for example, "lnorm" if the parent distribution corresponds to the lognormal).

arg1

list of arguments/parameters of the head parent distribution.

spec2

a character string specifying the tail parent distribution (for example, "exp" if the parent distribution corresponds to the exponential).

arg2

list of arguments/parameters of the tail parent distribution.

initial

initial values of the threshold, θ\theta.

log

logical; if TRUE, log(pdf) are returned.

Details

The pdf of composite model has a general form of:

f(x)=11+ϕf1(x), ifxθ,f(x) = \frac{1}{1+\phi} f_{1}^{*}(x), \mbox{ if} \quad x \leq \theta,

=ϕ1+ϕf2(x), ifx>θ,= \frac{\phi}{1+\phi} f_{2}^{*}(x), \mbox{ if} \quad x > \theta,

whereby ϕ\phi is the weight component, θ\theta is the threshold and fi(x)f_{i}^{*}(x) for i=1,2i=1,2 are the truncated pdfs correspond to head and tail parent distributions defined by

f1(x)=f1(x)F1(θ)f_{1}^{*}(x) = \frac{f_{1}(x)}{F_{1}(\theta)}

and

f2(x)=f2(x)1F2(θ)f_{2}^{*}(x) = \frac{f_{2}(x)}{1-F_{2}(\theta)}

respectively.

Value

An object of the same length as x, giving the pdf values computed at x.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Cooray, K., & Ananda, M. M. (2005). Modeling actuarial data with a composite lognormal-Pareto model. Scandinavian Actuarial Journal, 2005(5), 321-334.
Scollnik, D. P. (2007). On composite lognormal-Pareto models. Scandinavian Actuarial Journal, 2007(1), 20-33.
Nadarajah, S., & Bakar, S. A. A. (2014). New composite models for the Danish fire insurance data. Scandinavian Actuarial Journal, 2014(2), 180-187.
Bakar, S. A., Hamzah, N. A., Maghsoudi, M., & Nadarajah, S. (2015). Modeling loss data using composite models. Insurance: Mathematics and Economics, 61, 146-154.

Examples

x=runif(10, min=0, max=1)
y=dcomposite(x, spec1="lnorm", arg1=list(meanlog=0.1,sdlog=0.2), spec2="exp", 
             arg2=list(rate=0.5) )

Probabilty density function of folded model.

Description

Computes pdf of the folded model.

Usage

dfolded(x, spec, arg, log = FALSE)

Arguments

x

scale or vector of values to compute the pdf.

spec

a character string specifying the parent distribution (for example, "norm" if the parent disstribution correspond to the normal).

arg

list of arguments/parameters of the parent distribution.

log

logical; if TRUE, log(pdf) are returned.

Details

The pdf of folded model has a general form of:

f(x)=g(x)+g(x)x>0f(x) = g(x) + g(-x) \quad x>0

where G(x)G(x) is the cdf of parent distribution.

Value

An object of the same length as x, giving the pdf values computed at x.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Brazauskas, V., & Kleefeld, A. (2011). Folded and log-folded-t distributions as models for insurance loss data. Scandinavian Actuarial Journal, 2011(1), 59-74.

Examples

x=runif(10, min=0, max=1)
y=dfolded(x, spec="norm", arg=list(mean=1,sd=2) )

Probabilty density function of mixture model.

Description

Computes pdf of the mixture model.

Usage

dmixt(x, phi, spec1, arg1, spec2, arg2, log = FALSE)

Arguments

x

scalar or vector of values to compute the pdf.

phi

the value of ϕ\phi parameter, ϕ>0\phi>0.

spec1

a character string specifying the first parent distribution (for example, "lnorm" if the parent distribution corresponds to the lognormal).

arg1

list of arguments/parameters of the first parent distribution.

spec2

a character string specifying the second parent distribution (for example, "exp" if the parent distribution corresponds to the exponential).

arg2

list of arguments/parameters of the second parent distribution.

log

logical; if TRUE, log(pdf) are returned.

Details

The pdf of mixture model with parameter phiphi has a general form of:

f(x)=11+ϕ(g1(x)+ϕg2(x))f(x) = \frac{1}{1+\phi} \left( g_{1}(x) + \phi g_{2}(x)\right)

where xx follows the support of parent distributions, ϕ\phi is the weight component and gi(x)g_{i}(x) for i=1,2i=1,2 are the pdfs of first and second parent distributions, respectively.

Value

An object of the same length as x, giving the pdf values computed at x.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Pearson, K. (1894). Contributions to the mathematical theory of evolution. Philosophical Transactions of the Royal Society of London. A, 71-110.

Examples

x=runif(10, min=0, max=1)
y=dmixt(x, phi=0.5, spec1="lnorm", arg1=list(meanlog=1,sdlog=2), spec2="exp", 
        arg2=list(rate=2) )

Probabilty density function of skewed symmetric model.

Description

Computes pdf of the skewed symmetric model.

Usage

dskew(x, spec1, arg1, spec2, arg2, log = FALSE)

Arguments

x

scalar or vector of values to compute the pdf.

spec1

a character string specifying the parent distribution g(x)g(x) (for example, "norm" if the parent distribution corresponds to the normal).

arg1

list of arguments/parameters of the parent distribution g(x)g(x).

spec2

a character string specifying the parent distribution H(x)H(x) (for example, "logis" if the parent distribution corresponds to the logistic).

arg2

list of arguments/parameters of the parent distribution H(x)H(x).

log

logical; if TRUE, log(pdf) are returned.

Details

The pdf of skewed symmetric model has a general form of:

f(x)=2h(x)G(x),<x<f(x) = 2h(x)G(x), \quad -\infty < x < \infty

where h(x)h(x) and G(x)G(x) are the pdf and cdf of parent distributions, respectively.

Value

An object of the same length as x, giving the pdf values computed at x.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Azzalini, A. (1985). A class of distributions which includes the normal ones. Scandinavian journal of statistics, 171-178.

Examples

x=runif(10, min=0, max=1)
y=dskew(x, spec1="norm", arg1=list(mean=0,sd=1), spec2="logis", 
        arg2=list(location=0,scale=2) )

Cumulative distribution function of arc tan model.

Description

Computes cdf of the arc tan model.

Usage

parctan(q, alpha, spec, arg, lower.tail = TRUE, log.p = FALSE)

Arguments

q

scalar or vector of values to compute the cdf.

alpha

the value of α\alpha parameter, α>0\alpha>0.

spec

a character string specifying the parent distribution (for example, "lnorm" if the parent distribution corresponds to the lognormal).

arg

list of arguments/parameters of the parent distribution.

lower.tail

logical; if TRUE, cdf are returned, otherwise 1-cdf.

log.p

logical; if TRUE, probabilities returned are given as log(cdf).

Details

The cdf of arc tan model with parameter α\alpha has a general form of:

F(q)=1arctan(α(1G(q)))arctan(α)F(q) = 1- \frac{\arctan(\alpha (1-G(q)) )}{\arctan(\alpha)}

for axba\leq x\leq b where aa and bb follow the support of g(q)g(q). arctan\arctan denote the inverse function of tangent. g(q)g(q) and G(q)G(q) are the pdf and cdf of parent distribution, respectively. Note also that α>0\alpha>0.

Value

An object of the same length as q, giving the cdf values computed at q.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Gomez-Deniz, E., & Calderin-Ojeda, E. Modelling insurance data with the pareto arctan distribution. ASTIN Bulletin, 1-22.

Examples

x=runif(10, min=0, max=1)
y=parctan(x, alpha=0.5, spec="lnorm", arg=list(meanlog=1,sdlog=2) )

Cumulative distribution function of composite model.

Description

Computes cdf of the composite model.

Usage

pcomposite(q, spec1, arg1, spec2, arg2, initial = 1, lower.tail = TRUE, log.p = FALSE)

Arguments

q

scalar or vector of values to compute the cdf.

spec1

a character string specifying the head parent distribution (for example, "lnorm" if the parent distribution corresponds to the lognormal).

arg1

list of arguments/parameters of the head parent distribution.

spec2

a character string specifying the tail parent distribution (for example, "exp" if the parent distribution corresponds to the exponential).

arg2

list of arguments/parameters of the tail parent distribution.

initial

initial values of the threshold, θ\theta.

lower.tail

logical; if TRUE, cdf are returned, otherwise 1-cdf.

log.p

logical; if TRUE, probabilities returned are given as log(cdf).

Details

The cdf of composite model has a general form of:

F(x)=11+ϕF1(x)F1(θ) if xθ,F(x) = \frac{1}{1+\phi} \frac{F_{1}(x)}{F_{1}(\theta)} \mbox{ if } \quad x \leq \theta,

=11+ϕ(1+ϕF2(x)F2(θ)1F2(θ)) if x>θ,= \frac{1}{1+\phi} \left( 1 + \phi \frac{F_{2}(x)-F_{2}(\theta)}{1-F_{2}(\theta)} \right) \mbox{ if } \quad x > \theta,

whereby ϕ\phi is the weight component, θ\theta is the threshold and Fi(x)F_{i}(x) for i=1,2i=1,2 are the cdfs correspond to head and tail parent distributions, respectively.

Value

An object of the same length as q, giving the cdf values computed at q.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Cooray, K., & Ananda, M. M. (2005). Modeling actuarial data with a composite lognormal-Pareto model. Scandinavian Actuarial Journal, 2005(5), 321-334.
Scollnik, D. P. (2007). On composite lognormal-Pareto models. Scandinavian Actuarial Journal, 2007(1), 20-33.
Nadarajah, S., & Bakar, S. A. A. (2014). New composite models for the Danish fire insurance data. Scandinavian Actuarial Journal, 2014(2), 180-187.
Bakar, S. A., Hamzah, N. A., Maghsoudi, M., & Nadarajah, S. (2015). Modeling loss data using composite models. Insurance: Mathematics and Economics, 61, 146-154.

Examples

x=runif(10, min=0, max=1)
y=pcomposite(x, spec1="lnorm", arg1=list(meanlog=0.1,sdlog=0.2), spec2="exp", 
             arg2=list(rate=0.5) )

Cumulative distribution function of folded model.

Description

Computes cdf of the folded model.

Usage

pfolded(q, spec, arg, lower.tail = TRUE, log.p = FALSE)

Arguments

q

scale or vector of values to compute the cdf.

spec

a character string specifying the parent distribution (for example, "norm" if the parent distribution correspond to the normal).

arg

list of arguments/parameters of the parent distribution.

lower.tail

logical; if TRUE, cdf are returned, otherwise 1-cdf.

log.p

logical; if TRUE, probabilities returned are given as log(cdf).

Details

The cdf of folded model has a general form of:

F(x)=G(x)G(x)x>0F(x) = G(x) - G(-x) \quad x>0

where G(x)G(x) is the cdf of parent distribution.

Value

An object of the same length as q, giving the cdf values computed at q.

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Brazauskas, V., & Kleefeld, A. (2011). Folded and log-folded-t distributions as models for insurance loss data. Scandinavian Actuarial Journal, 2011(1), 59-74.

Examples

x=runif(10, min=0, max=1)
y=pfolded(x, spec="norm", arg=list(mean=1,sd=2) )

Cumulative distribution function of mixture model.

Description

Computes cdf of the mixture model.

Usage

pmixt(q, phi, spec1, arg1, spec2, arg2, lower.tail = TRUE, log.p = FALSE)

Arguments

q

scalar or vector of values to compute the cdf.

phi

the value of ϕ\phi parameter, ϕ>0\phi>0.

spec1

a character string specifying the first parent distribution (for example, "lnorm" if the parent distribution corresponds to the lognormal).

arg1

list of arguments/parameters of the first parent distribution.

spec2

a character string specifying the second parent distribution (for example, "exp" if the parent distribution corresponds to the exponential).

arg2

list of arguments/parameters of the second parent distribution.

lower.tail

logical; if TRUE, cdf are returned, otherwise 1-cdf.

log.p

logical; if TRUE, probabilities returned are given as log(cdf).

Details

The cdf of mixture model has a general form of:

F(x)=frac11+ϕ(G1(x)+ϕG2(x))F(x) = \\frac{1}{1+\phi} \left(G_{1}(x) + \phi G_{2}(x) \right)

where xx follows the support of parent distributions, ϕ\phi is the weight component and Gi(x)G_{i}(x) for i=1,2i=1,2 are the cdfs of first and second parent distributions, respectively.

Value

An object of the same length as q, giving the cdf values computed at q.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Pearson, K. (1894). Contributions to the mathematical theory of evolution. Philosophical Transactions of the Royal Society of London. A, 71-110.

Examples

x=runif(10, min=0, max=1)
y=pmixt(x, phi=0.5, spec1="lnorm", arg1=list(meanlog=1,sdlog=2), spec2="exp", 
        arg2=list(rate=2) )

Cumulative distribution function of skewed symmetric model.

Description

Computes cdf of the skewed symmetric model.

Usage

pskew(q, spec1, arg1, spec2, arg2, lower.tail = TRUE, log.p = FALSE)

Arguments

q

scale or vector of values to compute the cdf.

spec1

a character string specifying the parent distribution g(x)g(x) (for example, "norm" if the parent distribution corresponds to the normal).

arg1

list of arguments/parameters of the parent distribution g(x)g(x).

spec2

a character string specifying the parent distribution H(x)H(x) (for example, "logis" if the parent distribution corresponds to the logistic).

arg2

list of arguments/parameters of the parent distribution H(x)H(x).

lower.tail

logical; if TRUE, cdf are returned, otherwise 1-cdf.

log.p

logical; if TRUE, probabilities returned are given as log(cdf).

Details

The cdf of skewed symmetric model has a general form of:

F(x)=x2h(y)G(y)dy,<x<F(x) = \int_{-\infty}^{x} 2 h(y) G(y) dy, \quad -\infty < x < \infty

where h(x)h(x) and G(x)G(x) are the pdf and cdf of parent distributions, respectively.

Value

An object of the same length as q, giving the cdf values computed at q.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Azzalini, A. (1985). A class of distributions which includes the normal ones. Scandinavian journal of statistics, 171-178.

Examples

x=runif(10, min=0, max=1)
y=pskew(x, spec1="norm", arg1=list(mean=0,sd=1), spec2="logis", 
        arg2=list(location=0,scale=2) )

Quantile function of arc tan model.

Description

Computes qf of the arc tan model.

Usage

qarctan(p, alpha, spec, arg, lower.tail = TRUE, log.p = FALSE)

Arguments

p

scalar or vector of probabilities to compute the qf.

alpha

the value of α\alpha parameter, α>0\alpha>0.

spec

a character string specifying the parent distribution (for example, "lnorm" if the parent distribution corresponds to the lognormal).

arg

list of arguments/parameters of the parent distribution.

lower.tail

logical; if TRUE, probabilities are p, otherwise 1-p.

log.p

logical; if TRUE, probabilities p are returned as log(p).

Details

The qf of arc tan model with parameter α\alpha has a general form of:

Q(p)=G1(11αtan((1p)arctan(α)))Q(p) = G^{-1}\left(1-\frac{1}{\alpha} \tan( (1-p)\arctan(\alpha) )\right)

for axba\leq x\leq b where aa and bb follow the support of G(x)G(x). arctan\arctan denote the inverse function of tangent and G1G^{-1} is the inverse cdf of parent distribution, respectively. Note also that α>0\alpha>0.

Value

An object of the same length as p, giving the qf values computed at p.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Gomez-Deniz, E., & Calderin-Ojeda, E. Modelling insurance data with the pareto arctan distribution. ASTIN Bulletin, 1-22.

Examples

x=runif(10, min=0, max=1)
y=qarctan(x, alpha=0.5, spec="lnorm", arg=list(meanlog=1,sdlog=2) )

Quantile function of composite model.

Description

Computes qf of the composite model.

Usage

qcomposite(p, spec1, arg1, spec2, arg2, initial = 1, lower.tail = TRUE, log.p = FALSE)

Arguments

p

scalar or vector of probabilities to compute the qf.

spec1

a character string specifying the head parent distribution (for example, "lnorm" if the parent distribution corresponds to the lognormal).

arg1

list of arguments/parameters of the head parent distribution.

spec2

a character string specifying the tail parent distribution (for example, "exp" if the parent distribution corresponds to the exponential).

arg2

list of arguments/parameters of the tail parent distribution.

initial

initial values of the threshold, θ\theta.

lower.tail

logical; if TRUE, probabilities are p, otherwise 1-p.

log.p

logical; if TRUE, probabilities p are returned as log(p).

Details

The qf of composite model has a general form of:

Q(p)=Q1(p(1+ϕ)F1(θ)) if p11+ϕ,Q(p) = Q_{1}(p(1+\phi)F_{1}(\theta)) \mbox{ if } \quad p \leq \frac{1}{1+\phi},

=Q2(F2(θ)+(1F2(θ))(p(1+ϕ)1ϕ)) if p>11+ϕ= Q_{2} \left( F_{2}(\theta) + (1-F_{2}(\theta)) \left( \frac{p(1+\phi)-1}{\phi} \right)\right) \mbox{ if } \quad p > \frac{1}{1+\phi}

whereby ϕ\phi is the weight component, θ\theta is the threshold and Fi(x)F_{i}(x) for i=1,2i=1,2 are the qfs correspond to head and tail parent distributions, respectively.

Value

An object of the same length as p, giving the qf values computed at p.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Cooray, K., & Ananda, M. M. (2005). Modeling actuarial data with a composite lognormal-Pareto model. Scandinavian Actuarial Journal, 2005(5), 321-334.
Scollnik, D. P. (2007). On composite lognormal-Pareto models. Scandinavian Actuarial Journal, 2007(1), 20-33.
Nadarajah, S., & Bakar, S. A. A. (2014). New composite models for the Danish fire insurance data. Scandinavian Actuarial Journal, 2014(2), 180-187.
Bakar, S. A., Hamzah, N. A., Maghsoudi, M., & Nadarajah, S. (2015). Modeling loss data using composite models. Insurance: Mathematics and Economics, 61, 146-154.

Examples

x=runif(10, min=0, max=1)
y=qcomposite(x, spec1="lnorm", arg1=list(meanlog=0.1,sdlog=0.2), spec2="exp", 
             arg2=list(rate=0.5) )

Quantile function of folded model.

Description

Computes cdf of the folded model.

Usage

qfolded(p, spec, arg, interval = c(0, 100), lower.tail = TRUE, log.p = FALSE)

Arguments

p

scalar or vector of probabilities to compute the qf.

spec

a character string specifying the parent distribution (for example, "norm" if the parent distribution correspond to the normal).

arg

list of arguments/parameters of the parent distribution.

interval

a vector of interval end-points for p to search for the function root.

lower.tail

logical; if TRUE, probabilities are p, otherwise 1-p.

log.p

logical; if TRUE, probabilities p are returned as log(p).

Value

An object of the same length as p, giving the qf values computed at p.

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Brazauskas, V., & Kleefeld, A. (2011). Folded and log-folded-t distributions as models for insurance loss data. Scandinavian Actuarial Journal, 2011(1), 59-74.

Examples

x=runif(10, min=0, max=1)
y=qfolded(x, spec="norm", arg=list(mean=1,sd=2), interval=c(0,100) )

Quantile function of mixture model.

Description

Computes qf of the mixture model.

Usage

qmixt(p, phi, spec1, arg1, spec2, arg2, interval = c(0, 100),
      lower.tail = TRUE, log.p = FALSE)

Arguments

p

scalar or vector of probabilities to compute the qf.

phi

the value of ϕ\phi parameter, ϕ>0\phi>0.

spec1

a character string specifying the first parent distribution (for example, "lnorm" if the parent distribution corresponds to the lognormal).

arg1

list of arguments/parameters of the first parent distribution.

spec2

a character string specifying the second parent distribution (for example, "exp" if the parent distribution corresponds to the exponential).

arg2

list of arguments/parameters of the second parent distribution.

interval

a vector of interval end-points for p to search for the function root.

lower.tail

logical; if TRUE, probabilities are p, otherwise 1-p.

log.p

logical; if TRUE, probabilities p are returned as log(p).

Value

An object of the same length as p, giving the qf values computed at p.

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Pearson, K. (1894). Contributions to the mathematical theory of evolution. Philosophical Transactions of the Royal Society of London. A, 71-110.

Examples

x=runif(10, min=0, max=1)
y=qmixt(x, phi=0.5, spec1="lnorm", arg1=list(meanlog=0.1,sdlog=0.2), spec2="exp", 
        arg2=list(rate=0.5))

Quantile function of skewed symmetric model.

Description

Computes qf of the skewed symmetric model.

Usage

qskew(p, spec1, arg1, spec2, arg2, interval = c(1, 10), lower.tail = TRUE, log.p = FALSE)

Arguments

p

scalar or vector of probabilities to compute the qf.

spec1

a character string specifying the parent distribution g(x)g(x) (for example, "norm" if the parent distribution corresponds to the normal).

arg1

list of arguments/parameters of the parent distribution g(x)g(x).

spec2

a character string specifying the parent distribution H(x)H(x) (for example, "logis" if the parent distribution corresponds to the logistic).

arg2

list of arguments/parameters of the parent distribution H(x)H(x).

interval

a vector of interval end-points for p to search for the function root.

lower.tail

logical; if TRUE, probabilities are p, otherwise 1-p.

log.p

logical; if TRUE, probabilities p are returned as log(p).

Value

An object of the same length as p, giving the qf values computed at p.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Azzalini, A. (1985). A class of distributions which includes the normal ones. Scandinavian journal of statistics, 171-178.

Examples

x=runif(10, min=0, max=1)
y=qskew(x, spec1="norm", arg1=list(mean=0,sd=0.1), spec2="logis", 
        arg2=list(location=0,scale=0.2))

Random generation of arc tan model.

Description

Computes rg of the arc tan model.

Usage

rarctan(n, alpha, spec, arg)

Arguments

n

number of random generated values.

alpha

the value of α\alpha parameter, α>0\alpha>0.

spec

a character string specifying the parent distribution (for example, "lnorm" if the parent distribution corresponds to the lognormal).

arg

list of arguments/parameters of the parent distribution.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Gomez-Deniz, E., & Calderin-Ojeda, E. Modelling insurance data with the pareto arctan distribution. ASTIN Bulletin, 1-22.

Examples

y=rarctan(10, alpha=0.5, spec="lnorm", arg=c(meanlog=1,sdlog=2) )

Random generation of composite model.

Description

Computes rg of the composite model.

Usage

rcomposite(n, spec1, arg1, spec2, arg2, initial = 1)

Arguments

n

number of random generated values.

spec1

a character string specifying the head parent distribution (for example, "lnorm" if the parent distribution corresponds to the lognormal).

arg1

list of arguments/parameters of the head parent distribution.

spec2

a character string specifying the tail parent distribution (for example, "exp" if the parent distribution corresponds to the exponential).

arg2

list of arguments/parameters of the tail parent distribution.

initial

initial values of the threshold, θ\theta.

Value

An object of the length n, giving the random generated values for the composite model.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Cooray, K., & Ananda, M. M. (2005). Modeling actuarial data with a composite lognormal-Pareto model. Scandinavian Actuarial Journal, 2005(5), 321-334.
Scollnik, D. P. (2007). On composite lognormal-Pareto models. Scandinavian Actuarial Journal, 2007(1), 20-33.
Nadarajah, S., & Bakar, S. A. A. (2014). New composite models for the Danish fire insurance data. Scandinavian Actuarial Journal, 2014(2), 180-187.
Bakar, S. A., Hamzah, N. A., Maghsoudi, M., & Nadarajah, S. (2015). Modeling loss data using composite models. Insurance: Mathematics and Economics, 61, 146-154.

Examples

y=rcomposite(10, spec1="lnorm", arg1=list(meanlog=0.1,sdlog=0.2), spec2="exp", 
             arg2=list(rate=0.5))

Random generation of folded model.

Description

Computes rg of the folded model.

Usage

rfolded(n, spec, arg, interval = c(0, 100))

Arguments

n

number of random generated values.

spec

a character string specifying the parent distribution (for example, "norm" if the parent distribution correspond to the normal).

arg

list of arguments/parameters of the parent distribution.

interval

a vector of interval end-points to search function root.

Value

An object of the length n, giving the random generated values for the folded model.

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Brazauskas, V., & Kleefeld, A. (2011). Folded and log-folded-t distributions as models for insurance loss data. Scandinavian Actuarial Journal, 2011(1), 59-74.

Examples

y=rfolded(10, spec="norm", arg=list(mean=1,sd=2), interval=c(0,100) )

Random generation of mixture model.

Description

Computes rg of the mixture model.

Usage

rmixt(n, phi, spec1, arg1, spec2, arg2, interval = c(0, 100))

Arguments

n

number of random generated values.

phi

the value of ϕ\phi parameter, ϕ>0\phi>0.

spec1

a character string specifying the first parent distribution (for example, "lnorm" if the parent distribution corresponds to the lognormal).

arg1

list of arguments/parameters of the first parent distribution.

spec2

a character string specifying the second parent distribution (for example, "exp" if the parent distribution corresponds to the exponential).

arg2

list of arguments/parameters of the second parent distribution.

interval

a vector of interval end-points to search function root.

Value

An object of the length n, giving the random generated values for the mixture model.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Pearson, K. (1894). Contributions to the mathematical theory of evolution. Philosophical Transactions of the Royal Society of London. A, 71-110.

Examples

y=rmixt(10, phi=0.5, spec1="lnorm", arg1=list(meanlog=0.1,sdlog=0.2), spec2="exp", 
        arg2=list(rate=0.5) )

Random generation of skewed symmetric model.

Description

Computes rg of the skewed symmetric model.

Usage

rskew(n, spec1, arg1, spec2, arg2, interval = c(1, 10))

Arguments

n

number of random generated values.

spec1

a character string specifying the parent distribution g(x)g(x) (for example, "norm" if the parent distribution corresponds to the normal).

arg1

list of arguments/parameters of the parent distribution g(x)g(x).

spec2

a character string specifying the parent distribution H(x)H(x) (for example, "logis" if the parent distribution corresponds to the logistic).

arg2

list of arguments/parameters of the parent distribution H(x)H(x).

interval

a vector of interval end-points to search function root.

Value

An object of the length n, giving the random generated values for the skewed symmetric model.

Author(s)

Shaiful Anuar Abu Bakar

References

Abu Bakar, S. A., Nadarajah, S., Adzhar, Z. A. A. K., & Mohamed, I. (2016). gendist: An R package for generated probability distribution models. PloS one, 11(6).
Azzalini, A. (1985). A class of distributions which includes the normal ones. Scandinavian journal of statistics, 171-178.

Examples

y=rskew(10, spec1="norm", arg1=list(mean=0,sd=0.1), spec2="logis", 
        arg2=list(location=0,scale=0.2))