# \#qr

**URL:** https://discourse.julialang.org/tag/qr/573.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Julia analog to R's poly function, orthogonal polynomials by QR decomposition](https://discourse.julialang.org/t/julia-analog-to-rs-poly-function-orthogonal-polynomials-by-qr-decomposition/128640)

<div class="topic-metadata">

**Author:** [@Daniel\_Johansson](https://discourse.julialang.org/u/Daniel_Johansson)\
**Replies:** 24\
**Last updated:** [April 22, 2026, 3:57pm UTC](https://discourse.julialang.org/t/julia-analog-to-rs-poly-function-orthogonal-polynomials-by-qr-decomposition/128640 "2026-04-22T15:57:18Z")

</div>

Hey guys! Im trying to replicate some existing R code in julia for a proyect, but such R code depends on the stats base poly function which, given a collection of points, it computes orthogonal polynomials evaluated at …

---

## [Best way for linear regression problem on product features](https://discourse.julialang.org/t/best-way-for-linear-regression-problem-on-product-features/127786)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 28\
**Last updated:** [April 11, 2025, 12:05am UTC](https://discourse.julialang.org/t/best-way-for-linear-regression-problem-on-product-features/127786 "2025-04-11T00:05:49Z")

</div>

Hi, I need to solve the following least-squares problem efficiently, where X and Z denote two matrices of features. I can transform this into a least-squares problem manually by first creating a feature matrix W by takin…

---

## [Square-Root Kalman-Filter: Calculate only upper triangular of QR-decomposition](https://discourse.julialang.org/t/square-root-kalman-filter-calculate-only-upper-triangular-of-qr-decomposition/55621)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 9\
**Last updated:** [August 8, 2024, 1:23pm UTC](https://discourse.julialang.org/t/square-root-kalman-filter-calculate-only-upper-triangular-of-qr-decomposition/55621 "2024-08-08T13:23:54Z")

</div>

I’m implementing the Square-Root Kalman-Filter similar to this python implementation: Python - Square-Root Kalman-Filter The implementation calculates the QR-decomposition, but it only needs the upper triangular matrix…

---

## [Cannot ForwardDiff through linear least squares via QR](https://discourse.julialang.org/t/cannot-forwarddiff-through-linear-least-squares-via-qr/104257)

<div class="topic-metadata">

**Author:** [@Neodym](https://discourse.julialang.org/u/Neodym)\
**Replies:** 6\
**Last updated:** [September 27, 2023, 6:26am UTC](https://discourse.julialang.org/t/cannot-forwarddiff-through-linear-least-squares-via-qr/104257 "2023-09-27T06:26:39Z")

</div>

Hey, I’d like to get derivatives for a linear least squares problem where the parameter appears in the right hand side: using LinearAlgebra using ForwardDiff A = rand(10, 3) b = rand(10) qr\_fact = qr(A) function f(p…

---

## [Inverting the columns of \`LinearAlgebra.QRCompactWYQ\`](https://discourse.julialang.org/t/inverting-the-columns-of-linearalgebra-qrcompactwyq/90003)

<div class="topic-metadata">

**Author:** [@brainandforce](https://discourse.julialang.org/u/brainandforce)\
**Replies:** 0\
**Last updated:** [November 9, 2022, 7:24pm UTC](https://discourse.julialang.org/t/inverting-the-columns-of-linearalgebra-qrcompactwyq/90003 "2022-11-09T19:24:53Z")

</div>

I need to perform a QR decomposition with all of the diagonal elements of R to be positive. I’d like to do this by multiplying relevant columns of Q and rows of R by -1, but the issue that comes up is that qr!() returns L…

---

## [Pivoting in sparse QR](https://discourse.julialang.org/t/pivoting-in-sparse-qr/79306)

<div class="topic-metadata">

**Author:** [@00shiv](https://discourse.julialang.org/u/00shiv)\
**Replies:** 6\
**Last updated:** [April 11, 2022, 3:11am UTC](https://discourse.julialang.org/t/pivoting-in-sparse-qr/79306 "2022-04-11T03:11:43Z")

</div>

I have a skinny sparse matrix that I have taken care to order its rows and columns in such a way as to ensure that the sparse QR factorization should be fast \[O(n) space and time\]. However when I call qr in Julia 1.7.2 i…

---

## [Computing QR decomposition many times in parallel](https://discourse.julialang.org/t/computing-qr-decomposition-many-times-in-parallel/75241)

<div class="topic-metadata">

**Author:** [@coviktor](https://discourse.julialang.org/u/coviktor)\
**Replies:** 2\
**Last updated:** [January 27, 2022, 4:53pm UTC](https://discourse.julialang.org/t/computing-qr-decomposition-many-times-in-parallel/75241 "2022-01-27T16:53:49Z")

</div>

I’m new to GPU programming and don’t understand many details. Let’s say I have 2 matrices A1 = CUDA.rand(1000,1000) A2 = CUDA.rand(1000,1000) and I would like to compute their QR decompositions on GPU in parallel (usin…

---

## [How to change the tolerance of the QRPivoted method](https://discourse.julialang.org/t/how-to-change-the-tolerance-of-the-qrpivoted-method/71753)

<div class="topic-metadata">

**Author:** [@valperez](https://discourse.julialang.org/u/valperez)\
**Replies:** 5\
**Last updated:** [November 19, 2021, 6:08pm UTC](https://discourse.julialang.org/t/how-to-change-the-tolerance-of-the-qrpivoted-method/71753 "2021-11-19T18:08:19Z")

</div>

Hi there :slight\_smile: I’m using the LinearAlgebra package in Julia to use the QRPivoted method. The documentation is not very clear about the use of the tolerance. I want to use que qr pivoted function on a matrix A b…

---

## [Linear regression from scratch using QR decomposition](https://discourse.julialang.org/t/linear-regression-from-scratch-using-qr-decomposition/71363)

<div class="topic-metadata">

**Author:** [@valperez](https://discourse.julialang.org/u/valperez)\
**Replies:** 3\
**Last updated:** [November 12, 2021, 6:27am UTC](https://discourse.julialang.org/t/linear-regression-from-scratch-using-qr-decomposition/71363 "2021-11-12T06:27:08Z")

</div>

Hi there :slight\_smile: I’m trying to fit a polinomial regression of grade 10 from scratch. First things first, imagine I have a dataset with just two columns, x and y. I want to fit a polinomial of grade 10 but I don’t…

---

## [Why is work with Q in qr() is so expensive?](https://discourse.julialang.org/t/why-is-work-with-q-in-qr-is-so-expensive/59143)

<div class="topic-metadata">

**Author:** [@Wei\_Yang](https://discourse.julialang.org/u/Wei_Yang)\
**Replies:** 6\
**Last updated:** [April 13, 2021, 9:33am UTC](https://discourse.julialang.org/t/why-is-work-with-q-in-qr-is-so-expensive/59143 "2021-04-13T09:33:42Z")

</div>

In the picture below, we can see that it is very efficient to generate a random unitary matrix Q using the qr() function in LinearAlgebra. However, if we want to work with the generated Q, it appears to be very expensiv…

---

## [Economy-sized QR decomposition](https://discourse.julialang.org/t/economy-sized-qr-decomposition/57608)

<div class="topic-metadata">

**Author:** [@qrebjock](https://discourse.julialang.org/u/qrebjock)\
**Replies:** 10\
**Last updated:** [April 6, 2021, 6:34am UTC](https://discourse.julialang.org/t/economy-sized-qr-decomposition/57608 "2021-04-06T06:34:59Z")

</div>

Hello, It seems like the function qr doesn’t take keywords argument to return an economy-sized factorization. In this thread qr(A; full=false) no longer available? · Issue #27397 · JuliaLang/julia · GitHub they say tha…

---

## [Does this lose the benefit of QR decomposition?](https://discourse.julialang.org/t/does-this-lose-the-benefit-of-qr-decomposition/58324)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 2\
**Last updated:** [April 1, 2021, 11:49pm UTC](https://discourse.julialang.org/t/does-this-lose-the-benefit-of-qr-decomposition/58324 "2021-04-01T23:49:29Z")

</div>

My understanding is that one can do fast multiplies by the Q matrix of the QR decomposition because it is represented as a sequence of Householder reflections. I want to compute deltai = 3:size(T, 1) δ = Q\[:, d…

---

## [Performance issue with QRCompactWYQ](https://discourse.julialang.org/t/performance-issue-with-qrcompactwyq/53732)

<div class="topic-metadata">

**Author:** [@theogf](https://discourse.julialang.org/u/theogf)\
**Replies:** 1\
**Last updated:** [January 26, 2021, 8:46am UTC](https://discourse.julialang.org/t/performance-issue-with-qrcompactwyq/53732 "2021-01-26T08:46:19Z")

</div>

Hey, since it’s not a bug specifically but a performance issue I post it here instead on Github. In the attempt of generating random positive definite matrices I realized there was a huge performance issue with the QRCo…
