Package 'skewunit'

Title: Estimation and Other Tools for Skew-Unit Models
Description: Provide estimation and data generation tools for the skew-unit family discussed based on Mukhopadhyay and Brani (1995) <doi:10.2307/2348710>. The family contains extensions for popular distributions such as the ArcSin discussed in Arnold and Groeneveld (1980) <doi:10.1080/01621459.1980.10477449>, triangular, U-quadratic and Johnson-SB proposed in Cortina-Borja (2006) <doi:10.1111/j.1467-985X.2006.00446_12.x> distributions, among others.
Authors: Diego Gallardo [aut, cre], Emilio Gomez-Deniz [aut], Osvaldo Venegas [aut], Hector W. Gomez [aut]
Maintainer: Diego Gallardo <[email protected]>
License: GPL (>= 2)
Version: 1.0
Built: 2025-02-20 19:20:28 UTC
Source: CRAN

Help Index


The ArcSin distribution.

Description

Density, distribution function and random generation for the ArcSin distribution.

Usage

dasin(x, log=FALSE)
pasin(q, lower.tail=TRUE, log.p=FALSE)
rasin(n)

Arguments

x, q

vector of quantiles.

n

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

log, log.p

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

lower.tail

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

Details

The ArcSin distribution has density

f(x)=1πx(1x),x(0,1),f(x)=\frac{1}{\pi \sqrt{x(1-x)}}, \quad x \in (0,1),

and cumulative distribution function

F(x)=2πArcsin(x),x(0,1).F(x)=\frac{2}{\pi}Arcsin(\sqrt{x}), \quad x \in (0,1).

Value

dasin gives the density, pasin gives the distribution function, and rasin generates random deviates. The length of the result is determined by n for rasin, and is the maximum of the lengths of the numerical arguments for the other functions. The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

Author(s)

Diego Gallardo

References

Arnold, B.C. and Groeneveld, R.A. (1980). Some Properties of the Arcsine Distribution. Journal of the Ammerican Statistical Association, 75, 173-175.

Examples

dasin(0.5)
pasin(0.5)
rasin(5)

Choose a Distribution in a Family of Skew Distributions with Bounded Support

Description

choose.skewunit select a combination of ff and GG in a Family of Skew Distributions with Bounded Support based on the Akaike information criteria (AIC) or Bayesian information criteria (BIC).

Usage

choose.skewunit(x, criteria="AIC")

Arguments

x

data in (0,1)(0,1) interval.

criteria

criteria to choose a model: AIC (default) or BIC.

Details

The Family of Skew Distributions with Bounded Support is defined by its density function given by

f(x)=2G(λ(y0.5)+0.5),x(0,1),λ(1,1),f(x)=2 G(\lambda(y-0.5)+0.5), \quad x \in (0,1), \lambda \in (-1,1),

where ff is symmetric around 0.5, i.e., f(x0.5)=f(x+0.5)f(x-0.5)=f(x+0.5). The avaliable options for family1 and family2 are asin, Uquad, triang, JSB and sbeta.

Value

an object of class "skewunit" is returned. The object returned for this functions is a list containing the following components:

x

x

Author(s)

Diego Gallardo, Emilio Gomez-Deniz, Osvaldo Venegas and Hector W. Gomez

Examples

set.seed(2100)
x=rskewunit(100, lambda=-0.5, delta=1.2, family1="asin", family2="triang")
aux=choose.skewunit(x, criteria="AIC")
aux
aux$summary

Calculates the cubic root

Description

cuberoot(x) computes the cubic root of x, x3\sqrt[3]{x}.

Usage

cuberoot(x)

Arguments

x

a numeric or complex vector or array.

Value

the cube root of a number.

Author(s)

Diego Gallardo

Examples

cuberoot(-27)
cuberoot(0)
cuberoot(64)

Estimation for a Family of Skew Distributions with Bounded Support

Description

Perform parameter estimation for a family of skew distributions with bounded support.

Usage

estimate.skewunit(x, family1 = "asin", family2 = "asin", est.var = TRUE)

Arguments

x

data in (0,1)(0,1) interval.

family1

