Post Reply 
Important Request
04-03-2017, 08:25 PM (This post was last modified: 04-03-2017 08:27 PM by Tim Wessman.)
Post: #12
RE: Important Request
The problem here is that you cannot compare "error" in all the models as there is not a mathematical way to do so except in the case of a *LINEAR* model. Every fit in the 50g is a linear fit. The options other then "linear" are just data that has some transformations to the data, but they are in reality simple linear fits. This makes comparing them trivial. Until someone can point out a unifying error algorithm that applies to all regressions equally, I don't think there is anything I can do here.

There is not an equivalent "error" value for polynomial fits (there is a value that is close, but not directly comparable to the linear "error"), logistic fits, or trigonometric fits. In addition, once you allow an Nth polynomial fit, your error by definition will not matter as simply adjusting to N+1 for your polynomial with perfectly match the data.

I am also completely unaware of *any* statistical package that offers an "auto-fit" for anything but simple, linear regressions, and even those are extremely rare.

The other major problem is that unless your data is very small, the logistic and sinusoidal fitting is VERY slow and consumes VERY large amounts of memory. This is because you have to do a lot of matrix calculations, inversions, and iterations to attempt to minimize errors. They are not "simple" calculations like the linear or polynomial fits and are very noticeable in calculation time when you have anything other then small data sets. If you attempt to run these on data that is not already a decent fit, you can see seconds of calculation time with poor results at the end. Running that constantly for each display would not be a very good UI experience.

Well then, why not just do the linear fits? That was a possibility. However, explaining "this is a best fit, but only for these and not those fits" doesn't really seem like a very understandable explanation and creates other problems in the workflow/ui. Nor is a "best fit" a feature that has been in high demand (in fact, you are the first person to bring it up). There is also a very strong argument that doing a "Best Fit" is in fact a bad practice that should NOT be encouraged or taught for several important reasons.

The great thing is that the Prime is programmable! You can very easily make your own "best fit" with a few simple commands.

Stick this in your app program:

Code:
VIEW "Best-Fit",BestFit()
BEGIN
LOCAL j,r,fit;

FOR j FROM 1 TO 6 DO
  S1(4):=j; //set fit type
  STARTVIEW(0,1); //load settings, redraw
  Do2VStats(); //recalculate
  
  IF CoefDet > r THEN
     r:=CoefDet; //found a better fit
     fit:=j; 
  END;
END;
MSGBOX("CoefDet:" + r + "\n" 
  + "Fit Selected:" + fit);
S1(4):=fit; //set our selected
STARTVIEW(1,1); //see the plot
END;

To run it, press your VIEW key on the app and you have a nice interface doing the best fit.

I am not against adding a "best fit" type of option, I just would want to do it correctly and right now I don't see any way to do that.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Important Request - math7 - 04-02-2017, 08:33 PM
RE: Important Request - Tim Wessman - 04-02-2017, 09:03 PM
RE: Important Request - math7 - 04-02-2017, 11:25 PM
RE: Important Request - Paul Dale - 04-02-2017, 11:32 PM
RE: Important Request - math7 - 04-03-2017, 04:16 AM
RE: Important Request - Joe Horn - 04-03-2017, 04:56 AM
RE: Important Request - mark4flies - 04-03-2017, 01:18 PM
RE: Important Request - Tim Wessman - 04-03-2017, 03:24 PM
RE: Important Request - math7 - 04-03-2017, 06:49 PM
RE: Important Request - johnet123 - 04-03-2017, 07:52 PM
RE: Important Request - Tim Wessman - 04-03-2017 08:25 PM
RE: Important Request - math7 - 04-03-2017, 11:30 PM
RE: Important Request - Tim Wessman - 04-04-2017, 03:31 AM
RE: Important Request - Han - 04-04-2017, 03:41 AM
RE: Important Request - math7 - 04-03-2017, 11:43 PM
RE: Important Request - math7 - 04-04-2017, 04:49 AM
RE: Important Request - Joe Horn - 04-04-2017, 05:48 AM
RE: Important Request - Tim Wessman - 04-04-2017, 05:12 PM
RE: Important Request - math7 - 04-05-2017, 04:46 AM
RE: Important Request - jte - 04-05-2017, 07:22 AM



User(s) browsing this thread: 1 Guest(s)