This patch solves this issue by running a QR decomposition if the LU decomposition fails. The QR decomposition takes considerably longer and also takes a lot of memory, but less than other possibilities that I evaluated. Another advantage is that it is directly available in the Matrix package.
I had the following problem various times with fairly big hierarchies:
Enter a frame number, or 0 to exit
1: forecast(groupedSeries, parallel = TRUE, num.cores = 2) 2: forecast.gts(groupedSeries, parallel = TRUE, num.cores = 2) 3: Comb(pfcasts, weights = wvec, keep = "bottom", algorithms = alg) 4: hts.R#178: combinef(x, groups = object$groups, ...) 5: LU(fcasts = fcasts, S = smat, weights = weights) 6: solve(lhs.l, rhs.l) 7: solve(lhs.l, rhs.l) 8: .local(a, b, ...) 9: solve(forceCspSymmetric(a, isTri = FALSE), b, tol = tol) 10: solve(forceCspSymmetric(a, isTri = FALSE), b, tol = tol) 11: .local(a, b, ...) 12: solve.dsC.dC(a, b, LDL = LDL, tol = tol) 13: .solve.dgC.lu(as(a, "dgCMatrix"), b = b, tol = tol) 14: LU.dgC(a)
This patch solves this issue by running a QR decomposition if the LU decomposition fails. The QR decomposition takes considerably longer and also takes a lot of memory, but less than other possibilities that I evaluated. Another advantage is that it is directly available in the Matrix package.