https://github.com/nhey/lm
Fit linear models in Futhark with a robustness towards ill-conditioned problems. Output is very close to that of lm in the R language
https://github.com/nhey/lm
fortran futhark gpu r sequential
Last synced: 5 months ago
JSON representation
Fit linear models in Futhark with a robustness towards ill-conditioned problems. Output is very close to that of lm in the R language
- Host: GitHub
- URL: https://github.com/nhey/lm
- Owner: nhey
- Created: 2021-05-12T09:40:48.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-26T06:55:47.000Z (almost 5 years ago)
- Last Synced: 2025-03-26T18:56:39.290Z (about 1 year ago)
- Topics: fortran, futhark, gpu, r, sequential
- Language: Futhark
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Fit linear models in Futhark with a robustness towards ill-conditioned problems.
Model parameters are estimated by solving the linear least squares
equations based on a pivoting QR-decomposition.
It is well suited for small, numerically unstable problems.
This package seeks to match the output of `lm` in the R language.
Therefore, the QR-decomposition and parts of the least squares solver
is a 1:1 translation of sequential FORTRAN routines from the famous
LINPACK library (see `linpack.fut`).
The QR-decomposition is _rank revealing_, meaning we obtain the rank
of the regressor matrix, `X`. The rank is used to ensure a meaningful
fit: if the problem is ill-conditioned so that (at least for numerical
work) the regressor matrix is rank deficient, parameters will
be dropped accordingly until this is no longer the case.
It should be possible to extend this to also output the condition number of `X`,
or at least an estimate of this---untested sample code can be found in `lm.fut`.