Package 'AEP'

Title: Statistical Modelling for Asymmetric Exponential Power Distribution
Description: Developed for Computing the probability density function, cumulative distribution function, random generation, estimating the parameters of asymmetric exponential power distribution, and robust regression analysis with error term that follows asymmetric exponential power distribution. The asymmetric exponential power distribution studied here is a special case of that introduced by Dongming and Zinde-Walsh (2009) <doi:10.1016/j.jeconom.2008.09.038>.
Authors: Mahdi Teimouri [aut, cre, cph, ctb]
Maintainer: Mahdi Teimouri <[email protected]>
License: GPL (>= 2)
Version: 0.1.4
Built: 2025-02-06 05:41:14 UTC
Source: https://github.com/cran/AEP

Help Index


Computing the probability density function (pdf) of asymmetric exponential power (AEP) distribution.

Description

The pdf of AEP distribution given by

fX(xΘ)=12σΓ(1+1α)exp{μxσ(1ϵ)α},   x<μ,f_{X}(x|\Theta)= \frac{1}{2\sigma \Gamma\bigl(1+\frac{1}{\alpha}\bigr)}\exp\biggl\{-\bigg|\frac{\mu-x}{\sigma(1-\epsilon)}\bigg|^{\alpha}\biggr\},~~{}~x < \mu,

fX(xΘ)=12σΓ(1+1α)exp{xμσ(1+ϵ)α},   xμ,f_{X}(x|\Theta)= \frac{1}{2\sigma \Gamma\bigl(1+\frac{1}{\alpha}\bigr)}\exp\biggl\{-\bigg|\frac{x-\mu}{\sigma(1+\epsilon)}\bigg|^{\alpha}\biggr\},~~{}~x \geq\mu,

where <x<+-\infty<x<+\infty, Θ=(α,σ,μ,ϵ)T\Theta=(\alpha,\sigma,\mu,\epsilon)^T with 0<α20<\alpha \leq 2, σ>0\sigma> 0, <μ<-\infty<\mu<\infty, 1<ϵ<1-1<\epsilon<1, and

Γ(u)=0+xu1exp{x}dx, u>0.\Gamma(u)=\int_{0}^{+\infty} x^{u-1}\exp\bigl\{-x\bigr\}dx,~u>0.

Usage

daep(x, alpha, sigma, mu, epsilon, log = FALSE)

Arguments

x

Vector of observation of requested random realizations.

alpha

Tail thickness parameter.

sigma

Scale parameter.

mu

Location parameter.

epsilon

Skewness parameter.

log

If TRUE, then log(fX(xΘ))\bigl(f_{X}(x|\Theta)\bigr) is returned.

Details

The AEP distribution is a special case of asymmetric exponential power distribution studied by Dongming and Zinde-Walsh (2009) when p1=p2=αp_1=p_2=\alpha. Also, note that if ϵ=0\epsilon=0, then the AEP distribution turns into a normal distribution with mean μ\mu and standard deviation 2σ\sqrt{2}\sigma. When α=2\alpha=2, the AEP distribution is a slight variant of epsilon-skew-normal distribution introduced by Mudholkar and Huston (2001).

Value

Computed pdf of AEP distribution at points of vector xx.

Author(s)

Mahdi Teimouri

References

Z. Dongming and V. Zinde-Walsh, 2009. Properties and estimation of asymmetric exponential power distribution, Journal of Econometrics, 148(1), 86-99.

G. S. Mudholkar and A. D. Huston, 2001. The epsilon-skew-normal distribution for analyzing near-normal data, Journal of Statistical Planning and Inference, 83, 291-309.

Examples

daep(x = 2, alpha = 1.5, sigma = 1, mu = 0, epsilon = 0.5, log = FALSE)

Estimating the parameters of AEP distribution through the expectation-maximization (EM) algorithm

Description

Estimates the parameters of AEP distribution.

Usage

fitaep(x, initial = FALSE, starts)

Arguments

x

Vector of observations.

initial

By default is FALSE. If the initial values are given by user, then set initial=TRUE.

starts

