0

I'm facing a problem that

rq(y ~ x, tau = 0.50, method = "br")

doesn't complete calculation. There is no error and warning. I traced code and found .Fortran() in rq.fit.br() does not finish calculation. I'm not familiar with Fortran so let me ask this question here. I would like to know boundary condition that causes this infinite loop. I can avoid this endless calculation if I know it.

Thank you for your help in advance.

# The problematic input data :
y <- c(
  0, 0, 0, 0, 0, 0, 0.234, 0.117, 0.351, 0, 0, 0, 0, 0, 0, 0, 0.117, 0, 0, 0,
  0.117, 0, 0, 0, 0, 0.117, 0.117, 0, 0.117, 0.117, 0, 0, 0.117, 0, 0, 0, 0,
  0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.234, 0, 0.117, 0.117, 0,
  0.351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0.234, 0, 0, 0, 0.117, 0.117, 0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.117, 0, 0,
  0, 0, 0, 0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0.117, 0, 0, 0, 0, 0.117, 0.117, 0, 0, 0, 0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0.117, 0, 0, 0, 0.234, 0, 0.234, 0, 0, 0, 0, 0, 0, 0.117, 0, 0, 0, 0, 0.234,
  0, 0, 0, 0, 0, 0, 0, 0, 0.117, 0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.585, 0, 0, 0.117, 0.234,
  0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0.234, 0.117, 0, 0, 0.117, 0.234, 0, 0.117, 0,
  0, 0, 0.234, 0, 0.117, 0, 0.117, 0.117, 0, 0, 0, 0, 0.234, 0, 0, 0.234, 0.234,
  0.234, 0.234, 0.117, 0, 0, 0, 0, 0, 0, 0.117, 0.117, 0, 0, 0, 0, 0, 0, 0, 0,
  0.117, 0, 0, 0, 0, 0, 0, 0.117, 0, 0, 0, 0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0.117,
  0.117, 0, 0.117, 0, 0.117, 0, 0, 0.117, 0, 0.117, 0, 0, 0.234, 0, 0, 0, 0, 0,
  0, 0, 0.234, 0, 0, 0, 0, 0, 0.117, 0, 0, 0, 0.117, 0, 0, 0, 0, 0, 0.234, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.117, 0, 0, 0, 0.234, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0.117, 0, 0, 0, 0, 0.117, 0, 0.117, 0, 0, 0, 0.117,
  0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.117, 0.117, 0, 0, 0.234, 0.351, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.117, 0, 0, 0, 0, 0, 0, 0,
  0.117, 0, 0, 0, 0.117, 0.117, 0, 0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.117, 0, 0, 0, 0, 0,
  0.117, 0, 0, 0.117, 0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.117,
  0.234, 0, 0, 0, 0, 0, 0.117, 0.117, 0, 0, 0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0.117, 0, 0, 0, 0, 0, 0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.117,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.117, 0, 0, 0, 0, 0, 0, 0,
  0, 0.117, 0, 0.703, 0.117, 0.117, 0.234, 0, 0.117, 0, 0.117, 0.117, 0, 0, 0,
  0.117, 0, 0, 0, 0.234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.234, 0, 0.117, 0, 0, 0,
  0.117, 0, 0, 0, 0, 0, 0.117, 0.234, 0.234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.117,
  0, 0, 0, 0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.117, 0, 0, 0, 0,
  0, 0, 0, 0.117, 0.234, 0, 0, 0.117, 0, 0, 0, 0, 0, 0, 0, 0.234, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0.234, 0, 0, 0, 0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.234, 0, 0,
  0, 0, 0.117, 0, 0, 0, 0, 0, 0, 0, 0.351, 0, 0, 0, 0, 0, 0, 0, 0.117, 0.117, 0,
  0.234, 0.117, 0, 0, 0.117, 0.234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0.117, 0.351, 0, 0.468, 0.234, 0.234, 0, 0, 0, 0, 0.234, 0, 0.117, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.117, 0, 0,
  0.117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.234, 0, 0,
  0, 0, 0, 0, 0, 0.117, 0, 0, 0.585, 0, 0, 0.234, 0, 0.117, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0.468, 0, 0, 0, 0, 0.117, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0.234, 0, 0, 0, 0, 0, 0, 0.234, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0.351, 0.234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.117,
  0.117, 0, 0, 0, 0
)

