-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
predict_gfbootstrap.R will occasionally fail when all
determinants come back as 0.
Mathematically that would happen if
- The matrix is not full rank: some rows/cols are linear combinations
of other rows/cols. - Some columns or rows are entirely 0.
- The matrix is not invertible for some reason.
It can also happen for numerical reasons.
I have examined a few matricies, and the matrices were full rank, and
no rows or cols were all 0.
I suspect numerical issues.
I increased the numerical resolution to doubles, but the problem remained.
Because I know the matrix is supposed to be symmetric, I can use
linalg_eigh which did succeed in returning the eigenvectors and
eigenvalues.
mat_eig <- torch::linalg_eigh(mat)
inv <- mat_eig[[2]]$multiply(mat_eig[[1]])$multiply(mat_eig[[2]]$transpose(1,2))
det <- mat_eig[[1]]$prod()However, this is much slower, and not well integrated into the rest of
the code, so for now surveys that have this problem will just return
NA, not fitted.
Metadata
Metadata
Assignees
Labels
No labels