Is numpy.polyfit with 1 degree of fitting, TLS or OLS?
<p>I have two timeseries x and y, both have the same length. Using <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.polyfit.html" rel="nofollow">numpy.polyfit</a>, I fit a straight line through the data with:</p>

<pre><code>numpy.polyfit(x,y,1)
</code></pre>

<p>Is this <a href="https://en.wikipedia.org/wiki/Total_least_squares" rel="nofollow">Total Least Squares (TLS)</a> or <a href="https://en.wikipedia.org/wiki/Ordinary_least_squares" rel="nofollow">Ordinary Least Squares (OLS)</a>? I want to fit a TLS in python, how can this be done?</p>

<p>You can use <a href="http://docs.scipy.org/doc/scipy/reference/odr.html" rel="nofollow">scipy.odr</a> it will compute orthogonal regression which should be equal to tls. </p>

python numpy scipy