I have 2 columns of data in Excel. One is inputs the other is outputs. I ask Excel to make a graph of that data and to fit the data to a power trendline. Excel does this and it's fine as far as it goes but I'd like to get Mathematica to give me a similar equation for a line.
How do I do that?
If it helps the ordered pairs are:
{0.473, 1.1}, {0.4825, 1.15}, {0.492833333333333, 1.2}, {0.503666666666667, 1.25},
{0.513666666666667, 1.3}, {0.5245, 1.35}, {0.533, 1.4}, {0.543166666666667, 1.45}
Excel gives it as y=4.8549x^1.9788
NonlinearModelFit
in the documentation. $\endgroup$ – Szabolcs Feb 15 '14 at 0:13LinearModelFit[Log[data], {1, x}, x]
. This method gives the exact same result as Excel. (Note that this will minimize a different quantity as it's fitting transformed data!) Typically when people fit power laws, they have data over several orders of magnitude. Here this is not the case, so I suggestedNonlinearModelFit
. In fact it seems clear that your data conforms tox^2
, so you can consider fitting onlya x^2
instead. $\endgroup$ – Szabolcs Feb 16 '14 at 18:43