peter websdell | 1 Oct 10:59

Re: unusual fitting problem

Hello,

Thanks for the reply Pierre.

I may be misunderstanding you, but it seems to me that if I interpolate between two values, the relationship will be linear. What I need is for it to appear linear when plotted on a loglog scale. 

I'm sure I'm not explaining this very well, owing to this not really being my field, so I've attached an image of the kind of curve I'm attempting to fit.

Please let me know if I'm just being a dunce.

Thanks again,
Pete. 

2008/9/30 Pierre GM <pgmdevlist <at> gmail.com>
On Tuesday 30 September 2008 12:36:00 peter websdell wrote:
> Howdy gang,
> I have an unusual fitting problem that has me totally stumped.

Have you thought about modifying your data ?
you want log(y) = a + b*log(x) ?
Use Y=log(y) and X=log(X), fit a straight-line the standard way and you should
get your parameters a & b.
That should be easier than trying to fit y=exp(a+b*log(x)) = exp(a) * x**b

_______________________________________________
SciPy-user mailing list
SciPy-user <at> scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user

_______________________________________________
SciPy-user mailing list
SciPy-user <at> scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user
massimo sandal | 1 Oct 11:28
Picon
Favicon

Re: unusual fitting problem

peter websdell wrote:
> Hello,
> 
> Thanks for the reply Pierre.
> 
> I may be misunderstanding you, but it seems to me that if I interpolate 
> between two values, the relationship will be linear. What I need is for 
> it to appear linear when plotted on a loglog scale. 

If I understand correctly: The relationship will be linear, but between 
the *logarithms*.

By using Y=log(y) and X=log(x) mathematically it's just having log/log 
paper. You are just linearizing the equations.

m.
-- 
Massimo Sandal , Ph.D.
University of Bologna
Department of Biochemistry "G.Moruzzi"

snail mail:
Via Irnerio 48, 40126 Bologna, Italy

email:
massimo.sandal <at> unibo.it

web:
http://www.biocfarm.unibo.it/samori/people/sandal.html

tel: +39-051-2094388
fax: +39-051-2094387
Attachment (massimo_sandal.vcf): text/x-vcard, 274 bytes
_______________________________________________
SciPy-user mailing list
SciPy-user <at> scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user
peter websdell | 1 Oct 11:36

Re: unusual fitting problem

Yes! Of course. Apologies for the stupid question.

Cheers,
Pete.

2008/10/1 massimo sandal <massimo.sandal <at> unibo.it>
peter websdell wrote:
Hello,

Thanks for the reply Pierre.

I may be misunderstanding you, but it seems to me that if I interpolate between two values, the relationship will be linear. What I need is for it to appear linear when plotted on a loglog scale.

If I understand correctly: The relationship will be linear, but between the *logarithms*.

By using Y=log(y) and X=log(x) mathematically it's just having log/log paper. You are just linearizing the equations.

m.
--
Massimo Sandal , Ph.D.
University of Bologna
Department of Biochemistry "G.Moruzzi"

snail mail:
Via Irnerio 48, 40126 Bologna, Italy

email:
massimo.sandal <at> unibo.it

web:
http://www.biocfarm.unibo.it/samori/people/sandal.html

tel: +39-051-2094388
fax: +39-051-2094387

_______________________________________________
SciPy-user mailing list
SciPy-user <at> scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user


_______________________________________________
SciPy-user mailing list
SciPy-user <at> scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user
Picon
Picon
Favicon

Re: sparse matrices -- slicing and fancy indexing for assignment

2008/9/30 Nathan Bell <wnbell <at> gmail.com>:
> This is probably all you'll see in 0.7.0
>
> Note that assigning to a CSR/CSC matrix is in general a bad idea.  Any
> change to the sparsity structure of these formats requires O(nnz)
> operations, which basically means reconstructing the matrix from
> scratch.
>
> OTOH MATLAB lets you do it, so we will probably support it someday
> too.  If you submit a patch soon we might be able to integrate it by
> 0.7.0.

I was about to document this, but Nathan has already done the job:

http://projects.scipy.org/scipy/scipy/browser/trunk/scipy/sparse/info.py

Regards
Stéfan
James Philbin | 1 Oct 14:59
Picon

r4763 won't compile, missing lsodar.pyf

Hi,

"python setup.py build"
errors with:
"target build/src.linux-x86_64-2.5/lsodarmodule.c does not exist:
   Assuming lsodarmodule.c was generated with "build_src --inplace" command."

And indeed, scipy/integrate/setup.py has:
"config.add_extension('lsodar',
                         sources=['lsodar.pyf'],
                         libraries=libs,
                         **newblas)"

But scipy/integrate doesn't contain lsodar.pyf?

Thanks,
James
Robin | 1 Oct 15:50
Picon

broadcasting elementwise on sparse matrix

