quantile regression

383 views
Skip to first unread message

bach...@gmail.com

unread,
Mar 30, 2020, 12:51:31 AM3/30/20
to R-inla discussion group

In books and articles, there are references to INLA being able to perform quantile regression, primarily through a “laplace” family. The Yue 2009 paper describes this as an approximation to the actual distribution but one with low error.  An ordinary double exponential would be fine but Yue references the family as involving the asymmetric laplace, which would be fine also.

 

I am not seeing any likelihood with this name in the package anymore or anything in the News file regarding its removal or renaming.  Is this family or some equivalent still available as an option?  I would like to perform quantile regression to the median.

 

Thank you,

Jonathan

 

 

Helpdesk

unread,
Mar 30, 2020, 4:44:18 AM3/30/20
to r-inla-disc...@googlegroups.com, Jonathan Judge
Yes... thanks for asking.

I think my (at least) view is apparent here

https://arxiv.org/abs/1804.03714

which also explain why the 'laplace' family is no longer in the R-INLA
package, and why there are quite a few link='quantile' options now
available, like used in this one f.ex

https://arxiv.org/abs/1810.04099


H
> --
> You received this message because you are subscribed to the Google
> Groups "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to r-inla-discussion...@googlegroups.com
> .
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/5e817ad1.1c69fb81.a6196.7db4%40mx.google.com
> .
--
Håvard Rue
Helpdesk
he...@r-inla.org

FredrikLAa

unread,
Feb 3, 2021, 10:50:22 AM2/3/21
to R-inla discussion group
Dear INLA users, 

I am also trying to grasp the new quantile-functionality. 

I am reading the paper by Prof. Dr Padellini and Prof. Dr. Rue. When reading step 2 in Section 3.2 there is an expression that I do not understand the origin of. Does anybody understand why the components are as they are? I have attached the expression as a photo. And what exactly is the inverse of?

Any help would be appreciated. 

Best 

Fredrik
Mapping.jpg

Fredrik L. Aanes

unread,
Feb 6, 2021, 5:25:37 AM2/6/21
to R-inla discussion group
Are my questions not understandable or "ridiculous"? 

Or perhaps I should contact the main author?


Best regards

Fredrik

Helpdesk

unread,
Feb 6, 2021, 5:29:32 AM2/6/21
to Fredrik L. Aanes, R-inla discussion group

its the just the inverse of the quantile function. the ^\alpha is a
little confusing, and I think mean just for quantile \alpha, but is
really redundant
he...@r-inla.org

FredrikLAa

unread,
Feb 7, 2021, 7:44:13 AM2/7/21
to R-inla discussion group
Thanks for your reply. 

I must confess: It is still a little bit unclear to me....

Perhaps if we consider paper 2 with gamma quantile regression it will become more clear?

Why do you parameterize the rate parameter and not the shape parameter?

Why should it be H^{-1}/Q  and not Q/H^{-1} or H^-1(alpha,rate=1,kappa)*Q ? 

What we know: alpha =F(Q). This is the def of a quantile (if I understand it correctly). Then we solve alpha =F(Q) for Q to get Q=F^-1(alpha).

You set rate =1 and replace the rate with F^-1(alpha,rate=1,kappa)/Q. 

Why rate =1? 

Best regards

Fredrik

FredrikLAa

unread,
Feb 7, 2021, 4:47:11 PM2/7/21
to R-inla discussion group
Ok. I went through your code for the Poisson case. I think I understand it now. It seems to be the "inverse", like you said. 

We have that 

tau= integral from lambda to inf, integrad ds. where integrand = exp(-s)s^(Q+1-1)/gamma(Q+1)

Tau and Q are given, so we need to find lambda.

Best regards

Fredrik

INLA help

unread,
Feb 7, 2021, 4:52:34 PM2/7/21
to R-inla discussion group, FredrikLAa
Yes.  that would require the inverse of the incomplete gamma function 

Haavard Rue
HelpDesk 
help@r-inla. org

Tullia Padellini

unread,
Feb 8, 2021, 10:45:03 AM2/8/21
to R-inla discussion group
Hi Fredrik, 

in this new approach to quantile regression we try to associate the linear predictor to the quantile, so that we explicitely model the quantile as in standard quantile regression, and then map the quantile to the canonical parameter of the distribution, so that basically estimating the quantile results in simply estimating a transformation of the canonical parameter of the distribution. 

The mapping step is then just a reparametrization of the Poisson, in order to include the linear predictor defined on the quantile. Basically what we are trying to do there is to write the mean lambda as a function of the quantile of level alpha, which in turn can be written in terms of linar predictor. 

In the case of the Continuous Poisson, you have that the quantile of level alpha is defined as Q_alpha = IRGamma(lambda, alpha), where the IRGamma is the incomplete regularized gamma function, of parameters lambda and alpha. In practice then, if you want to write lambda as a function of Q_alpha, you simply have to invert that relationship, which is why you have the \Gamma^{-1}. The reparametrization thus consists of expressing lambda as the inverse of an incomplete regularized gamma function. 


I hope this makes it a little bit more clear. 

Best, 
Tullia

FredrikLAa

unread,
Feb 23, 2021, 6:12:28 AM2/23/21
to R-inla discussion group
Hello Tullia,

Thank your for your detailed reply

I did help

Best regards

Fredrik

Mindra Jaya

unread,
Nov 25, 2021, 6:08:05 AM11/25/21
to R-inla discussion group
Dear All

I try to find an R-INLA code for Poisson quantile regression using INLA but I cannot find it. 
I have tried to use family="poisson", and control.family=list(link="quantile", quantile=0.99) but it does not work. 
Does anyone have an example of it?

I would really appreciate it

Thank you very much

Best regards
Mindra

Tullia Padellini

unread,
Nov 25, 2021, 6:13:17 AM11/25/21
to Mindra Jaya, R-inla discussion group
Hi Mindra, 

I think it's because it should be control.family = list(control.link = "quantile", ...)

here you should find a toy example https://github.com/tulliapadellini/INLA-quantreg

Let me know if you have any other questions

Best, 
Tullia

You received this message because you are subscribed to a topic in the Google Groups "R-inla discussion group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/r-inla-discussion-group/cOWOrgdIHjI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to r-inla-discussion...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/r-inla-discussion-group/324dd096-6c9d-47dc-bbce-33d45a148eb9n%40googlegroups.com.

Ruilin Chen

unread,
Dec 15, 2021, 5:40:51 PM12/15/21
to R-inla discussion group
Hi, Tullia.

I was checking out your paper on quantile regression. I was wondering if there was already support for "negative binomial" quantile regression in INLA? 
I tried to run  
  • inla(formula, family="poisson", control.predictor = list(compute= T), control.family =list(control.link = list(model = "quantile", quantile = .25))),
  • inla(formula, family="binomial"...)
  • inla(formula, family="nbinomial"...). 
Only Poisson and Binomial worked with my test data, and Negative Binomial didn't work. R threw an error of "inla.mkl: src/inla.c:17794: inla_parse_data: Assertion `0 == 1' failed.
Aborted (core dumped)" when I tried family="nbinomial" with my test data. Is this because NGQuantile is not yet supported? Or this is caused by some other error?
Do you have any advice on how I could estimate a NGQuantile model using the existing framework, if it is not yet supported? 

Thank you! 

ruilin 
Reply all
Reply to author
Forward
0 new messages