Data2Dynamics / d2d

a modeling environment tailored to parameter estimation in dynamical systems
https://github.com/Data2Dynamics/d2d
57 stars 29 forks source link

Calculation of residuals outside of arSimuCalc.c #80

Closed clemenskreutz closed 7 years ago

clemenskreutz commented 7 years ago

READ FIRST: The following was already sent by email. I just put it here for documentation purpose.

Hey guys.

I just pushed the change decided in Oberstdorf, i.e. that residuals (data.res, sres, reserr, sreserr, chi2, chi2err) should be calculated outside of arSimuCalc. This also comprises evaluation of ar.config.fiterrors.

ar.config.fiterrors=0 now has the discussed new meaning. If exp. errors are available, the error model is overwritten. Fitting of error parameters is now exclusively controlled via ar.qFit.

For details see Meeting Notes and Discussions/20170104 D2D Development Team Meeting.docx

After discussion with Berni/Helge, I decided to NOT use a seperate brach. I heavily tested everything. If something is suspicious, please keep this change in mind!

I splitted everything into two distinct commits: 1) Only added arCalcRes.m and a function which can be used for testing. Here arSimuCalc.c is still the same as before. This means that residuals are calculated twice and it is easy to test the function. 2) I put residual calculations in arSimuCalc.c into comments. The old function is still available in Deprecated/arSimuCalc_2016.c

I hope, everything is ok for you!

Best, Clemens.

clemenskreutz commented 7 years ago

Up to now, there was no negative feedback. It seems to work.