I have a sequence of data:
data = {{20, 291}, {21, 440}, {22, 571}, {23, 830}, {24, 1287}, {25, 1975}, {26, 2744}, {27, 4515}, {28, 5974}, {29, 7711}};
The data is in the exponential form x1 Exp[x2 t] - x3
. For some reason, I would like to transform the data to the linear form log (CR(t) + x3)
first, and then transform it back to the exponential form. I would like to find the best value of x3
that can give me the best simulation. The ideal value for x3
should be around 1.1. Is there any way to do this in Mathematica?
logdata=Map[{#[[1]],Log[#[[2]]]}&,data]; sol=FindFit[logdata,m*x+b,{m,b},x]; ef=E^(m*x+b)/.sol; Show[ListPlot[data],Plot[ef,{x,20,29}]]
and see how close that is to what you want. If it isn't right then please explain what I've misunderstood and need to change. $\endgroup$sol = FindFit[logdata, m*x + b, {m, b}, x];
, it didn't work and gave me an error message saying that 0.2 is not a valid variable. I'm also confused about why 0.2 is showing up. $\endgroup$x=0.2
and will use that each time you enterx
again. And it does this for bigger expressions. You can tell Mathematica to forget by doingx=.;
or by restarting Mathematica or by looking up how to useClear
orClearAll
Different subject. The value forb
I found was not near 1.1. Is the value I found good? Or should the calculation be different to get closer to 1.1? Note in MathematicaLog
is "natural log" $\endgroup$