473,569 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5475
On 31 May 2005 03:12:49 -0700, venkat <vv********@yah oo.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********@yah oo.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********@yah oo.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.ls tsq 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
1984
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 or 124123 are ordered num. A number is a square if it is equal to the product of one whole number mul by itself.An ordered square is both an ordered...
15
2201
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 them, using LMSE linear regression. Simple enough. I thought instead of looking up the formulas I'd just see if there isn't a NumPy function that does...
49
5773
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 name search scope. i.e. a very simple application would be class ManyComputations { calling System.Math;
84
3456
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 article in slashdot http://developers.slashdot.org/article.pl?sid=07/11/17/0552247 proves that.
2
3843
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 about 100x4 (and b is of course 100x1(. What is the appropriate algorithm? Is there any C / C++ code available? I succeeded solving the...
1
4011
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
3261
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 with that that'd be great. I also heard that scipy has a wrapper, however, I can't find any documentation on it, nor can I seem to find it with...
4
5223
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 Scientific Python. I know of other least squares routines, such as the one in scipy.optimize and I believe there is also one in numpy. Now here is my...
5
24424
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 doing at the moment : # fitting functions for the data fitfunc = lambda p,x: p + p*x
0
7698
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7970
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.