Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Re: Power Law with singularity' regression - error
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Alexei Boulbitch

Posts: 479
Registered: 2/28/08
Re: Power Law with singularity' regression - error
Posted: Mar 6, 2013 5:55 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

I am testing the "Power Law with finite-time singularity" hypothesis for the World population growth for a project.

For that I was trying the following model:

model = A + B*(c - x)^z;

And then the following curve fit method:

FindFit[data, {model}, {A, B, c, z}, x]

But I always get the result:

Power::indet: "Indeterminate expression 0.^0. encountered."
FindFit::nrjnum: "The Jacobian is not a matrix of real numbers at {A,B,c,z} = {1.,1.,1.,1.}. "
{A -> 1., B -> 1., c -> 1., z -> 1.}

If I do a normal Power law regression, FindFit works perfectly, but the title of the project being "Power Law with finite-time singularity" I need to have a singularity in the model and the main aim is to find when this singularity occurs.

Is there a way to use 'FindFit[]' to get the correct answer? Or Should I be using some other function?

I have seen other articles on this site concerning issues with FindFit, but none of them has helped me resolve this problem.

Thanks for the help!


Hi,

I am not a specialist in fitting of critical behaviour, however, I will try to tell, what I think takes place in your example. It seems (at least on the first glance) that your model has too many parameters, and you give it no hint (of what do you expect it to find). For example you may expect to have some your parameters close to certain values, say A close to 0 and z close to 1.3 and so on. Then the FindFit operator would look like

FindFit[data, {model}, {{A,0}, B, c, {z,1.3}}, x]

You know, of course, that this does not mean that you prescribe z to be 1.3, but rathe Mathematica starts searching with this figure. This may help. However, it also may not. You should give it a try. It is difficult to say more without your data. So I simulated such a data. Evaluate this:

data = Table[{x, RandomReal[{-1, 1}]}, {x, 0, 2, 0.03}] /. {x_,
y_} -> {x, (x - 1)^-2 + y};

ListPlot[data]

The FindFit still works badly, even if I feed it with the right initial conditions.

One may, however, look at the double logarithmic data, as we have done it before advent of PCs. The only trick here is that one needs to centre the data around the singularity point. Evaluate this

lstLeft = Select[lst, #[[1]] < 1 &] /. {x_, y_} -> {1 - x, y};
lstRight = Select[lst, #[[1]] > 1 &] /. {x_, y_} -> {x - 1, y};

ListLogLogPlot[{lstLeft, lstRight}]

The data now lie onto the reasonably straight line. By fitting this line one finds the critical exponent. In this case I knew the point of singularity x=1, which simplifies the life. If I would not know this, I would do it interactively. Evaluate this:

Manipulate[
lstLeft = Select[lst, #[[1]] < 1 &] /. {x_, y_} -> {a - x, y};
lstRight = Select[lst, #[[1]] > 1 &] /. {x_, y_} -> {x - a, y};
ListLogLogPlot[{lstLeft, lstRight}],
{a, 0, 2}]

and play with the slider. I hope it helps.

Have fun, Alexei

Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44

e-mail: alexei.boulbitch@iee.lu








Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.