This was perfect, if not the fact, that I like to investigate the sum of the squared residuals. If am am correctly, this value is not provided in the output of polyfit. However, the polynom coeffients are sorted nicely in a dataset.
This looks very nice, as one has access to basically every result value you can think of, BUT, here, the coefficients are sorted seperately in the result tree structure. As also given in the example one has to "pick" every coefficient, like:
// Get the coefficients from the output tree coef1[1] = polyOut.Parameters.Intercept.Value; coef1[2] = polyOut.Parameters.B1.Value; coef1[3] = polyOut.Parameters.B2.Value; coef1[4] = polyOut.Parameters.B3.Value;
I would prefer to use option 2, however, when I want to use varying polynom orders, I guess, that I somehow have to cope with this mentioned issue. Is there an easy way, like a magical function: GetCoeff(result_tree) ? Otherwise, I guess I will have to write a huge Switch-structure, switching through all possible orders or so...?