Asymmetric Laplace distribution

467 views
Skip to first unread message

Leo Bastos

unread,
Mar 10, 2014, 3:36:30 PM3/10/14
to stan-...@googlegroups.com
Dear stan users,

I wonder if the asymmetric Laplace distribution can be implemented in stan. It is a generalization of the Laplace distribution (this one is implemented). My motivation is to use Bayesian quantile regression which is directly related with the asymmetric Laplace distribution (Yu and Moyeed, 2001). If it is possible, what should I do?

The reference that links quantile regression with the asymmetric Laplace distribution:

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

Cheers,
L

--
Leo Bastos, PhD
Researcher at Oswaldo Cruz Foundation
http://www.procc.fiocruz.br/Members/lsbastos

Daniel Lee

unread,
Mar 10, 2014, 3:51:44 PM3/10/14
to stan-...@googlegroups.com
Hi Leo,

You can always implement the distribution directly in the model. (The syntax may be a little easier once we have functions in the language, but you can do it now without much of a problem.)

So, inside your model block, you can do something like (for the normal distribution):

model {
   increment_log_prob( ... );
}

where ... is the expression for the log of the probability distribution. By coding it this way, you'll be able to allow either y, mu, sigma, or p to be declared as parameters (jointly, even) without having to figure out the gradients with respect to each of the arguments.

It looks like the gradient is going to be undefined right at y == mu, but it doesn't look like it's going to be a problem.

If you want to create a formal request to add it, feel free to use our issue tracker at:
https://github.com/stan-dev/stan

It would help if you provided the expression for the pdf there (looks like there isn't a "standard" parameterization of this thing yet). And if you had gradients on hand for each of the arguments, that would help too.


Daniel



--
You received this message because you are subscribed to the Google Groups "stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ben Goodrich

unread,
Mar 10, 2014, 6:53:55 PM3/10/14
to stan-...@googlegroups.com
On Monday, March 10, 2014 3:51:44 PM UTC-4, Daniel Lee wrote:
It would help if you provided the expression for the pdf there (looks like there isn't a "standard" parameterization of this thing yet). And if you had gradients on hand for each of the arguments, that would help too.

This paper by Yu and Zhang goes into the proposed distribution in more detail

http://scholar.google.com/scholar?cluster=6691122321015517581&hl=en&as_sdt=1,33

Ben

Leo Bastos

unread,
Mar 19, 2014, 1:29:43 PM3/19/14
to stan-...@googlegroups.com
Thanks for the replies!

I found a paper (Tsionas, 2003) that provides a very convenient way to represent an Asymmetric Laplace distribution as a mixture of a Normal and an Exponential random variables. This representation combined with conjugated priors allows simple Gibbs sampling.

It might be useful to someone, as it is for me.

Tsionas, Efthymios G. "Bayesian quantile inference." Journal of statistical computation and simulation 73.9 (2003): 659-674.

Cheers,
Leo

Alexander Franks

unread,
Oct 27, 2014, 2:09:28 PM10/27/14
to stan-...@googlegroups.com
What is the best way to implement this mixture in Stan?

If I have 10,000 observations from an asymmetric laplace distribution, do I still need to define a vector of 10,000 parameters?  Since they are just nuissance parameters, I'd like to define them as local variables, but still specify that they are exponential with lower bound 0.  Is this possible?

Bob Carpenter

unread,
Oct 27, 2014, 2:23:59 PM10/27/14
to stan-...@googlegroups.com
The latent parameters still need to be declared as parameters.
Anything that's estimated is declared as a parameter.

You can list parameters to save in the RStan interface, but there's
no way to do that yet in CmdStan. I don't know about the other
Stan interfaces.

- Bob
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
Reply all
Reply to author
Forward
0 new messages