Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

LinearModelFit vs. Fit with low precision/accuracy data

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99438] LinearModelFit vs. Fit with low precision/accuracy data
  • From: andreas.kohlmajer at gmx.de
  • Date: Tue, 5 May 2009 06:03:41 -0400 (EDT)

Hi all!

I have some difficulties to understand the difference between
LinearModelFit and Fit with my low precision/accuracy data. I have 3
different flow curves {flow [m=B3/h], back pressure [mbar]}:

data = {
   {{33.1, 0.19}, {37.5, 0.15}, {255.9, 4.79}, {390.8, 9.88}, {439.4,
     11.93}, {481, 13.77}, {558, 17.39}, {574.2, 18.15}, {601.3,
     19.5}, {665.4, 22.74}, {711.3, 25.26}, {726, 26.06}, {745,
     27.08}, {789.2, 29.39}, {798.4, 30.11}, {811.9, 30.7}, {825.8,
     31.74}, {847.6, 33.12}, {851.3, 33.34}},
   {{12.5, 0.06}, {37.5, 0.5}, {82, 1.18}, {100.8, 1.47}, {172.3,
     2.91}, {247.2, 5.11}, {257.8, 5.43}, {279.6, 6.13}, {353,
     8.73}, {433.5, 11.82}, {443.6, 11.82}, {545, 16.41}, {636.8,
     20.72}, {710.2, 24.03}, {814.6, 30.82}, {853.3, 32.95}, {924.6,
     38.44}},
   {{12.5, 0.05}, {17.7, 0.06}, {65, 1.08}, {115.9, 1.03}, {127.5,
     2.49}, {266.7, 4.85}, {282.1, 5.51}, {309.1, 6.2}, {369.2,
     8.52}, {373.8, 8.71}, {395.4, 9.49}, {418.1, 10.28}, {445.6,
     11.37}, {489.7, 13.15}, {494.9, 13.34}, {522, 14.25}, {539.4,
     15.25}, {606.5, 17.88}, {615.1, 18.65}, {677.5, 21.52}, {689,
     21.52}, {768.8, 26.41}, {838.1, 30.56}, {877.1, 33.07}, {943.7,
     37.58}}
   };

The data is quite inaccurate, so I specified two different accuracies
for flow (whole digit) and back pressure (1 decimal):

data[[All, All, 1]] = SetAccuracy[data[[All, All, 1]], 1];
data[[All, All, 2]] = SetAccuracy[data[[All, All, 2]], 2];

The model is a simple parabola:

model = {x, x^2};

The linear model fit is:

lm = LinearModelFit[#, model, x] & /@ data

The regular fit is:

ft = Fit[#, model, x] & /@ data

The linear model fit returns a low precision/accuracy constant,
whereas the regular fit returns a parabola fit with no valid digit for
any of the coefficients.

Of course, the data is too inaccurate to calculate a sufficient fit,
but why do I see this difference between LinearModelFit and Fit?


  • Prev by Date: Re: Some function like Position[] but uses criteria, not pattern?
  • Next by Date: Re: Introducing the Wolfram Mathematica Tutorial Collection
  • Previous by thread: Re: Some function like Position[] but uses criteria, not pattern?
  • Next by thread: Re: LinearModelFit vs. Fit with low precision/accuracy