Comments (2)
Depending on how hard and time consuming a managed implementation would be, I would suggest to first go the route of adding bindings to the respective LAPACK method and using that instead for starters. I went the same route with the thin SVD.
Having a managed version in F# has value, however there is a reason why these linear algebra routines are used under the hood by almost any high performance stats/ML library - they are highly optimized and tested. So depending on the use case (and how fast you need it) i would highly suggest going this route. If i can give more pointers/help on that feel free to ask. As a first pointer, it looks to me like this is the needed subroutine: https://www.netlib.org/lapack/explore-html/d0/da1/group__geqrf_gade26961283814bb4e62183d9133d8bf5.html#gade26961283814bb4e62183d9133d8bf5
from fsharp.stats.
Summary
As you mentioned there are two result types of a QR decomposition: (i) full/complete form QR (Householder) and (ii) reduced form QR (Gram-Schmidt)1,2,3.
Gram-Schmidt seems to be efficient and easy to compute, but is numerically unstable4,5. There seems to be a modified Gram-Schmidt method with increased accuracy6. This may be worth looking at in future. The reduced form seems to be unable to handle rank-deficient matrices.
Unfortunately you cannot convert the full QR into the reduced form (at least I was not able to find a reference that shows how to do it). If you want, you can open a PR adding the Gram-Schmidt QR decomposion. As it's less numerically stable than the existing version I would suggest to call it QR_GramSchmidt and add detailed XML-documentation to both versions explaining the differences 👍
References:
- https://de.wikipedia.org/wiki/QR-Zerlegung#Definition
- https://qph.cf2.quoracdn.net/main-qimg-c19b21f42d093963b26bf5784c8aeafb
- https://studyflix.de/mathematik/qr-zerlegung-1786 Section "Allgemeine QR Zerlegung"
- https://en.wikipedia.org/wiki/QR_decomposition#Advantages_and_disadvantages
- https://blogs.mathworks.com/cleve/2016/07/25/compare-gram-schmidt-and-householder-orthogonalization-algorithms
- https://en.wikipedia.org/wiki/Gram%E2%80%93Schmidt_process#Numerical_stability
from fsharp.stats.
Related Issues (20)
- Decision trees and random forest
- kNN classification HOT 1
- Documentation request for X² test
- [Feature Request] Surface fitting for simple data, and example that shows the surface in plotly HOT 5
- [Feature Request] NaN safety, we probably need something more than doc strings. HOT 2
- [Feature Request] review / remove [<AutoOpen>] on modules that overlay FSharp.Core collection types. HOT 2
- [Feature Request]addition of Normalized Mutual Information
- [BUG] Incorrect Behavior in FSharp.Stats.SpecializedGenericImpl.setColM for Non-Square Matrices
- [Feature Request] weighted KNN imputation
- `JaggedCollection.transpose` results in wrong result when applied to rows of varying length
- [BUG] HierarchicalClustering cannot digest data of generic type anymore
- [BUG] Interval.isIntersection false positive on one-sided open intervals HOT 1
- [Feature Request] Support intersect on mixed interval types
- [BUG] Seq.weightedMean returns a function
- [BUG] Seq.stats returns wrong seq length (N)
- [Feature Request] Rename round operator HOT 1
- Update fsdocs to new documentation template HOT 1
- [BUG] ApiDocs github links go to the wrong branch.
- [Feature Request] Median should give a more helpful error for empty non-float sequences
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fsharp.stats.