x <- c(
  24.4018079, 28.8807817, 40.4440632, 22.6231939, 21.5390181, 27.6194884,
  32.9537276, 23.0931019, 24.6333219, 32.2419818, 23.401991, 32.4394215,
  18.980218, 36.1419718, 52.0712614, 24.5704906, 60.3779992, 31.7383285,
  33.7286139, 17.3276892, 30.7991282, 50.9481105, 31.080127, 53.3908315,
  17.6551953, 27.7416689, 27.2468471, 27.1576005, 23.1742951, 41.4709552,
  41.967935, 27.8544524, 19.8297627, 27.620431, 15.2351169, 18.3377948,
  25.0163879, 25.2405723, 33.3461355, 48.2266249, 24.3607428, 27.7216683,
  26.6296912, 28.4811453, 30.1760888, 26.8148476, 25.128683, 23.8027916,
  30.7355199, 30.5610606, 41.6265463, 26.175877, 27.9212294, 37.9277741,
  25.1736093, 24.4808208, 28.8720055, 23.4672164, 20.0011668, 24.0894199,
  28.4711092, 21.9160106, 26.516336, 16.7173241, 24.9135346, 26.2081573,
  21.091112, 32.6515246, 30.2453634, 24.3514448, 27.8053967, 27.0362428,
  25.8530264, 40.8166319, 21.7807126, 30.2581439, 35.0799978, 38.2687556,
  46.9241502, 35.4400451, 25.0417079, 20.9683041, 18.9136417, 26.9527511,
  32.5955477, 24.1518614, 33.2041696, 29.5174409, 31.9583297, 38.5216324,
  46.6958841, 31.8675876, 29.4891597, 32.2909144, 27.8331436, 27.3906857,
  36.2563286, 17.9700065, 26.2149315, 29.4081605, 40.4465888, 24.6274318,
  32.0388361, 22.6569988, 21.6720743, 16.7256267, 16.852218, 13.8423948,
  25.4936663, 26.6811577, 26.812348, 29.8681522, 27.7055245, 15.006916,
  27.7348524, 26.4439379, 30.0100718, 37.0017757, 14.5881997, 31.0969282,
  18.1142671, 14.4049902, 37.6274298, 44.3967524, 27.5595956, 19.4116367,
  20.0019715, 16.9236606, 26.246288, 35.607556, 30.3840455, 30.3815949,
  24.5976682, 37.809445, 21.577438, 21.8125242, 14.5899396, 23.6670936,
  25.268452, 31.6692812, 22.690343, 24.3731279, 33.3598046, 29.6117162,
  39.1297631, 15.2346245, 26.0681545, 25.4259568, 42.6836935, 23.7939986,
  41.4657106, 25.8638121, 41.9544915, 26.7980014, 19.7041992, 19.8906546,
  33.3622323, 28.7616006, 36.8331863, 38.3432724, 13.2298725, 18.7853833,
  25.4594015, 30.0428453, 24.0999749, 28.5411825, 23.7460138, 15.7947625,
  36.502406, 46.1166203, 26.2032695, 19.0759098, 25.7247696, 27.8923323,
  35.3435019, 28.7847773, 28.7935475, 18.5619149, 39.1965545, 28.0817298,
  26.4450131, 28.0224018, 30.3223318, 35.6540999, 28.2432116, 25.3455388,
  25.9718787, 32.34494, 44.2724262, 31.45872, 29.6019651, 20.3401629,
  18.4580252, 37.232467, 34.3359164, 44.1724399, 23.4782245, 27.4645108,
  27.1781198, 18.6422675, 19.2272688, 30.8315997, 25.5801722, 22.4312101,
  15.3473977, 27.472274, 24.4604204, 22.5680019, 14.6711321, 17.4751012,
  59.8056645, 24.4605417, 22.4188914, 24.111513, 18.9521777, 29.562426,
  21.1020296, 31.1739265, 24.7056341, 22.9724849, 22.0160131, 30.531877,
  18.4457535, 28.0308361, 27.8577984, 23.3738145, 33.924868, 23.397325,
  29.6069946, 18.181721, 31.6132161, 25.0790305, 28.2104791, 22.931505,
  29.4002554, 18.5959381, 25.0670957, 18.7296132, 24.770169, 24.9230376,
  29.4113636, 20.8127034, 24.3650603, 16.2016467, 24.9011517, 28.7432186,
  31.7488893, 15.4118624, 32.5145935, 15.0132364, 22.2026089, 28.3184513,
  30.7058983, 30.7271516, 42.0031247, 44.6998899, 36.0661786, 21.6462755,
  32.1853902, 43.8380628, 27.4295037, 33.3694872, 24.8508583, 26.4525086,
  27.7657697, 28.7656539, 27.8993627, 24.1259411, 31.7960144, 20.1717771,
  24.6846924, 31.3695283, 16.9871094, 27.3006097, 24.353586, 24.2973128,
  22.2143346, 32.5385164, 46.238405, 15.87873, 24.8137702, 31.6289988,
  16.7381839, 28.4660331, 38.6910685, 34.4105544, 26.0612181, 21.1271684,
  26.6423251, 24.5583478, 23.493619, 26.539979, 28.6731828, 28.239095,
  18.9509248, 24.0585342, 27.0629323, 25.4465092, 26.7561273, 32.5888733,
  34.5808151, 29.2271733, 39.7868991, 25.690253, 39.4753614, 15.3304099,
  43.0529772, 26.977613, 12.5825155, 19.4012753, 21.718714, 26.4869929,
  26.1744893, 18.1392682, 27.6152192, 21.0045136, 28.0224205, 26.5692797,
  28.9952192, 35.6324021, 27.6756153, 24.1850861, 27.8542562, 30.6187182,
  25.4835887, 27.6732922, 27.6414935, 19.2370806, 26.8892099, 23.5372461,
  26.8561243, 31.2019592, 42.2955339, 30.0204426, 32.4021614, 20.7569456,
  27.2942332, 23.9750141, 26.2850638, 16.7624382, 33.0947322, 24.0859599,
  32.1946124, 29.4301999, 30.2732967, 21.4577098, 49.1818696, 51.8139063,
  38.768469, 35.5710685, 26.370072, 30.6496823, 39.3829068, 15.2329246,
  26.0432293, 35.6630347, 29.6303257, 41.2432668, 45.2378368, 34.3707241,
  30.5024637, 19.9775718, 17.801213, 26.1688732, 28.4875885, 29.7568102,
  29.1107832, 36.2328291, 31.8214314, 38.6204676, 36.8834063, 42.6788448,
  28.7272819, 28.626164, 34.291455, 13.2104893, 46.3331664, 25.6895379,
  15.6121566, 24.8888988, 15.5789419, 26.7369002, 46.104393, 23.2856908,
  20.3333047, 30.5485, 15.6038882, 28.7037872, 32.3490014, 28.0980547,
  30.1026873, 15.7965292, 23.5073005, 23.9334505, 19.6343642, 22.1035284,
  24.9623722, 17.4625706, 19.5039162, 28.129359, 26.2476225, 26.7068015,
  30.9865519, 26.9848648, 25.3245441, 27.8976892, 27.4579313, 41.9166111,
  17.2998378, 29.7315102, 25.7406406, 22.2793813, 36.3643588, 20.9277299,
  44.1597183, 27.5133605, 25.6170785, 50.9843355, 26.9664186, 49.9873232,
  20.9170467, 24.1125628, 36.8751858, 34.3871658, 20.4164672, 25.8413742,
  40.4310466, 21.2163069, 36.3361406, 38.0197324, 33.3294001, 21.4165966,
  28.4923429, 22.1280619, 22.4756409, 30.2215385, 41.7292709, 36.8907943,
  31.5413965, 26.1837229, 37.0218326, 25.6081831, 28.1776375, 29.8671555,
  29.3736138, 35.4604974, 18.7050421, 22.255564, 33.6674798, 29.5201891,
  24.0745051, 31.8653496, 27.0345565, 26.0525699, 23.0252921, 28.5281226,
  33.71177, 29.0951349, 21.7951779, 31.0860777, 22.6393045, 19.0780616,
  24.3621088, 29.5905486, 26.5586841, 42.5486628, 33.6081618, 25.1165999,
  17.9542253, 24.9186609, 38.5966133, 17.0141855, 23.0060186, 30.1943135,
  27.1080814, 28.6187819, 24.1290464, 41.5916513, 43.4616517, 21.3195541,
  26.1493297, 20.9077832, 25.7692305, 29.4261399, 29.2463376, 28.8000356,
  25.1911071, 35.8697203, 22.2615425, 31.4633835, 24.1877693, 22.8952581,
  15.1601842, 32.3567013, 27.3661214, 39.0040261, 32.0344394, 18.0945006,
  23.8093766, 31.8086423, 40.3121132, 30.3588501, 25.9724817, 44.6408476,
  43.4099194, 30.3728664, 33.5631618, 23.0705636, 27.4936808, 36.8187291,
  32.9492242, 29.5742094, 25.5605033, 23.7780532, 25.3959579, 38.1226182,
  24.9726063, 46.6698573, 51.4411263, 25.9290155, 31.1392917, 52.7543492,
  31.7838842, 30.0237536, 25.819024, 29.7256644, 28.6428477, 32.1406846,
  42.8654594, 33.7451799, 37.9804767, 28.7298898, 26.8582201, 46.1198892,
  32.7408768, 55.5203714, 31.495731, 51.0941729, 24.314699, 33.4828115,
  24.4570093, 29.5138786, 21.5354954, 30.317556, 24.6148894, 17.7956648,
  31.7810597, 30.4743448, 19.8238082, 32.3247417, 27.3858365, 29.8964156,
  29.7147584, 25.2144471, 43.6346636, 28.5816332, 26.0747485, 39.6629311,
  29.0223235, 28.5093962, 26.6550715, 30.5273411, 20.8669945, 29.1348172,
  21.710507, 24.8998055, 32.975078, 39.652974, 17.3980911, 40.1282322,
  35.8886658, 27.829678, 49.7612583, 31.9280938, 28.5301198, 27.4779753,
  25.1837491, 32.5874968, 25.1871786, 21.9365623, 26.8613984, 24.9095698,
  32.8732303, 27.1493754, 22.0098701, 34.8794858, 32.4926707, 15.6674662,
  24.9172861, 27.4232858, 28.6305736, 32.8272527, 20.0910068, 40.1099478,
  23.6793994, 26.1303681, 32.4211306, 36.3060647, 13.3999648, 29.8795415,
  42.9840395, 24.9583988, 22.7460185, 43.3399476, 25.5209943, 18.1369994,
  28.7716568, 25.3741116, 30.5742097, 32.1805709, 23.9898692, 28.0885658,
  30.6875465, 22.8677012, 34.825549, 29.3668426, 34.999954, 41.5279957,
  22.285163, 24.0556159, 15.200475, 21.4487252, 19.0435518, 30.7447739,
  15.9420322, 16.7287114, 28.6306528, 29.554746, 16.4364149, 31.3476225,
  34.9007223, 30.0167197, 27.4047092, 27.0686892, 26.8545017, 16.7846713,
  23.2117939, 31.6776801, 29.9123239, 32.8621553, 21.3552832, 50.75349,
  23.991315, 29.7791991, 24.7992546, 27.5752878, 17.4821681, 26.911058,
  25.3942484, 31.8553779, 29.6222535, 22.8196871, 31.0947927, 41.7734339,
  35.4348117, 20.5096086, 28.8058813, 38.8916449, 24.7993731, 33.1395299,
  21.5910174, 27.5014509, 15.826052, 27.9783595, 40.0840328, 28.2133025,
  32.194761, 54.2405209, 31.9051349, 25.4699985, 25.2212782, 22.0680464,
  14.9236318, 37.6760713, 33.189865, 33.3475948, 23.3487752, 26.42338,
  30.3284095, 24.8590412, 15.1272312, 24.4415683, 24.3445192, 32.8710454,
  43.5016354, 38.9345868, 15.6964367, 33.7304737, 21.6569327, 26.3130489,
  22.4141185, 28.3356213, 31.1180693, 26.1339403, 19.5924288, 27.3062312,
  70.0232447, 31.4218925, 31.6894943, 70.6923221, 27.8249275, 45.9796955,
  27.5667195, 39.3534247, 25.2532679, 26.6210675, 42.0462846, 57.8231799,
  32.1834225, 35.3014761, 21.4324152, 30.7373532, 29.6940796, 51.0814799,
  26.3502205, 19.3649445, 24.7811548, 21.3144558, 44.4579779, 30.3942605,
  24.9829469, 30.9145726, 22.6600533, 33.542845, 25.0688544, 23.3785057,
  31.7691544, 30.4176433, 37.8272268, 36.0808069, 31.3964826, 18.1158916,
  22.5676528, 27.3483272, 23.0186353, 20.550375, 39.3741719, 20.2418609,
  21.1396468, 66.5203361, 62.4761334, 29.6869787, 26.3493349, 37.4383524,
  11.9058338, 26.0618828, 27.7359828, 16.1160718, 15.9020783, 24.2150908,
  25.8994792, 27.4616096, 32.8780234, 27.1384018, 14.7083443, 36.2070307,
  36.4121969, 30.5070904, 29.0891587, 20.2350553, 25.2963738, 15.7358134,
  16.9517607, 34.2212512, 27.7858155, 28.1410475, 29.6620824, 26.7803718,
  27.2988802, 19.9575323, 30.1752288, 27.5984041, 28.1399913, 16.9137777,
  32.6449213, 23.451331, 30.4658547, 21.8190914, 22.1539569, 24.4125483,
  24.8686785, 26.2065556, 16.5003938, 35.8479682, 24.0469412, 40.4014116,
  33.4889847, 22.8764475, 47.3298653, 18.5901704, 30.3538952, 36.3691136,
  31.4970049, 19.9467581, 29.2147637, 27.4377932, 36.0034333, 37.0777657,
  29.8718446, 32.4984043, 32.6625905, 35.8877784, 32.6524614, 54.8709701,
  16.2960404, 25.8058264, 23.3658142, 22.3081803, 19.9078811, 63.384812,
  28.1309744, 37.47588, 30.4532575, 44.6020145, 33.2618816, 24.0572143,
  13.706158, 37.4377234, 26.3083542, 21.7035413, 55.5107049, 15.4091252,
  41.8114748, 32.530624, 51.0474142, 46.2803631, 23.4427667, 38.9682187,
  26.6724182, 21.1864403, 40.0251724, 36.3530887, 17.4979165, 35.06262,
  23.74311, 36.424138, 27.5016505, 16.5533966, 21.071959, 32.0166696,
  31.6319279, 58.1904527, 29.5304514, 26.0416582, 33.6718921, 40.8230363,
  38.4883028, 27.2786438, 24.1567016, 18.165015, 39.4164839, 25.5206923,
  29.2113946, 54.5010605, 28.7706133, 18.5841954, 44.3722705, 20.11255,
  29.4044921, 30.7372406, 14.0238355, 33.6927312, 16.1737632, 38.0253688,
  26.6644105, 18.53842, 27.7307437, 51.8477646, 32.6874462, 30.5680848,
  30.9982972, 27.7979667, 21.532476, 24.7052444, 39.1467731, 58.5943291,
  23.1092334, 36.9199715, 29.3797749, 15.8163776, 28.6779247, 33.0831701,
  22.6006952, 22.7515948, 38.4527168, 31.9983674, 40.9573834, 23.3273802,
  19.8011584, 35.6943063, 35.3977388, 22.0540011, 34.1045856, 27.5684501,
  25.5696024, 23.621706, 21.9372108, 30.2297453, 32.0413651, 34.8618642,
  37.8348272, 25.6725508, 26.6521851, 18.6582369, 35.5246539, 25.1168522,
  25.1152485, 27.4422305, 27.5549447, 40.7587422, 46.997187, 16.5311856,
  28.7304576, 28.3537612, 29.3829696, 30.9081955, 33.0904867, 54.6381586,
  38.9128035, 35.0343507, 23.9988363, 28.0781288, 22.4621496, 32.9971513,
  25.2213571, 30.1988958, 23.9096162, 46.0506056, 32.1925042, 35.8170223,
  23.8509302, 38.5036865, 38.731735, 29.397908
)
kabocha
  • 133
  • 7

