r-hyperspec / hyperSpec

hyperSpec: Tools for Spectroscopy (R package)
https://r-hyperspec.github.io/hyperSpec/
GNU General Public License v3.0
12 stars 3 forks source link

Spc fit poly below on highwavelength range with high polynomial order can not solve vander monde matrix #67

Open ADorosz5 opened 2 years ago

ADorosz5 commented 2 years ago

spectra_CHstretch <- spectra[,, 2600 ~ 3150] plot (spectra_CHstretch) baseline <- spc.fit.poly.below(spectra_CHstretch, poly.order = 6)

GegznaV commented 2 years ago

@cbeleites, is it enough information for you to reproduce the error? Could a reproducible example be added to this thread?

cbeleites commented 2 years ago

@GegznaV yes, it's good for me. I think I know the reason of the problem, and I'll be able to construct also unit test data.

We found it as part of a course, and ran into the other issue #68 about dput() when trying to add a reproducible example - otherwise there would have been one....

GegznaV commented 2 years ago

@cbeleites, this issue has the status "Urgent": would you have time to try solving this issue ASAP? Otherwise wouldn't it be better to use a lower level of priority?

GegznaV commented 3 months ago

1) This issue is not solved for 3 years, so it is not urgent. 2) This issue lacks a reprex, so I'll try to create it myself. @cbeleites and @ADorosz5, please, confirm that the reprex shows the essence of the issue:

suppressPackageStartupMessages({
  library(hyperSpec)
})

spectra_CHstretch <- flu[,, 450 ~ 495]
baseline <- spc_fit_poly_below(spectra_CHstretch, poly.order = 6)
#> Error in qr.solve(vdm[use, ], y[use, i]): singular matrix 'a' in solve

Created on 2024-05-02 with reprex v2.1.0