Skip to content

Implement Asymmetric Laplace Distribution #2312

Closed

Description

@heroxbd

Summary:

We would like to have asymmetric Laplace distribution to be implemented in stan.

Description:

As discussed in the mailing list, it is particularly of interest for Bayesian quantile regression.

Also known as skewed Laplace distribution, the asymmetric Laplace distribution has an additional parameter \tau (\tau \in [0,1])

codecogseqn

which reduces to Laplace distribution when \tau=0.5.

With the Laplace distribution already in stan (named DoubleExponential), introducing asymmetric Laplace distribution is relatively straight forward.

Additional Information:

Yu, K., Moyeed, R.A., 2001. Bayesian quantile regression. Statistics & Probability Letters 54, 437–447. doi:10.1016/S0167-7152(01)00124-9

Activity

  1. bob-carpenter commented on May 22, 2017

    @bob-carpenter
    Member

    Thanks for the issue with definition. This should be relatively easy. You can, of course, just code it in Stan now as

    real skew_double_exponential_lpdf(real y, real mu, real sigma, real tau) {
      return log(tau) + log1m(tau)
        - log(sigma)
        - 2 * ((y < mu) ? (1 - tau) * (mu - y) : tau * (y - mu)) / sigma;
    }
    

    It's not vectorized and doesn't drop constants (if tau is constant you can drop the first two terms and if sigma is constant you can drop the third, but it should work.

    And fair warning: this distribution may cause problems in the region around y == mu because the derivative's not continuous there.

  2. added this to the Future milestone on May 22, 2017
  3. bgoodri commented on May 22, 2017

    @bgoodri
    Contributor
  4. dirmeier commented on Jul 6, 2020

    @dirmeier
    Member

    Hey @bob-carpenter and @bgoodri , would you mind if I had a look at this and implement it in math? Like I said in another thread, I'd like to help out more with Stan, but have trouble identifying "what needs to be done", so I guess just fixing issues would be a good start (if that is fine with you).

    Cheers,
    Simon

  5. bgoodri commented on Jul 6, 2020

    @bgoodri
    Contributor
  6. bob-carpenter commented on Jul 7, 2020

    @bob-carpenter
    Member

    By all means. It's open source and we love getting new contributors. Let us know if you need help. Our onboarding docs are still something of a mess.

    I would suggest going to the issue (in stan-dev/math, not in the monorepo project that never got finished) and commenting that you're working on an implementation. If there's not an issue, creating one is the first step.

    Basically, anything that has an issue is something we want to implement. The problem is that they're not prioritized or sorted for dependency. That's largely because what to work on is a matter of individual developer priorities and what they're interested in doing. Is there something you'd like to add to Stan, either on the issue tracker or not?

  7. dirmeier commented on Jul 8, 2020

    @dirmeier
    Member

    Hi @bob-carpenter

    I would suggest going to the issue (in stan-dev/math, not in the monorepo project that never got finished) and commenting that you're working on an implementation. If there's not an issue, creating one is the first step.

    thanks! Will do.

    Is there something you'd like to add to Stan, either on the issue tracker or not?

    No, not really. I just want to help out right now until I understand math and stan better...

  8. SteveBronder commented on Mar 24, 2026

    @SteveBronder
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions