473,395 Members | 1,637 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,395 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 5462
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...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.