How much trial and error is involved in fitting to a curve?

Discussion in 'Trading' started by 76132, Jul 21, 2012.

  1. 76132

    76132

    I'm new to math, Matlab, stats, etc...

    Anyways, I'm trying to fit some data points to a curve, and the equation Matlab spits out is quite inaccurate even though Rsquared is 0.97. Tweaking the degrees of the polynomial doesn't help and from looking at the points, a degree higher than 2 isn't representative of the data. The equation I have is so inaccurate that I don't trust it at all.

    So, now I'm stuck and don't know what the next step is, except trial and error, i.e. adding and subtracting terms from the equation until I get a regression that I trust more.

    Is this the right way to go about it? What are some obvious next steps?

    I've thought about breaking the data points into different groups and finding a regression for each group, then linking the group of equations together. Is this wrong?
     
  2. Maybe try to recreate the model in a different program to see what the equation is there, for comparison. If it's the same, maybe you're just not understanding why the equation is what it is.
     
  3. 76132

    76132

    Well I have a pretty good understanding of the relationships between the variables by just watching the tape. And that's why I determined the equation Matlab gave me is inaccurate, because it doesn't agree with what I've observed. I can't think of any missing variables although a missing variable is a possibility.

    I guess I'll try to learn R and see what that will give me. Thanks.
     
  4. What do you mean by "inaccurate"? With an R2 that high, it is extremely accurate, by defnition.

    Are you using "accurate" and "I trust it" as synonyms?
     
  5. Why not just use Excel...
    Which has had full stats capabilities since Excel 2000...
    And you can easily automate, say, Excel 2007...
    With any .NET language.

    Or buy a stats control.

    What you are doing is trivial... 5 min in Excel.

    I've looked at R...
    And it looks like something from a university ivory tower....
    Looks great in my Recycle Bin.
     
  6. You can look into stepwise regression.