# likALD: Log-Likelihood function for the Asymmetric Laplace... In ald: The Asymmetric Laplace Distribution

## Description

Log-Likelihood function for the Three-Parameter Asymmetric Laplace Distribution defined in Koenker and Machado (1999) useful for quantile regression with location parameter equal to mu, scale parameter sigma and skewness parameter p.

## Usage

 1 likALD(y, mu = 0, sigma = 1, p = 0.5, loglik = TRUE) 

## Arguments

 y observation vector. mu location parameter μ. sigma scale parameter σ. p skewness parameter p. loglik logical; if TRUE (default), the Log-likelihood is return, if not just the Likelihood.

## Details

If mu, sigma or p are not specified they assume the default values of 0, 1 and 0.5, respectively, belonging to the Symmetric Standard Laplace Distribution denoted by ALD(0,1,0.5).

As discussed in Koenker and Machado (1999) and Yu and Moyeed (2001) we say that a random variable Y is distributed as an ALD with location parameter μ, scale parameter σ>0 and skewness parameter p in (0,1), if its probability density function (pdf) is given by

f(y|μ,σ,p)=\frac{p(1-p)}{σ}\exp {-ρ_{p}(\frac{y-μ}{σ})}

where ρ_p(.) is the so called check (or loss) function defined by

ρ_p(u)=u(p - I_{u<0})

, with I_{.} denoting the usual indicator function. Then the Log-likelihood function is given by

∑_{i=1}^{n}log(\frac{p(1-p)}{σ}\exp {-ρ_{p}(\frac{y_i-μ}{σ})})

.

The scale parameter sigma must be positive and non zero. The skew parameter p must be between zero and one (0<p<1).

## Value

likeALD returns the Log-likelihood by default and just the Likelihood if loglik = FALSE.

## Author(s)

Christian E. Galarza <cgalarza88@gmail.com> and Victor H. Lachos <hlachos@ime.unicamp.br>

## References

Koenker, R., Machado, J. (1999). Goodness of fit and related inference processes for quantile regression. J. Amer. Statist. Assoc. 94(3):1296-1309.

Yu, K. & Moyeed, R. (2001). Bayesian quantile regression. Statistics & Probability Letters, 54(4), 437-447.

Yu, K., & Zhang, J. (2005). A three-parameter asymmetric Laplace distribution and its extension. Communications in Statistics-Theory and Methods, 34(9-10), 1867-1879.

ALD,momentsALD,mleALD

## Examples

  1 2 3 4 5 6 7 8 9 10 ## Let's compute the log-likelihood for a given sample y = rALD(n=1000) loglik = likALD(y) #Changing the true parameters the loglik must decrease loglik2 = likALD(y,mu=10,sigma=2,p=0.3) loglik;loglik2 if(loglik>loglik2){print("First parameters are Better")} 

### Example output

 -2365.35
 -5769.177
 "First parameters are Better"


ald documentation built on April 5, 2021, 1:06 a.m.