How to get goodness of fit in TAChart Fit Series? lazarus / 55-TAChart ---------------------------------------------------------------------- jwdietrich · 2015-07-27 10:38 Is there a field or property that delivers an estimate for the goodness of fit in TAChart's Fit Series? I well understand that R2 doesn't make sense for nonlinear regression; However, information like a p value or even Akaike's information criterion (AIC) would be useful. Alternatively, is this information provided by the ipfpol procedure from numlib? Unfortunately, FPC's numlib is nearly undocumented. (Note: This is a re-post of the question http://stackoverflow.com/questions/31616676/goodness-of-fit-in- tachart-fit-series at stackoverflow. I didn't get an answer there.) ---------------------------------------------------------------------- marcov · 2015-07-27 11:13 There is numlib documentation, and some examples. Problem is that both examples and documentation are older than the library files, and the documentation is Dutch. ---------------------------------------------------------------------- wp · 2015-07-27 12:11 No, TAChart does not calculate any goodness-of-fit parameters. But you can do this by yourself since the results of the fitting parameters are returned by the FitSeries (properties "ParamCount" and "Param[AIndex]"). You mention non-linear fits: They are not supported by TFitSeries at all. Therefore, if you have dedicated fitting tasks you should employ an external numerical library such as the excellent dmath (https://sourceforge.net/projects/dmath/). Sorry for not giving you an answer in your stackoverflow post. But I do not check this site regularly. Post all Lazarus-related questions here. ---------------------------------------------------------------------- wp · 2015-07-27 16:15 In r49571 I added calculation of R-squared as a simple goodness-of-fit parameter (--> new read-only property "GoodnessOfFit" of TFitSeries). See also the updated FitDemo in the demos folder. More advanced calculations would require knowledge of the standard errors of the data points. In case they are known the goodness-of-fit calculation can be performed by the event handler "OnCalcGoodnessOfFit" replacing the built-in R-squared calculation method. ---------------------------------------------------------------------- jwdietrich · 2015-08-09 17:47 Thanks for all your suggestions. I will check them and will report my experiences here.