[Date Index]
[Thread Index]
[Author Index]
Re: Power Law with singularity' regression - error
*To*: mathgroup at smc.vnet.net
*Subject*: [mg120047] Re: Power Law with singularity' regression - error
*From*: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
*Date*: Wed, 6 Mar 2013 05:57:12 -0500 (EST)
*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com
*Delivered-to*: l-mathgroup@wolfram.com
*Delivered-to*: mathgroup-newout@smc.vnet.net
*Delivered-to*: mathgroup-newsend@smc.vnet.net
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 at iee.lu
Prev by Date:
**Re: Will webMathematica work with Tomcat 7?**
Next by Date:
**Re: Issues with Rendering of Graphics[]**
Previous by thread:
**meaningful solution to the differential eqn**
Next by thread:
**Plot3D Axes Labels overlap plot axes and ticks?**
| |