Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

I asked a question in a previous post that was closed because "The title of the question is not correct and the issue here is too trivial to help anyone later".

http://mathematica.stackexchange.com/questions/19297/nonlinearmodelfithttps://mathematica.stackexchange.com/questions/19297/nonlinearmodelfit

It's possible because I'm not so smart in Mathematica. But in this period I've tried a lot of alternative solutions.

Recall my problem

 data={{220., 542.821}, {225., 531.898}, {230., 521.391}, {235., 
 510.596}, {240., 499.603}, {245., 488.585}, {250., 479.002}, {255., 
 468.574}}
 func= a0*Exp[a1 t + a2 t^2]
 nlm = NonlinearModelFit[data, func , {a0, a1, a2}, t]

which gives the result:

FittelModel = 0.

Some answers told me that it is not an exponential, but linear problem. But this problem is a physical problem that comes out from a lot of papers that describes this phenomenum as having exponential behavior. So also if my question was trivial, I've continued to solve it.

I read a lot of posts, and I tried this solution in Mathematica, using NMinimize and not NonLiNearModelFit.

f[a0_, a1_, a2_][t_] := a0*Exp[a1*t + a2*t^2 ];
error[a0_, a1_, a2_][x_, y_] := (f[a0, a1, a2]@x - y);
errorSum[a0_, a1_, a2_] = Total[(error[a0, a1, a2] @@@ data)];
bestFitVals = 
NMinimize[{errorSum[a0, a1, 
a2], {600 < a0 < 1500&& -0.01 < a1 < 0 && -0.0000001 < a2 < 0}}(*,
Thread[0<{a0,a1,a2}]*), {a0, a1, a2}, Method -> "SimulatedAnnealing"]
soln[x_] = f[a0, a1, a2]@x /. bestFitVals[[2]]
limits = Flatten@{x, Through[{Min, Max}@data[[All, 1]]]};
Show@{Plot[soln@x, Evaluate@limits, PlotRange -> All], 
ListPlot[data, PlotStyle -> Red]}

I tried all the methods available to NMinimize, changing starting values or removing them, but no choice works. So finally a collegue suggested that I try another software package: SigmaPlot. I said him that Mathematica is superior, but Sigmaplot gives me an exponential solution, with these coefficients

a0 = 1072.637060511283
a1 = -2.128998307513597e-3
a2 = -4.390602833555603e-6.

and with residuals that are very low.

I tried with another set of data, but the solution is the same: Mathematica is not be able to regress or minimize and Sigmaplot is able to.

I hope my question is not trivial, but I hope more that someone can solve my question: is Sigmaplot superior of Mathematica, or is it the case that I'm not applying Mathematica properly to my problem?

I asked a question in a previous post that was closed because "The title of the question is not correct and the issue here is too trivial to help anyone later".

http://mathematica.stackexchange.com/questions/19297/nonlinearmodelfit

It's possible because I'm not so smart in Mathematica. But in this period I've tried a lot of alternative solutions.

Recall my problem

 data={{220., 542.821}, {225., 531.898}, {230., 521.391}, {235., 
 510.596}, {240., 499.603}, {245., 488.585}, {250., 479.002}, {255., 
 468.574}}
 func= a0*Exp[a1 t + a2 t^2]
 nlm = NonlinearModelFit[data, func , {a0, a1, a2}, t]

which gives the result:

FittelModel = 0.

Some answers told me that it is not an exponential, but linear problem. But this problem is a physical problem that comes out from a lot of papers that describes this phenomenum as having exponential behavior. So also if my question was trivial, I've continued to solve it.

I read a lot of posts, and I tried this solution in Mathematica, using NMinimize and not NonLiNearModelFit.

f[a0_, a1_, a2_][t_] := a0*Exp[a1*t + a2*t^2 ];
error[a0_, a1_, a2_][x_, y_] := (f[a0, a1, a2]@x - y);
errorSum[a0_, a1_, a2_] = Total[(error[a0, a1, a2] @@@ data)];
bestFitVals = 
NMinimize[{errorSum[a0, a1, 
a2], {600 < a0 < 1500&& -0.01 < a1 < 0 && -0.0000001 < a2 < 0}}(*,
Thread[0<{a0,a1,a2}]*), {a0, a1, a2}, Method -> "SimulatedAnnealing"]
soln[x_] = f[a0, a1, a2]@x /. bestFitVals[[2]]
limits = Flatten@{x, Through[{Min, Max}@data[[All, 1]]]};
Show@{Plot[soln@x, Evaluate@limits, PlotRange -> All], 
ListPlot[data, PlotStyle -> Red]}

I tried all the methods available to NMinimize, changing starting values or removing them, but no choice works. So finally a collegue suggested that I try another software package: SigmaPlot. I said him that Mathematica is superior, but Sigmaplot gives me an exponential solution, with these coefficients

a0 = 1072.637060511283
a1 = -2.128998307513597e-3
a2 = -4.390602833555603e-6.

