# \[ANN\] LinearFitXYerrors.jl : least squares ﬁtting of straight lines with correlated errors

**URL:** <https://discourse.julialang.org/t/ann-linearfitxyerrors-jl-least-squares-tting-of-straight-lines-with-correlated-errors/68112>\
**Category:** Package Announcements\
**Tags:** statistics, regression, curve-fitting\
**Created:** [September 13, 2021, 6:34pm UTC](https://discourse.julialang.org/t/ann-linearfitxyerrors-jl-least-squares-tting-of-straight-lines-with-correlated-errors/68112 "2021-09-13T18:34:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [September 13, 2021, 6:34pm UTC](https://discourse.julialang.org/t/ann-linearfitxyerrors-jl-least-squares-tting-of-straight-lines-with-correlated-errors/68112/1 "2021-09-13T18:34:55Z")

</div>

[LinearFitXYerrors.jl](https://github.com/rafael-guerra-www/LinearFitXYerrors.jl) is a small Julia package, based on York et al. (2004) with a few additions, to perform 1D linear fitting of experimental data with errors in both X and Y variables.

The [README.md](https://github.com/rafael-guerra-www/LinearFitXYerrors.jl#readme) file provides details and all the examples shown can be copied from the [examples](https://github.com/rafael-guerra-www/LinearFitXYerrors.jl/tree/master/examples) folder.

While care was taken to try making sure the code produces results consistent with a number of published material, in particular with [LsqFit.jl](https://github.com/JuliaNLSolvers/LsqFit.jl) _(when applicable)_, some advanced statistics topics involved are beyond my expertise, this is also the case with git and Julia…

The objective was to learn how to publish a package via Github while implementing York’s technique in Julia.  
Consider it to be work in progress.

Feedback is welcome.  
Thank you.

##### Example 0: _Altman and Gardner (1988)_

 ![Example0b_LinearFitXYerrors](https://global.discourse-cdn.com/julialang/original/3X/d/7/d7932ce5ec21c4126671b9b95d71a4cc35722741.png)

##### Example 1: _York (1966) and Cantrell (2008)_

 ![Example1_LinearFitXYerrors](https://global.discourse-cdn.com/julialang/original/3X/9/3/93323c73bfa6719158c5c13850b35218c89bf348.png)

##### Example 2: _Amen (2012)_

 ![Example2_LinearFitXYerrors](https://global.discourse-cdn.com/julialang/original/3X/6/8/68d291e0330b7e1a9494bdd594330f24a1f1ae31.png)

##### Example 3: _Mahon (1996)_

 ![Example3_LinearFitXYerrors](https://global.discourse-cdn.com/julialang/original/3X/0/6/06ca7c6965ba9d8b63b0ce3678c99884cbdf8440.png)
