# Gentleman's AS75 (+ Miller AS 274) Incremental WLS Algorithms

**URL:** <https://discourse.julialang.org/t/gentlemans-as75-miller-as-274-incremental-wls-algorithms/8822>\
**Category:** Statistics\
**Created:** [February 4, 2018, 11:10pm UTC](https://discourse.julialang.org/t/gentlemans-as75-miller-as-274-incremental-wls-algorithms/8822 "2018-02-04T23:10:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [February 4, 2018, 11:10pm UTC](https://discourse.julialang.org/t/gentlemans-as75-miller-as-274-incremental-wls-algorithms/8822/1 "2018-02-04T23:10:19Z")

</div>

Has someone already implemented Gentleman’s AS75 WLS code in Julia? It is not only fast and robust, but works nicely with adding single obs, one at a time.

[https://www.jstor.org/stable/2347147](https://www.jstor.org/stable/2347147)

[https://www.jstor.org/stable/2347583](https://www.jstor.org/stable/2347583)

It is not difficult, but if there is a good standard package, I would prefer it. regards, /iaw

---

<div class="post-metadata">

**Author:** ![Nosferican](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nosferican/32/9275_2.png) [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Post date:** [February 5, 2018, 4:51am UTC](https://discourse.julialang.org/t/gentlemans-as75-miller-as-274-incremental-wls-algorithms/8822/2 "2018-02-05T04:51:43Z")

</div>

I might be able to come up with the implementation as I don’t think there is one at the moment. However, it might be best to identify the missing components in the LinearAlgebra standard library module. For example, [#10953](https://github.com/JuliaLang/julia/issues/10953) which improves Cholesky decomposition with the LDLt variant for abstract matrices. An alternative is to push for rank updates which aren’t well supported right now [#2929](https://github.com/JuliaLang/julia/issues/2929). No matter the implementation it has to be build to play nice with the Factorization structs which still might suffer a few changes and are based on the BLAS library. For some aspects such as computing subset of parameters especially in sparse problems one can use the within transformation (I have a package with the implementation and there are others as well) or use an sparse iterative solvers.

---

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [February 5, 2018, 5:16am UTC](https://discourse.julialang.org/t/gentlemans-as75-miller-as-274-incremental-wls-algorithms/8822/3 "2018-02-05T05:16:44Z")

</div>

thx, N. this is way above my head. I may just roll my own for my own purposes, which (because it won’t have to play with anything else) would be relatively fast and easy.

---

<div class="post-metadata">

**Author:** ![Nosferican](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nosferican/32/9275_2.png) [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Post date:** [February 5, 2018, 5:24am UTC](https://discourse.julialang.org/t/gentlemans-as75-miller-as-274-incremental-wls-algorithms/8822/4 "2018-02-05T05:24:01Z")

</div>

If you implement the algorithms in a sensitive manner you can share that and let people in the LinearAlgebra module pick it up and work it out. Best of luck.

---

<div class="post-metadata">

**Author:** ![ivo\_welch](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@ivo\_welch](https://discourse.julialang.org/u/ivo_welch)\
**Post date:** [February 5, 2018, 6:53pm UTC](https://discourse.julialang.org/t/gentlemans-as75-miller-as-274-incremental-wls-algorithms/8822/5 "2018-02-05T18:53:27Z")

</div>

hi N: I wrote a basic implementation of AS75. where is the right place to share it? or just put it in a long post here? regards, /iaw

---

<div class="post-metadata">

**Author:** ![Nosferican](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nosferican/32/9275_2.png) [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Post date:** [February 5, 2018, 7:01pm UTC](https://discourse.julialang.org/t/gentlemans-as75-miller-as-274-incremental-wls-algorithms/8822/6 "2018-02-05T19:01:48Z")

</div>

You could post it here or share the gist (the link to the code gist). I would then open an issue in Julia for Linear Algebra stdlib for the core functionalities or to make it work better with the Factorization structs. Otherwise, I could look for a repository for it.

---

<div class="post-metadata">

**Author:** ![ivo\_welch](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@ivo\_welch](https://discourse.julialang.org/u/ivo_welch)\
**Post date:** [February 5, 2018, 9:10pm UTC](https://discourse.julialang.org/t/gentlemans-as75-miller-as-274-incremental-wls-algorithms/8822/7 "2018-02-05T21:10:29Z")

</div>

here is a julia beginner implementation of AS75. it comes with an example test at the end.

[https://gist.github.com/iwelch/5090b475b07bf19320b3b6ea4a603a6c](https://gist.github.com/iwelch/5090b475b07bf19320b3b6ea4a603a6c)

never used this gist before. it is convenient. thanks.

---

<div class="post-metadata">

**Author:** ![simonbyrne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonbyrne/32/19_2.png) [@simonbyrne](https://discourse.julialang.org/u/simonbyrne)\
**Post date:** [February 5, 2018, 9:14pm UTC](https://discourse.julialang.org/t/gentlemans-as75-miller-as-274-incremental-wls-algorithms/8822/8 "2018-02-05T21:14:12Z")

</div>

Rather than pasting long snippets of code verbatim, can I suggest that you use something like [https://gist.github.com/](https://gist.github.com/)? This has the advantage of allowing updates.
