ryantibs / quantgen

Tools for generalized quantile modeling
https://ryantibs.github.io/quantgen
14 stars 9 forks source link

Singularity issue in get_lambda_max() #25

Open jeremy-goldwasser opened 1 year ago

jeremy-goldwasser commented 1 year ago

I'm running into a singularity issue when I run get_lambda_max(). The line producing the error is when get_lambdamax tries to invert the matrix: solve(mat, c(t(x) %*% y, rep(0, m))). Specifically, X is a matrix of Covid case counts where each successive row and column indicates a later date, so $X{i,j} = X{i+1,j+1} = X{i+2,j+2} = \ldots$. Given this symmetry, it stands to reason that X might be singular. However, it would be helpful for get_lambda_max() to have a crude workaround, e.g. adding small noise to the diagonal entries.