and with residuals that are very low.

I tried with another set of data, but the solution is the same: Mathematica is not be able to regress or minimize and Sigmaplot is able to.

I hope my question is not trivial, but I hope more that someone can solve my question: is Sigmaplot superior of Mathematica, or is it the case that I'm not applying Mathematica properly to my problem?

I asked a question in a previous post that was closed because "The title of the question is not correct and the issue here is too trivial to help anyone later".

https://mathematica.stackexchange.com/questions/19297/nonlinearmodelfit

It's possible because I'm not so smart in Mathematica. But in this period I've tried a lot of alternative solutions.

Recall my problem

 data={{220., 542.821}, {225., 531.898}, {230., 521.391}, {235., 
 510.596}, {240., 499.603}, {245., 488.585}, {250., 479.002}, {255., 
 468.574}}
 func= a0*Exp[a1 t + a2 t^2]
 nlm = NonlinearModelFit[data, func , {a0, a1, a2}, t]

which gives the result:

FittelModel = 0.

Some answers told me that it is not an exponential, but linear problem. But this problem is a physical problem that comes out from a lot of papers that describes this phenomenum as having exponential behavior. So also if my question was trivial, I've continued to solve it.

I read a lot of posts, and I tried this solution in Mathematica, using NMinimize and not NonLiNearModelFit.

f[a0_, a1_, a2_][t_] := a0*Exp[a1*t + a2*t^2 ];
error[a0_, a1_, a2_][x_, y_] := (f[a0, a1, a2]@x - y);
errorSum[a0_, a1_, a2_] = Total[(error[a0, a1, a2] @@@ data)];
bestFitVals = 
NMinimize[{errorSum[a0, a1, 
a2], {600 < a0 < 1500&& -0.01 < a1 < 0 && -0.0000001 < a2 < 0}}(*,
Thread[0<{a0,a1,a2}]*), {a0, a1, a2}, Method -> "SimulatedAnnealing"]
soln[x_] = f[a0, a1, a2]@x /. bestFitVals[[2]]
limits = Flatten@{x, Through[{Min, Max}@data[[All, 1]]]};
Show@{Plot[soln@x, Evaluate@limits, PlotRange -> All], 
ListPlot[data, PlotStyle -> Red]}

I tried all the methods available to NMinimize, changing starting values or removing them, but no choice works. So finally a collegue suggested that I try another software package: SigmaPlot. I said him that Mathematica is superior, but Sigmaplot gives me an exponential solution, with these coefficients

a0 = 1072.637060511283
a1 = -2.128998307513597e-3
a2 = -4.390602833555603e-6.

and with residuals that are very low.

I tried with another set of data, but the solution is the same: Mathematica is not be able to regress or minimize and Sigmaplot is able to.

I hope my question is not trivial, but I hope more that someone can solve my question: is Sigmaplot superior of Mathematica, or is it the case that I'm not applying Mathematica properly to my problem?

Tweeted twitter.com/#!/StackMma/status/306712324004253698
Made English clearer and more idiomatic.
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

http://mathematica.stackexchange.com/questions/19297/nonlinearmodelfit It's

It's possible because I'm not so smart in MathematicaMathematica. But But in this period I've tryedtried a lot of alternative solutions. I remember

Recall my problem:

Gives aswhich gives the result:

FittelModel=0FittelModel = 0.

Some answers told me that it is not an exponential, but linear problem. But this problem is a phisicalphysical problem that comes out from a lot of papers that describes this phenomenum as having exponential solutionbehavior. So also if my question was trivial, I've continued to solve it. I

I read a lot of posts, and I tryed withtried this solution in MathematicaMathematica, using NMinimizeNMinimize and not NonLiNearModelFitNonLiNearModelFit.

I tried all the Methods inside NMinimizemethods available to NMinimize, changing starting values or removing them, but no choice works. So So finally a collegue suggested me tothat I try another software package: SigmaPlot. I said him that MathematicaMathematica is superior, but...Sigmaplot Sigmaplot gives me an exponential solution, with thisthese coefficients and with residuals very low.

a0=1072a0 = 1072.637060511283
a1=a1 = -2.128998307513597e-3
a2=a2 = -4.390602833555603e-6.

and with residuals that are very low.

I tryedtried with some otheranother set of data, but the solution is the same: mathematicaMathematica is not be able to regress or Minimize,minimize and Sigmaplot is able to... I

I hope my question is not trivial, but I hope more that someone can solve my question: is Sigmaplot superior of MathematicaMathematica, or is it the case that I'm not be ableapplying Mathematica properly to use Mathematica? Thanks in advance and sorry for my english ;) M.problem?

http://mathematica.stackexchange.com/questions/19297/nonlinearmodelfit It's possible because I'm not so smart in Mathematica. But in this period I've tryed a lot of alternative solutions. I remember my problem:

Gives as result:

FittelModel=0.

