Error in rq.fit.br(wx, wy, tau = tau, ...) : Singular design matrix Error

Hello,

taus<-seq(from = .05, to = .95, by = 0.05)
QR.coef <- coef(rq(S~B,tau=taus))

print(QR.coef)

lprq <- function(x, y, h, m=19 , tau=.5)
{
xx <- seq(min(x),max(x),length=m)
fv <- xx
dv <- xx
for(i in 1:length(xx)) {
z <- x - xx[i]
wx <- dnorm(z/h)
r <- rq(y~z, weights=wx, tau=tau, ci=FALSE)
fv[i] <- r$coef[1.]
dv[i] <- r$coef[2.]
}
data.frame(dv = dv)
}

QQR.coef <- as.data.frame(matrix(0, ncol = 19, nrow = 19))

#Note: 0.05 in below loop is the bandwidth that can be adjusted

for (i in 1:19){
x<-lprq(B,S,0.05,tau=taus[i])
QQR.coef[,i]<-x
}

the rq in the lprq function of mine is throwing the below error. Am I doing something wrong?

Error: Error in rq.fit.br(wx, wy, tau = tau, ...) : Singular design matrix Error

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.