Hi,

Is there any way to get broadcasted element wise operations on sparse matrices?

I would like to do something like A * x if A was (n,n) array and x was
a (n,) array. I saw the sparse matrices have a .multiply method, but
it doesn't seem to broadcast in the same way as the standard
multiplication, ie As.multiply(x) gives an "inconsistent shapes"
error.

The best I have is As.multiply(tile(x,(n,1))) although this has the memory
overhead that is normally avoided with broadcasting. Is there an alternative?

Thanks

Robin
Travis Vaught | 1 Oct 16:36

Texas Python Regional Unconference Reminders

Greetings,

The Texas Python Regional Unconference is coming up this weekend  
(October 4-5) and I wanted to send out some more details of the  
meeting.  The web page for the meeting is here:

http://www.scipy.org/TXUncon2008

The meeting is _absolutely free_, so please add yourself to the  
Attendees page if you're able to make it.  Also, if you're planning to  
attend, please send me the following information (to
travis@... 
) so I can request wireless access for you during the meeting:

  - Full Name
  - Phone or email
  - Address
  - Affiliation

There are still opportunities to present your pet projects at the  
meeting, so feel free to sign up on the presentation schedule here:

http://www.scipy.org/TXUncon2008Schedule

For those who are in town Friday evening, we're planning to get  
together for a casual dinner in downtown Austin that night.  We'll  
meet at Enthought offices (http://www.enthought.com/contact/map-directions.php 
) and walk to a casual restaurant nearby.  Show up as early as 5:30pm  
and you can hang out and tour the Enthought offices--we'll head out to  
eat at 7:00pm sharp.

Best,

Travis
Picon
Picon
Favicon

Re: broadcasting elementwise on sparse matrix

Hi Robin

2008/10/1 Robin <robince <at> gmail.com>:
> Is there any way to get broadcasted element wise operations on sparse matrices?
>
> I would like to do something like A * x if A was (n,n) array and x was
> a (n,) array. I saw the sparse matrices have a .multiply method, but
> it doesn't seem to broadcast in the same way as the standard
> multiplication, ie As.multiply(x) gives an "inconsistent shapes"
> error.
>
> The best I have is As.multiply(tile(x,(n,1))) although this has the memory
> overhead that is normally avoided with broadcasting. Is there an alternative?

You can broadcast over the indices, and then use them to individually
address the elements of the sparse matrix.  Not super-fast, but better
than nothing:

In [4]: a, b = np.broadcast_arrays([1,2,3], [[1,2,3], [4,5,6]])

In [5]: a
Out[5]:
array([[1, 2, 3],
       [1, 2, 3]])

In [6]: b
Out[6]:
array([[1, 2, 3],
       [4, 5, 6]])

Cheers
Stéfan
Nathan Bell | 1 Oct 17:52
Picon
Gravatar

Re: broadcasting elementwise on sparse matrix

On Wed, Oct 1, 2008 at 9:50 AM, Robin <robince <at> gmail.com> wrote:
>
> Is there any way to get broadcasted element wise operations on sparse matrices?
>
> I would like to do something like A * x if A was (n,n) array and x was
> a (n,) array. I saw the sparse matrices have a .multiply method, but
> it doesn't seem to broadcast in the same way as the standard
> multiplication, ie As.multiply(x) gives an "inconsistent shapes"
> error.
>
> The best I have is As.multiply(tile(x,(n,1))) although this has the memory
> overhead that is normally avoided with broadcasting. Is there an alternative?
>

That particular operation is just scaling of the columns, right?  If
so, you can use:
>>> As * spdiags([x],[0], n,n,)

If As is already a CSR matrix, then you can cheat a little and do the
operation in place:
>>> As.data *= x[As.indices]

--

-- 
Nathan Bell wnbell <at> gmail.com
http://graphics.cs.uiuc.edu/~wnbell/
Robin | 1 Oct 18:11
Picon

Re: broadcasting elementwise on sparse matrix

On Wed, Oct 1, 2008 at 4:52 PM, Nathan Bell <wnbell <at> gmail.com> wrote:
> On Wed, Oct 1, 2008 at 9:50 AM, Robin <robince <at> gmail.com> wrote:
> That particular operation is just scaling of the columns, right?  If
> so, you can use:
>>>> As * spdiags([x],[0], n,n,)

Yes - I realised that and was using spdiags, which is a lot quicker.

> If As is already a CSR matrix, then you can cheat a little and do the
> operation in place:
>>>> As.data *= x[As.indices]

That's quite tricky... :)
It is a CSC matrix - not sure why, but I am saving and loading it from
Matlab files, and when I first started (a year or so again) it seemed
CSC was the most reliable (or at least I always got a CSC from .mat
files).
Presumably the same thing the same thing will work though.

Thanks very much,

Robin

Gmane