If initial values starts=(α(0),σ(0),μ(0),ϵ(0))\bigl(\alpha^{(0)}, \sigma^{(0)}, \mu^{(0)}, \epsilon^{(0)} \bigr), are given by user, i.e., initial=TURE, then vector starts must contain the initial values of the parameter vector, i.e., for starting the EM algorithm.

Value

A list of objects in two parts as

  1. The EM estimator for the parameters of AEP distribution.

  2. A sequence of goodness-of-fit measures consist of Akaike Information Criterion (AIC), Consistent Akaike Information Criterion (CAIC), Bayesian Information Criterion (BIC), Hannan-Quinn information criterion (HQIC), Anderson-Darling (AD), Cram\'eer-von Misses (CVM), Kolmogorov-Smirnov (KS), and log-likelihood (log-likelihood) statistics.

Author(s)

Mahdi Teimouri

References

A. P. Dempster, N. M. Laird, and D. B. Rubin, 1977. Maximum likelihood from incomplete data via the EM algorithm, Journal of the Royal Statistical Society Series B, 39, 1-38.

Examples

x <- raep(n=50, alpha=.8, sigma=1, mu=0, epsilon=0.5)
fitaep(x, initial = FALSE, starts)

Computing the cumulative distribution function (cdf) of asymmetric exponential power (AEP) distribution.

Description

Computes the cdf of AEP distribution given by

FX(xΘ)=1ϵ21ϵ2Γ(1+1α)γ(μxσ(1ϵ)α,1α),  x<μ,F_{X}(x|\Theta)= \frac{1-\epsilon}{2}-\frac{1-\epsilon}{2 \Gamma\bigl(1+\frac{1}{\alpha}\bigr)} \gamma\Bigl(\Big|\frac{\mu-x}{\sigma(1-\epsilon)}\Big|^{\alpha},\frac{1}{\alpha}\Bigr),~{}~x < \mu,

FX(xΘ)=1ϵ2+1+ϵ2Γ(1+1α)γ(xμσ(1+ϵ)α,1α),  xμ,F_{X}(x|\Theta)= \frac{1-\epsilon}{2}+\frac{1+\epsilon}{2 \Gamma\bigl(1+\frac{1}{\alpha}\bigr)} \gamma\Bigl(\Big|\frac{x-\mu}{\sigma(1+\epsilon)}\Big|^{\alpha},\frac{1}{\alpha}\Bigr),~{{}}~x \geq \mu,

where <x<+-\infty<x<+\infty, Θ=(α,σ,μ,ϵ)T\Theta=(\alpha,\sigma,\mu,\epsilon)^T with 0<α20<\alpha \leq 2, σ>0\sigma> 0, <μ<-\infty<\mu<\infty, and 1<ϵ<1-1<\epsilon<1.

Usage

paep(x, alpha, sigma, mu, epsilon, log.p = FALSE, lower.tail = TRUE)

Arguments

x

Vector of observations.

alpha

Tail thickness parameter.

sigma

Scale parameter.

mu

Location parameter.

epsilon

Skewness parameter.

log.p

If TRUE, then log(FX(xΘ))\bigl(F_{X}(x|\Theta)\bigr) is returned.

lower.tail

If FALSE, then 1FX(xΘ)1-F_{X}(x|\Theta) is returned.

Value

Computed cdf of AEP distribution at points of vector xx.

Author(s)

Mahdi Teimouri

Examples

paep(x = 2, alpha = 1.5, sigma = 1, mu = 0, epsilon = 0.5, log.p = FALSE, lower.tail = TRUE)

Plasma survival data

Description

The plasma survival data contains the Survival times of plasma cell myeloma for 112 patients, see Carbone et al. (1967).

Usage

data(plasma)

Format

A text file with four columns.

References

P. P. Carbone, L. E. Kellerhouse, and E. A. Gehan. 1967. Plasmacytic myeloma: A study of the relationship of survival to various clinical manifestations and anomalous protein type in 112 patients. The American Journal of Medicine, 42 (6), 937-48.


Computing the quantile function of asymmetric exponential power (AEP) distribution.

Description

Computes the quantile function of AEP distribution given by