Some answers told me that it is not an exponential, but linear problem. But this problem is a phisical problem that comes out from a lot of papers that describes this phenomenum as exponential solution. So also if my question was trivial, I've continued to solve it. I read a lot of posts, and I tryed with this solution in Mathematica, using NMinimize and not NonLiNearModelFit.

I tried all the Methods inside NMinimize, changing starting values or removing them, but no choice works. So finally a collegue suggested me to try another software: SigmaPlot. I said him that Mathematica is superior, but...Sigmaplot gives me an exponential solution, with this coefficients and with residuals very low.

a0=1072.637060511283
a1=-2.128998307513597e-3
a2=-4.390602833555603e-6.

I tryed with some other set of data, but the solution is the same: mathematica is not be able to regress or Minimize, and Sigmaplot is able to... I hope my question is not trivial, but I hope more that someone can solve my question: is Sigmaplot superior of Mathematica or I'm not be able to use Mathematica? Thanks in advance and sorry for my english ;) M.

http://mathematica.stackexchange.com/questions/19297/nonlinearmodelfit

It's possible because I'm not so smart in Mathematica. But in this period I've tried a lot of alternative solutions.

Recall my problem

which gives the result:

FittelModel = 0.

Some answers told me that it is not an exponential, but linear problem. But this problem is a physical problem that comes out from a lot of papers that describes this phenomenum as having exponential behavior. So also if my question was trivial, I've continued to solve it.

I read a lot of posts, and I tried this solution in Mathematica, using NMinimize and not NonLiNearModelFit.

I tried all the methods available to NMinimize, changing starting values or removing them, but no choice works. So finally a collegue suggested that I try another software package: SigmaPlot. I said him that Mathematica is superior, but Sigmaplot gives me an exponential solution, with these coefficients

a0 = 1072.637060511283
a1 = -2.128998307513597e-3
a2 = -4.390602833555603e-6.

and with residuals that are very low.

I tried with another set of data, but the solution is the same: Mathematica is not be able to regress or minimize and Sigmaplot is able to.

I hope my question is not trivial, but I hope more that someone can solve my question: is Sigmaplot superior of Mathematica, or is it the case that I'm not applying Mathematica properly to my problem?

Source Link
Mary
  • 639
  • 3
  • 10

Mathematica vs Sigmaplot (Non LinearModelFit)

I asked a question in a previous post that was closed because "The title of the question is not correct and the issue here is too trivial to help anyone later".

http://mathematica.stackexchange.com/questions/19297/nonlinearmodelfit It's possible because I'm not so smart in Mathematica. But in this period I've tryed a lot of alternative solutions. I remember my problem:

 data={{220., 542.821}, {225., 531.898}, {230., 521.391}, {235., 
 510.596}, {240., 499.603}, {245., 488.585}, {250., 479.002}, {255., 
 468.574}}
 func= a0*Exp[a1 t + a2 t^2]
 nlm = NonlinearModelFit[data, func , {a0, a1, a2}, t]

Gives as result:

FittelModel=0.

Some answers told me that it is not an exponential, but linear problem. But this problem is a phisical problem that comes out from a lot of papers that describes this phenomenum as exponential solution. So also if my question was trivial, I've continued to solve it. I read a lot of posts, and I tryed with this solution in Mathematica, using NMinimize and not NonLiNearModelFit.

f[a0_, a1_, a2_][t_] := a0*Exp[a1*t + a2*t^2 ];
error[a0_, a1_, a2_][x_, y_] := (f[a0, a1, a2]@x - y);
errorSum[a0_, a1_, a2_] = Total[(error[a0, a1, a2] @@@ data)];
bestFitVals = 
NMinimize[{errorSum[a0, a1, 
a2], {600 < a0 < 1500&& -0.01 < a1 < 0 && -0.0000001 < a2 < 0}}(*,
Thread[0<{a0,a1,a2}]*), {a0, a1, a2}, Method -> "SimulatedAnnealing"]
soln[x_] = f[a0, a1, a2]@x /. bestFitVals[[2]]
limits = Flatten@{x, Through[{Min, Max}@data[[All, 1]]]};
Show@{Plot[soln@x, Evaluate@limits, PlotRange -> All], 
ListPlot[data, PlotStyle -> Red]}

I tried all the Methods inside NMinimize, changing starting values or removing them, but no choice works. So finally a collegue suggested me to try another software: SigmaPlot. I said him that Mathematica is superior, but...Sigmaplot gives me an exponential solution, with this coefficients and with residuals very low.

a0=1072.637060511283
a1=-2.128998307513597e-3
a2=-4.390602833555603e-6.

I tryed with some other set of data, but the solution is the same: mathematica is not be able to regress or Minimize, and Sigmaplot is able to... I hope my question is not trivial, but I hope more that someone can solve my question: is Sigmaplot superior of Mathematica or I'm not be able to use Mathematica? Thanks in advance and sorry for my english ;) M.