**Answers**

#### A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php

Line: 191

Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php

Line: 433

Function: view

File: /home/prodcxja/public_html/questions/index.php

Line: 315

Function: require_once

## What is the difference between numpy.linalg.lstsq and scipy.linalg.lstsq?

`lstsq`

tries to solve `Ax=b`

minimizing `|b - Ax|`

. Both scipy and numpy provide a `linalg.lstsq`

function with a very similar interface. The documentation does not mention which kind of algorithm is used, neither for scipy.linalg.lstsq nor for numpy.linalg.lstsq, but it seems to do pretty much the same.

The implementation seems to be different for scipy.linalg.lstsq and numpy.linalg.lstsq. Both seem to use LAPACK, both algorithms seem to use a SVD.

Where is the difference? Which one should I use?

**Note:** do not confuse `linalg.lstsq`

with `scipy.optimize.leastsq`

which can solve also non-linear optimization problems.