Webb Sprague | 1 Mar 01:30
Picon

minpack.error / fsolve problem

I am having a problem with convergence (I think) for an optimization.

Every so often I do a non-linear fit of a parameter using fsolve (as
input a constant vector of base death rates, a constant vector
multiplier of those, and a variable scalar multiplier -- the last is
what I am trying to fit) and I get a "minpack.error" with the message
that "Error occured while calling the Python function named f"  with
no other information. The information normally returned from fsolve
(ier, message,  infodict) are all set to none.

I am kind of at a loss for how to proceed, at least without taking a
class on optimization algorithms.  How do I get more information from
fsolve?  Is there a better optimization function to use?
optimize.golden()?  Or ... ?

See attached for how I set up the optimizer, and here is the back
trace from the web application using this code:

TRACEBACK:

Traceback (most recent call last):

  File "/usr/lib64/python2.5/site-packages/mod_python/importer.py",
line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib64/python2.5/site-packages/mod_python/importer.py",
line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

(Continue reading)

David Cournapeau | 1 Mar 05:42
Picon
Picon

Re: How to tell scipy setup that I have a INTEL fortran ATLAS/BLAS/LAPACK instead of g77

Berthold Höllmann wrote:
> Sorry for taking so long for the answer.
>
No problem.
>
>
> I am aware of some of the problems when mixing object files from
> different compiler brands.
It is not different brand, it is different version. Intel compiler on 
linux would have no chance of success if it was not compatible with 
gcc.  C being a relatively non moving target, extremely used, and "not 
difficult", there is an clear ABI for C, even on linux; that's the only 
language which did not have ABI incompatibilities between gcc 3 and 4 
(of fortran, C++ and C). recent ifort is only compatible with gcc 4, 
that is gfortran for fortran.

You cannot mix g77 and gfortran at all without huge pain, and thus, you 
cannot mix ifort and g77 (but you can mix gfortran and ifort).
>  Numpy is compiled using Intel Fortran
> compiler as well as scipy. The affected code is pure C code. The
> superLU code somewhere seems to use a wrapper to call BLAS routines
> like "DTRSV" from C. These wrapper routines seem to include ATLAS
> header files that define mappings from the routine name to some ATLAS
> wrapper routine name. This ATLAS wrapper name depends on the FORTRAN
> compiler that ATLAS is build for. The ATLAS header files use defines
> like "Add_" and "Add__" to distinguish between different FORTRAN
> compiler naming conventions. When compiling "superLU" from scipy
> "Add__" seems to used(some kind of default I guess), whereas "Add_"
> would be right for INTEL Fortran.
Yes, I understand the problem. g77 appends two underscore to function 
(Continue reading)

Fernando Perez | 1 Mar 08:45
Picon
Gravatar

Re: [Newbie] High-performance plotting of large datasets

On Thu, Feb 28, 2008 at 12:57 AM,  <scipy-user <at> onnodb.com> wrote:

>  I've spent some time on looking at various packages and frameworks
>  like Traits, Chaco and Envisage, but I just can't seem to wrap my head
>  around them.

>From your description, those three (esp. the first two) are probably
your best bets.  Have you tried playing with the examples and asking
specific questions on the enthought-dev list?  The developers there
are typically very responsive to specific queries.  You may also want
to have a look at Vision:

http://mgltools.scripps.edu/packages/vision/overview

though I don't know if it has 2-d plotting (it does have fancy OpenGL
3d features).

Cheers,

f
dmitrey | 1 Mar 09:04
Favicon

Re: nonnegative linear squares (NNLS, lsqnonneg) in Python

I have searched for free constrained LLS solvers for some my own 
purposes - connecting the ones to scikits.openopt and using the ones for 
solving ralg/lincher subproblems.

NNLS and WNNLS are BVLS predecessors. See here for BVLS license change 
from free-for-non-commercial to GPL (answer by Alan G Isaac):
http://comments.gmane.org/gmane.comp.python.scientific.devel/7431