first family of distributions related to ff (asin by default). See details Section.

family2

first family of distributions related to GG (asin by default). See details Section.

est.var

logical; if TRUE, estimate the standard errors of the estimators.

Details

The Family of Skew Distributions with Bounded Support is defined by its density function given by

f(x)=2G(λ(y0.5)+0.5),x(0,1),λ(1,1),f(x)=2 G(\lambda(y-0.5)+0.5), \quad x \in (0,1), \lambda \in (-1,1),

where ff is symmetric around 0.5, i.e., f(x0.5)=f(x+0.5)f(x-0.5)=f(x+0.5). The avaliable options for family1 and family2 are asin, Uquad, triang, JSB and sbeta.

Value

an object of class "skewunit" is returned. The object returned for this functions is a list containing the following components:

x

x

Author(s)

Diego Gallardo, Emilio Gomez-Deniz, Osvaldo Venegas and Hector W. Gomez

Examples

set.seed(2100)
x=rskewunit(100, lambda=-0.5, delta=1.2, family1="asin", family2="JSB")
estimate.skewunit(x, family1="asin", family2="JSB")

The Johnson SBS_B distribution.

Description

Density, distribution function and random generation for the Johnson SBS_B distribution.

Usage

dJSB(x, delta=1, log=FALSE)
pJSB(q, delta=1, lower.tail=TRUE, log.p=FALSE)
rJSB(n, delta=1)

Arguments

x, q

vector of quantiles.

n

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

delta

shape parameter (by default is 1).

log, log.p

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

lower.tail

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

Details

The Johnson SBS_B distribution has density

f(x)=δx(1x)ϕ(δη(x)),x(0,1),f(x)=\frac{\delta}{x(1-x)}\phi\left(\delta \eta(x)\right), \quad x \in (0,1),

where η(x)=log(x1x)\eta(x)=\log(\frac{x}{1-x}), ϕ()\phi(\cdot) denotes the density of the standard normal distribution and δ>0\delta>0. Its cumulative distribution function is

F(x)=Φ(δη(x)),x(0,1),F(x)=\Phi\left(\delta \eta(x)\right), \quad x \in (0,1),

where Φ()\Phi(\cdot) is the cumulative distribution function of the standard normal distribution.

Value

dJSB gives the density, pJSB gives the distribution function, and rJSB generates random deviates. The length of the result is determined by n for rasin, and is the maximum of the lengths of the numerical arguments for the other functions. The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

Author(s)

Diego Gallardo

References

Kotz, S., van Dorp, J.R. (2004). Beyond Beta. Other Continuous Families of Distributions with Bounded Support and Applications. World Scientific.

Examples

dJSB(0.5, 1.2)
pJSB(0.5, 0.5)
rJSB(5, 1.5)

The symmetrical beta distribution.

Description

Density, distribution function and random generation for the symmetrical beta distribution.

Usage

dsbeta(x, delta=1, log=FALSE)
psbeta(q, delta=1, lower.tail=TRUE, log.p=FALSE)
rsbeta(n, delta=1)

Arguments

x, q

vector of quantiles.

n

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

delta

shape parameter (by default is 1).

log, log.p

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

lower.tail

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

Details

The symmetrical beta distribution has density

f(x)=1B(δ,δ)xδ1(1x)δ1,x(0,1),δ>0,f(x)=\frac{1}{B(\delta,\delta)}x^{\delta-1}(1-x)^{\delta-1}, \quad x \in (0,1), \delta>0,

where B(a,b)B(a,b) denotes the beta function. Its cumulative distribution function is

F(x)=Ix(δ,δ),x(0,1).F(x)=I_x(\delta,\delta), \quad x \in (0,1).

Value

dsbeta gives the density, psbeta gives the distribution function, and rsbeta generates random deviates. The length of the result is determined by n for rasin, and is the maximum of the lengths of the numerical arguments for the other functions. The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

Author(s)

Diego Gallardo

Examples

dsbeta(0.5, 1.2)
psbeta(0.5, 0.5)
rsbeta(5, 1.5)

A Family of Skew Distributions with Bounded Support

Description

Density and random generation for a family of skew distributions with bounded support.

