472,119 Members | 1,241 Online

# Generalized Linear Least Squares Problems

Hi,

I want to solve linear least sqaure problem( min||c-Ax||2 subject to
Bx=d ). How do I do it in python. lapack has a routine for doing this
(DGGLSE). Can I access this from python?

TIA,
venkat.

Jul 19 '05 #1
3 5391
On 31 May 2005 03:12:49 -0700, venkat <vv********@yahoo.com> wrote:
Hi,

I want to solve linear least sqaure problem( min||c-Ax||2 subject to
Bx=d ). How do I do it in python. lapack has a routine for doing this
(DGGLSE). Can I access this from python?

Check out scipy, in particular the linear algebra package.

http://www.scipy.org/documentation/a...py.linalg.html

Cheers,

Tim
TIA,
venkat.

--
http://mail.python.org/mailman/listinfo/python-list

Jul 19 '05 #2
Tim Leslie wrote:
On 31 May 2005 03:12:49 -0700, venkat <vv********@yahoo.com> wrote:
Hi,

I want to solve linear least sqaure problem( min||c-Ax||2 subject to
Bx=d ). How do I do it in python. lapack has a routine for doing this
(DGGLSE). Can I access this from python?
Check out scipy, in particular the linear algebra package.

http://www.scipy.org/documentation/a...py.linalg.html

Cheers,

Tim

Or you could try numarray, available for use with Python 2.4

http://sourceforge.net/project/showf...ease_id=329948

Colin W.
TIA,
venkat.

--
http://mail.python.org/mailman/listinfo/python-list

Jul 19 '05 #3
Colin J. Williams wrote:
Tim Leslie wrote:
On 31 May 2005 03:12:49 -0700, venkat <vv********@yahoo.com> wrote:
Hi,

I want to solve linear least sqaure problem( min||c-Ax||2 subject to
Bx=d ). How do I do it in python. lapack has a routine for doing this
(DGGLSE). Can I access this from python?

Check out scipy, in particular the linear algebra package.

http://www.scipy.org/documentation/a...py.linalg.html

Cheers,

Tim

Or you could try numarray, available for use with Python 2.4

Neither of these solve the generalized least squares problem.

However, it is easier to add to scipy.linalg. Look at the file
scipy/Lib/linalg/generic_flapack.py and copy and modify the block for
DGELSS to work for DGGLSE. Then modify the Python function
scipy.linalg.lstsq to take the optional extra arguments and do the
generalized problem. Finally, contribute your changes back to scipy and

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

Jul 19 '05 #4

### This discussion thread is closed

Replies have been disabled for this discussion.