Type: | Package |
Title: | Estimation and Other Tools for Skew-Unit Models |
Version: | 1.0 |
Date: | 2025-02-19 |
Author: | Diego Gallardo [aut, cre], Emilio Gomez-Deniz [aut], Osvaldo Venegas [aut], Hector W. Gomez [aut] |
Maintainer: | Diego Gallardo <dgallardo@ubiobio.cl> |
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. |
Depends: | R (≥ 4.0.0), stats |
Imports: | pracma |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
NeedsCompilation: | no |
Packaged: | 2025-02-19 02:46:16 UTC; Diego |
Repository: | CRAN |
Date/Publication: | 2025-02-20 17:50:02 UTC |
The Johnson S_B
distribution.
Description
Density, distribution function and random generation for the Johnson S_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 |
Details
The Johnson S_B
distribution has density
f(x)=\frac{\delta}{x(1-x)}\phi\left(\delta \eta(x)\right), \quad x \in (0,1),
where \eta(x)=\log(\frac{x}{1-x})
, \phi(\cdot)
denotes the density of the
standard normal distribution and \delta>0
. Its cumulative distribution function is
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 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. ( |
log , log.p |
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are |
Details
The U-quadratic distribution has density
f(x) = \alpha (x-\beta)^2, \quad x\in (a,b), a\leq x \leq b,
where \alpha=12/(b-a)^3
and \beta=(a+b)/2
. Its cumulative distribution function is
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)
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 |
Details
The ArcSin distribution has density
f(x)=\frac{1}{\pi \sqrt{x(1-x)}}, \quad x \in (0,1),
and cumulative distribution function
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 f
and G
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 |
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)=2 G(\lambda(y-0.5)+0.5), \quad x \in (0,1), \lambda \in (-1,1),
where f
is symmetric around 0.5, i.e., 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, \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 |
family1 |
first family of distributions related to |
family2 |
first family of distributions related to |
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)=2 G(\lambda(y-0.5)+0.5), \quad x \in (0,1), \lambda \in (-1,1),
where f
is symmetric around 0.5, i.e., 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 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 |
Details
The symmetrical beta distribution has density
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)
denotes the beta function. Its cumulative distribution function is
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 |
delta , delta2 |
shape parameters. |
family1 |
first family of distributions related to |
family2 |
second family of distributions related to |
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)=2 G(\lambda(x-0.5)+0.5), \quad x \in (0,1), \lambda \in (-1,1),
where f
is symmetric around 0.5, i.e., 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 |
Details
The triangular distribution has density
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) = \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)