I intend to connect the routine to scikits.openopt during 1-2 days.
Unfortunately, the BVLS routine seems to be is intended for dense 
problems only (and that's very bad for my ralg/lincher purposes).
There is other free routines that could be considered - toms/587 (I 
don't know for dense only or for sparse as well) and BCLS. Latter has 
GPL (written in ANSI C) and is capable of handling sparse problems, 
moreover, implicit A matrix via defining funcs Ax and A^T x. BCLS 
consists of lots files; it has convenient MATLAB API (2 single 
standalone  func for implicit and explicit matrix A) but calling it from 
C API is very inconvenient, one function is not enough, so I can't 
connect it to Python via ctypes, the task is too complicated.
D.

Jian, Bing (MED US) wrote:
> Hi,
>      I am wondering if there is a non-negative linear squares solver 
> in scipy/numpy
> which is equivalent to the lsqnonneg() in MATLAB? If not, then 
> probably I need
> to write my own extensions based on existing C code.  Thanks!
>  
> Bing
(Continue reading)

Bryan Cole | 1 Mar 09:09
Favicon

Re: [Newbie] High-performance plotting of large datasets

Hi,

I'm an ex-LabView user, now using python for lab data-acquisition and
analysis for some years now. It's well worth the switch.

Your best bet is
http://pyqwt.sourceforge.net/

You're right, matplotlib/chaco are too slow for "interactive real-time"
type work. The strengths of these packages are their
presentation-quality output (vector and anti-aliased bitmap graphics).

For data-acquisition applications, I prefer wxPython  to Qt (I may move
to something based on Traits/ETS once I figure out how to install it).
For GUIs I have a home-made plotting widget which is fast enough for
real-time work. Unfortunately, I'm not yet in a position to post it
publicly. If you need *really* high performance, it's not too hard to
write a plot-widget using PyOpenGL directly.

Bryan

On Thu, 2008-02-28 at 09:57 +0100, scipy-user <at> onnodb.com wrote:
> Hi all,
> 
> Using LabVIEW software for our data analysis at the moment, I'm
> currently looking for alternatives. Especially since LabVIEW's
> "graphical" programming language is somewhat cumbersome for some of
> the things we're doing --- an iterative language would often be much
> easier. (Actually, I personally don't like the graphical way of
> programming at all :) )
(Continue reading)

dmitrey | 1 Mar 09:17
Favicon

Re: minpack.error / fsolve problem

As for me it yields "name LcUtil is not defined" (line 48). Also, there 
was some indent problems near try-except block, mb due to space-tab 
different numbers from the attached file.
Webb Sprague wrote:
> I am having a problem with convergence (I think) for an optimization.
>
> Every so often I do a non-linear fit of a parameter using fsolve (as
> input a constant vector of base death rates, a constant vector
> multiplier of those, and a variable scalar multiplier -- the last is
> what I am trying to fit) and I get a "minpack.error" with the message
> that "Error occured while calling the Python function named f"  with
> no other information. The information normally returned from fsolve
> (ier, message,  infodict) are all set to none.
>   
I would recommend you try using another solver, for example nssolve from 
scikits.openopt.

> I am kind of at a loss for how to proceed, at least without taking a
> class on optimization algorithms.  How do I get more information from
> fsolve?  Is there a better optimization function to use?
> optimize.golden()?  Or ... ?
>   
Do you know exactly what do you need? Solve a system of non-linear 
equations via fsolve or to minimize a function?
D.
Stef Mientki | 1 Mar 11:12
Picon
Favicon
Gravatar

Re: [Newbie] High-performance plotting of large datasets

hi Bryan,

unfortunately you're not able to post your code,
(btw why not ?)
but maybe you can answer a few questions ....

Bryan Cole wrote:
> Hi,
>
> I'm an ex-LabView user, now using python for lab data-acquisition and
> analysis for some years now. It's well worth the switch.
>
>   
I'm too a former MatLab / LabView user,
and I'm quit happy with Python / Scipy / wxPython for now.
At the moment I'm trying to write an open source LabView equivalent,
first results can be seen here:

http://oase.uci.kun.nl/~mientki/data_www/pylab_works/pw_animations_screenshots.html
> Your best bet is
> http://pyqwt.sourceforge.net/
>
>
> You're right, matplotlib/chaco are too slow for "interactive real-time"
> type work. The strengths of these packages are their
> presentation-quality output (vector and anti-aliased bitmap graphics).
>
> For data-acquisition applications, I prefer wxPython  to Qt (I may move
> to something based on Traits/ETS once I figure out how to install it).
> For GUIs I have a home-made plotting widget which is fast enough for
(Continue reading)

Joseph Anderson | 1 Mar 16:12
Picon

Newbie help for installing pysamplerate

Hello All,

Most likely this is really just a question for David Cournapeau. . . 

Am having a bit of trouble apparently resulting from being a python newbie.

I have numpy, scipy, and pyaudiolab up and going, but am having trouble getting pysamplerate to happen. In
attempting to install pysamplerate, I have run pysamplerate's setup.py in a python interpreter,
choosing task [2], the install option. That does the following:

samplerate_info:
  libraries samplerate not found in /Library/Frameworks/Python.framework/Versions/2.5/lib
  FOUND:
    libraries = ['samplerate']
    library_dirs = ['/usr/local/lib']
    fulllibloc = /usr/local/lib/libsamplerate.so.0
    fullheadloc = /usr/local/include/samplerate.h
    include_dirs = ['/usr/local/include']

running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_py
copying pysamplerate.py -> build/lib/pysamplerate
running install_lib
creating /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pysamplerate
copying build/lib/pysamplerate/__init__.py -> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pysamplerate
(Continue reading)

Alan G Isaac | 1 Mar 17:00
Picon
Favicon
Gravatar

Re: [Newbie] High-performance plotting of large datasets

On Sat, 01 Mar 2008, Stef Mientki apparently wrote:
> I'm too a former MatLab / LabView user, 
> and I'm quit happy with Python / Scipy / wxPython for now. 
> At the moment I'm trying to write an open source LabView equivalent, 
> first results can be seen here:
> http://oase.uci.kun.nl/~mientki/data_www/pylab_works/pw_animations_screenshots.html 

Looks promising.
Please post updates as the project moves along.

Thank you,
Alan Isaac
Webb Sprague | 1 Mar 18:52
Picon

Re: minpack.error / fsolve problem

Thanks for the response, dmitrey!

On Sat, Mar 1, 2008 at 12:17 AM, dmitrey <dmitrey.kroshko <at> scipy.org> wrote:
> As for me it yields "name LcUtil is not defined" (line 48). Also, there
>  was some indent problems near try-except block, mb due to space-tab
>  different numbers from the attached file.

Sorry but there is a lot of infrastructure you don't have, so it won't
run as is.  Plus it was cut and paste, etc.  But it works 98% of the
time in its context.

>  I would recommend you try using another solver, for example nssolve from
>  scikits.openopt.

Sounds reasonable, but why that one?

>  Do you know exactly what do you need? Solve a system of non-linear
>  equations via fsolve or to minimize a function?
>  D.

I need to fit a scalar (kt in the code) such  that f(kt) = e_0 (a
scalar which is given from somewhere else).  f() involves a bunch of
stuff (see the code, but don't bother trying to run it), but it is
monotonic.

I think of this as finding kt such that f(kt) - e_0 = 0, so I used a
root solver.  But I hardly care so long as it works

Is there a best function for this?

(Continue reading)


Gmane