Usage

dskewunit(x, lambda = 0, delta = 1, delta2 = 1, family1 = "asin", family2 = "asin", 
          log = FALSE)
rskewunit(n, lambda = 0, delta = 1, delta2 = 1, family1 = "asin", family2 = "asin")

Arguments

x

vector of quantiles.

n

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

lambda

skewness parameter such as 1λ1-1\leq \lambda \leq 1.

delta, delta2

shape parameters.

family1

first family of distributions related to ff (asin by default). See details Section.

family2

second family of distributions related to GG (asin by default). See details Section.

log

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

Details

The Family of Skew Distributions with Bounded Support is defined by its density function given by

f(x)=2G(λ(x0.5)+0.5),x(0,1),λ(1,1),f(x)=2 G(\lambda(x-0.5)+0.5), \quad x \in (0,1), \lambda \in (-1,1),

where ff is symmetric around 0.5, i.e., f(x0.5)=f(x+0.5)f(x-0.5)=f(x+0.5). The avaliable options for family1 and family2 are asin, Uquad, triang, JSB and sbeta.

Value

dskewunit gives the density, and rskewunit generates random deviates. The length of the result is determined by n for rnorm, and is the maximum of the lengths of the numerical arguments for the other functions. The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

Author(s)

Diego Gallardo, Emilio Gomez-Deniz, Osvaldo Venegas and Hector W. Gomez

Examples

dskewunit(c(0.2,0.8), lambda = 0.5, family1 = "asin", family2 = "asin")
rskewunit(100, lambda = -0.4, delta = 1, family1 = "triang", family2 = "JSB")

The triangular distribution

Description

Density, distribution function and random generation for the triangular distribution.

Usage

dtriang(x, log=FALSE)
ptriang(q, lower.tail=TRUE, log.p=FALSE)
rtriang(n)

Arguments

x, q

vector of quantiles.

n

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

log, log.p

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

lower.tail

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

Details

The triangular distribution has density

f(x)={4x,0x1/2,4(1x),1/2<x1,f(x) = \left\{ \begin{array}{lr} 4x, & 0\leq x\leq 1/2,\\ 4(1-x), & 1/2<x\leq 1, \end{array} \right.

and cumulative distribution function

F(x)={2x2,0x1/2,2x2(2x1)2,1/2<x1,F(x) = \left\{ \begin{array}{lr} 2x^2, & 0\leq x\leq 1/2,\\ 2x^2-(2x-1)^2, & 1/2<x\leq 1, \end{array} \right.

Value

dtriang gives the density, ptriang gives the distribution function, and rtriang generates random deviates. The length of the result is determined by n for rasin, and is the maximum of the lengths of the numerical arguments for the other functions. The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

Author(s)

Diego Gallardo

Examples

dtriang(0.5)
ptriang(0.5)
rtriang(5)

The U-quadratic distribution

Description

Density, distribution function and random generation for the U-quadratic distribution.

Usage

dUquad(x, a=0, b=1, log=FALSE)
pUquad(q, a=0, b=1, lower.tail=TRUE, log.p=FALSE)
rUquad(n, a=0, b=1)

Arguments

x, q

vector of quantiles.

n

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

a, b

range of variable x. (a<ba<b).

log, log.p

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

lower.tail

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

Details

The U-quadratic distribution has density

f(x)=α(xβ)2,x(a,b),axb,f(x) = \alpha (x-\beta)^2, \quad x\in (a,b), a\leq x \leq b,

where α=12/(ba)3\alpha=12/(b-a)^3 and β=(a+b)/2\beta=(a+b)/2. Its cumulative distribution function is

F(x)=α3[(xβ)3+(βa)3],x(a,b).F(x) = \frac{\alpha}{3}[(x-\beta)^3+(\beta-a)^3], \quad x\in (a,b).

Value

dUquad gives the density, pUquad gives the distribution function, and rUquad generates random deviates. The length of the result is determined by n for rasin, and is the maximum of the lengths of the numerical arguments for the other functions. The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

Author(s)

Diego Gallardo

Examples

dUquad(0.5)
pUquad(0.5)
rUquad(5)