Monday 27 June 2016

Two stage fitting, 6 decimal accuracy and the power of the Jacobian

Hi, so the past few days have been busy with testing the code and writing a basic example for the module so far. You can check out the Ipython notebook to get a better idea of how to use the module.

We implemented a two-stage fitting for the data which is the method followed in both the papers we have referred in this project (Le Bihan and Federau). The basic idea is that the bi-exponential function of the IVIM model can be approximated to a single exponential as the b values go higher. In particular we already have a dti tensor fitting model in dipy which has been used to approximate the values of the parameter D for bvalues greater than 200. We also approximate the value of the perfusion fraction f by calculating the intercept from the exponential decay signal and then using the IVIM function to get our f_guess as (1 - S_intercept/S(b=0)).

This week saw the frustrating problem of getting test cases to pass for the optimize function from scipy. Unless, "good" parameters were selected to generate the data the tests were not passing upto 6 decimal places. However, leastsq always seemed to perform better and generate parameters matching upto 6 decimals. This could either be due to the difference in how leastsq and optimize arrive at the minimization. Leastsq uses the Levenberg-Marquardt algorithm as implemented in MINPACK while optimize gives the option of selecting from a variety of constrained and unbounded minimization algorithms such as L-BFGS, Truncated Newtons (TNC).

We are in favour of using minimize since it gives the flexibility to select bounds and specify fitting algorithms. After playing around with the values of parameters for generating our test signal, the tests passed.

The next step is to implement a Jacobian for faster fitting. A math gist with the Jacobian worked out can be seen here : http://mathb.in/64905?key=774f1d2b7c71358b4cf6dd0e6e4f5de3a5b5fbe3

No comments:

Post a Comment