Skip to content
Prev 321762 / 398500 Next

Singular design matrix in rq

Have you looked at the result of
  bs(raw_data[,i], df=15)
?  If there are not many unique values in the input there
will be a lot of NaN's in the output (because there are
repeated knots) and those NaN's will cause rq() to give
that message.

E.g.,
Error in rq.fit.br(x, y, tau = tau, ...) : Singular design matrix
1 2 3 4 5 6 7 8 9 10 11  12  13  14  15
  [1,] 0 0 1 0 0 0 0 0 0  0  0   0   0   0   0
  [2,] 0 0 1 0 0 0 0 0 0  0  0   0   0   0   0
  [3,] 0 0 1 0 0 0 0 0 0  0  0   0   0   0   0
  ...
[98,] 0 0 0 0 0 0 0 0 0  0  0 NaN NaN NaN NaN
 [99,] 0 0 0 0 0 0 0 0 0  0  0 NaN NaN NaN NaN
[100,] 0 0 0 0 0 0 0 0 0  0  0 NaN NaN NaN NaN
attr(,"degree")
[1] 3
attr(,"knots")
7.692308% 15.38462% 23.07692% 30.76923% 38.46154% 
        1         1         1         2         2 
46.15385% 53.84615% 61.53846% 69.23077% 76.92308% 
        2         3         3         3         4 
84.61538% 92.30769% 
        4         4 
attr(,"Boundary.knots")
[1] 1 4
attr(,"intercept")
[1] FALSE
attr(,"class")
[1] "bs"     "basis"  "matrix"

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com