python: least-squares estimation?


I know how to implement least-squares with elementary matrix decomposition and other operations, but how can I do it in Python? (I’ve never tried to use matrices in Python)

(clarification edit to satisfy the shoot-first-and-ask-questions-later -1’er)

I was looking for help to find out how to use numerical programming in Python. Looks like numpy and scipy are the way to go. I was looking for how to use them, but I found a tutorial.

Asked By: Jason S



Have a look at SciPy. It’s got matrix operations.

Answered By: duffymo

scipy and numpy is the obvious way to go here.

Note that numpy uses the famous (and well-optimized) BLAS libraries, so it is also very fast. Much faster than any “pure python” will ever be.

Aha, this tutorial for numpy gives me a good starting point.

Answered By: Jason S
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.