473,372 Members | 1,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

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 5460
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
win the accolades you deserve.

--
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Vamshi | last post by:
I do have some problems. Can any one help me out? 1.Ordered squares. A 6-digit number STWXYZ is an ordered number if the diff between first 3 dig, STW and last three XYZ is 1. For example 123124...
15
by: nikie | last post by:
I'm a little bit stuck with NumPy here, and neither the docs nor trial&error seems to lead me anywhere: I've got a set of data points (x/y-coordinates) and want to fit a straight line through...
49
by: Ben Voigt [C++ MVP] | last post by:
I'm trying to construct a compelling example of the need for a language feature, with full support for generics, to introduce all static members and nested classes of another type into the current...
84
by: jacob navia | last post by:
As many people know, I think that garbage collection is a good solution for many memory allocation problems. I am aware however, that nothing is "the silver bullet", not even the GC. A recent...
2
by: navon2 | last post by:
Hi I need to find x that will minimize Ax-b=0, under the inequality constraints Cx<d. Actually the constraints in my problem are only upper and lower bounds to x values. x is 4x1 vector, A is...
1
by: J.SanTanA | last post by:
Hello All! Any one know where can I find some php code (or "php-able" code) implementing least squares method? Thx in advance and pls excuse my poor eng
8
by: Fett | last post by:
I am trying to find a wrapper to do linear programming within python. I am using an ubuntu machine and I have apt-get'd lp_solve, which works just fine. If someone knows of a wrapper that will work...
4
by: Evelien | last post by:
Dear python-users, I am trying to do a non-linear least squares fitting. Maybe trying is not the best word, as I already succeeded in that. At the moment I am using leastSquaresFit from...
5
by: fordie1000 | last post by:
Hi, I have performed a fit to data using scipy's 'leastsq' function. However, I wanted to be able to weight the fit by individual errors on the data points. Here is an example of what I'm...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.