FX1(uΘ)=μσ(1ϵ)[γ(1ϵ2u1ϵ,1α)Γ(1α)]1α,  u1ϵ2,F_{X}^{-1}(u|\Theta)= \mu-\sigma(1-\epsilon)\biggl[\frac{\gamma\bigl(\frac{1-\epsilon-2u}{1-\epsilon},\frac{1}{\alpha}\bigr)}{\Gamma\bigl(\frac{1}{\alpha}\bigr)}\biggr]^{\frac{1}{\alpha}},~{{}}~u\leq \frac{1-\epsilon}{2},

FX1(uΘ)=μ+σ(1+ϵ)[γ(2u+ϵ11+ϵ,1α)Γ(1α)]1α,  u>1ϵ2.F_{X}^{-1}(u|\Theta)= \mu+\sigma(1+\epsilon)\biggl[\frac{\gamma\bigl(\frac{2u+\epsilon-1}{1+\epsilon},\frac{1}{\alpha}\bigr)}{\Gamma\bigl(\frac{1}{\alpha}\bigr)}\biggr]^{\frac{1}{\alpha}},~{{}}~u> \frac{1-\epsilon}{2}.\\

where <x<+-\infty<x<+\infty, Θ=(α,σ,μ,ϵ)T\Theta=(\alpha,\sigma,\mu,\epsilon)^T with 0<α2,σ>00<\alpha \leq 2, \sigma> 0, <μ<-\infty<\mu<\infty, 1<ϵ<1-1<\epsilon<1, and

γ(u,ν)=0utν1exp{t}dt, ν>0.\gamma(u,\nu) =\int_{0}^{u}t^{\nu-1}\exp\bigl\{-t\bigr\}dt, ~\nu>0.

Usage

qaep(u, alpha, sigma, mu, epsilon)

Arguments

u

Numeric vector with values in (0,1)(0,1) whose quantiles are desired.

alpha

Tail thickness parameter.

sigma

Scale parameter.

mu

Location parameter.

epsilon

Skewness parameter.

Value

A vector of length n, consists of the random generated values from AEP distribution.

Author(s)

Mahdi Teimouri

Examples

qaep(runif(1), alpha = 1.5, sigma = 1, mu = 0, epsilon = 0.5)

Simulating realizations from the asymmetric exponential power (AEP) distribution

Description

Simulates realizations from AEP distribution.

Usage

raep(n, alpha, sigma, mu, epsilon)

Arguments

n

Number of requested realizations.

alpha

Tail thickness parameter.

sigma

Scale parameter.

mu

Location parameter.

epsilon

Skewness parameter.

Value

A vector of length n, consists of the random generated values from AEP distribution.

Author(s)

Mahdi Teimouri

Examples

raep(n = 100, alpha = 1.5, sigma = 1, mu = 0, epsilon = 0.5)

Robust linear regression analysis when error term follows AEP distribution

Description

Estimates parameters of the multiple linear regression model through EM algorithm when error term follows AEP distribution. The regression model is given by

yi=β0+β1xi1++βkxik+νi, i=1,,n,y_{i}=\beta_{0}+\beta_{1} x_{i1}+\cdots+ \beta_{k} x_{ik}+\nu_{i},~ i=1,\cdots,n,

where β=(β0,β1,,βk)T{\boldsymbol{\beta}}=\bigl(\beta_{0},\beta_{1},\cdots,\beta_{k}\bigr)^{T} are the regression coefficients and νi\nu_i is the error term follows a zero-location AEP distibution.

Usage

regaep(y, x)

Arguments

y

Vector of response observations of length nn.

x

An n×kn\times k array of covariate(s).

Value

A list of estimated regression coefficients, summary of residuals, F statistic, R-square (R2R^2), adjusted R-square, and inverted observed Fisher information matrix.

Author(s)

Mahdi Teimouri

References

A. P. Dempster, N. M. Laird, and D. B. Rubin, 1977. Maximum likelihood from incomplete data via the EM algorithm, Journal of the Royal Statistical Society Series B, 39, 1-38.

Examples

x <- seq(-5, 5, 0.1)
y <- 2 + 2*x + raep( length(x), alpha = 1, sigma = 0.5, mu = 0, epsilon = 0.5)
regaep(y, x)

Starting message when loading AEP

Description

It contains a welcome message for users of AEP.