4

For a given panel data quantile regression problem with fixed effects (see e.g. below), is it possible to make lqmm() output exactly (or at least closely) match the output from rqpd()?

Please see the example below and the conclusions/comments that follow. Am I right in my conclusions?

library(lqmm)
library(rqpd)

set.seed(10)
     m <- 3
     n <- 10
     s <- as.factor(rep(1:n,rep(m,n)))
     x <- exp(rnorm(n*m))
     u <- x*rnorm(m*n) + (1-x)*rf(m*n,3,3)
     a <- rep(rnorm(n),rep(m,n))
     y <- rep(1:n,rep(m,n)) + u 
 #    fit <- rqpd(y ~ x | s, panel(lambda = 5))

data1<-data.frame(y,x,s)
fit.lqmm<- lqmm(fixed=y~x ,  random=~1, group=s, iota=.5,nK=2000, type="normal", rule=1, covariance="pdIdent", data=data1)
coef(fit.lqmm)
ss1<-raneff.lqmm(fit.lqmm)

sig2<-cov.lqmm(fit.lqmm)
sig2


fit.rqpd <- rqpd(y ~ x | s, panel(lambda = 1/2*1/sig2,taus=.5, method="pfe", tauw=1))
coef(fit.rqpd)

# comparing estimated fixed effects
ss2<-coef(fit.rqpd)[3:length(coef(fit.rqpd))]
plot(as.matrix(ss1),as.numeric(ss2))

Conclusions/comments

  1. We expect that for a particular choice of lambda, rqpd() should closely match lqmm(). I guess it should be when lambda=1/(2 cov.lqmm). Correct?
    • I am saying close match and not exact because rqpd is based on L1 regularization for a fixed lambda, while I think (??) lqmm is based on L2 regularization but for a specific lambda that results from the procedure in Geraci and Bottai (2007).
  2. At the outset this does not happen at least when nK is small, i.e. say nK=7. But as nK increases to say 100 or 1000, these two procedures "seem" to get close
  3. So it appears as if the appropriate use of lqmm would at least depend on a good (perhaps large enough) choice of nK.
  4. I was exploring the use of lqmm() because here the penalty parameter is chosen systematically whereas in rqpd() it needs to be supplied. However, since I am not able to match lqmm() with rqpd for a particular choice of lambda, I am not sure I understand what lqmm is doing.
Julius Vainora
  • 47,421
  • 9
  • 90
  • 102
user2176645
  • 41
  • 1
  • 3

0 Answers0