# Generate singular value sequentialy

**URL:** <https://discourse.julialang.org/t/generate-singular-value-sequentialy/50434>\
**Category:** Numerics\
**Tags:** question\
**Created:** [November 19, 2020, 1:34pm UTC](https://discourse.julialang.org/t/generate-singular-value-sequentialy/50434 "2020-11-19T13:34:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geoffrey](https://avatars.discourse-cdn.com/v4/letter/g/bc8723/32.png) [@Geoffrey](https://discourse.julialang.org/u/Geoffrey)\
**Post date:** [November 19, 2020, 1:34pm UTC](https://discourse.julialang.org/t/generate-singular-value-sequentialy/50434/1 "2020-11-19T13:34:29Z")

</div>

Hi,

I’m wondering if there is a way of generating singular value sequentialy. I’m aware of the truncated svd utilities from TSVD.jl and LowRankApprox.jl but to my knowledge they didn’t provide a way to generate singular value sequentialy. I mean if I have the r first singular value and want the r + 1, I will have to recompute the r first…

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [November 19, 2020, 1:56pm UTC](https://discourse.julialang.org/t/generate-singular-value-sequentialy/50434/2 "2020-11-19T13:56:45Z")

</div>

> [@Geoffrey](#):
>
> I mean if I have the r first singular value and want the r + 1, I will have to recompute the r first…

If you have the first r singular vectors as well as the singular values, then you can deflate the matrix — project onto the orthogonal complement of the singular vectors — in order to remove those singular values.

---

<div class="post-metadata">

**Author:** ![Geoffrey](https://avatars.discourse-cdn.com/v4/letter/g/bc8723/32.png) [@Geoffrey](https://discourse.julialang.org/u/Geoffrey)\
**Post date:** [November 19, 2020, 2:13pm UTC](https://discourse.julialang.org/t/generate-singular-value-sequentialy/50434/3 "2020-11-19T14:13:25Z")

</div>

Thank you for your answer, yes it is a solution !  
I was thinking of a way to build a generator function (like with the yield syntaxe in python) based on the existing tsvd function but it’s definitely easier to simply remove the r first singular value as you suggest, although certainly less efficient !