2 Answers2

2

Pity the poor simplex algorithm! In this example there are 934 observations, 780 of which are 0. So simplex would like to choose which two of the 780 it should pick to make a solution to say that the conditional median of y|x is 0. Any two will do, but how to choose? One could dither the y's, dither(y, value = 1e-8) -- this breaks the ties, and delivers a single precision answer, but as the other responder suggests it is better to switch to method = "fn". Even better would be to avoid using QR at all for problems like this where the response variable is discrete.

  • Thank you very much for the answer. Also I thank you to provide this analysis method for us.As recommended, I already moved to method = "fn" for my sequence and it works well so far. I have millions of pairs of variables and need to extract pairs of variables which are explanable about their relation by QR. Practically I cannot check each pairs whether it is appropriate for QR or not. Only few cases fell into this pit hole. Thank you very much again. – kabocha Apr 05 '21 at 20:32
1

Your response vector is a bit too sparse so I am not sure how efficiently the default algorithm can solve that, if you check the help page for rq, under method:

The default method is the modified version of the Barrodale and Roberts algorithm for l1-regression, used by ‘l1fit’ in S, and is described in detail in Koenker and d'Orey(1987, 1994), default = ‘"br"’. This is quite efficient for problems up to several thousand observations, and may be used to compute the full quantile regressionprocess. [...]For larger problems it is advantageous to use the Frisch-Newton interior point method ‘"fn"’.

If you need something specifically from the default algorithm, you can try:

library(quantreg)
fit = rq(y ~ x, tau = 0.50, method = "fn")
StupidWolf
  • 45,075
  • 17
  • 40
  • 72
  • Thank you for your response. In another case that y is continuous and x is a bit discrete, method "br" doesn't complete computation too. I know the other methods work. So I wanted to scan all the methods and compare the results. To do it sequentially, I needed to put a skip sequence for this kind of cases. If it's hard to find a proactive detection of this endless calculation, as you recommend I would try with "fn". Now I'm checking if "fn" can calculate all my cases or not. – kabocha Feb 21 '21 at 19:43
  • Hey, look at your y values. I really don't see the point of doing a quantile regression when they are so many zeros. Likewise for your other data, you gotta think about whether a regression makes sense in the first place – StupidWolf Feb 21 '21 at 20:17
  • Does the above answer your question? – StupidWolf Feb 21 '21 at 20:18
  • Expected answer was a boundary condition which causes this endless calculation as I mentioned in my question. If it's not able to find the condition, I'd better not to use "br" for my analysis sequence. I'm now checking if "fn" works under tryCatch(). If it works, then I try to add another methods. – kabocha Feb 21 '21 at 21:34