# Gmx msd - error estimation of the diffusivity

**URL:** <https://gromacs.bioexcel.eu/t/gmx-msd-error-estimation-of-the-diffusivity/1060>\
**Category:** User discussions\
**Created:** [November 9, 2020, 12:33pm UTC](https://gromacs.bioexcel.eu/t/gmx-msd-error-estimation-of-the-diffusivity/1060 "2020-11-09T12:33:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tfjermestad](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@tfjermestad](https://gromacs.bioexcel.eu/u/tfjermestad)\
**Post date:** [November 9, 2020, 12:33pm UTC](https://gromacs.bioexcel.eu/t/gmx-msd-error-estimation-of-the-diffusivity/1060/1 "2020-11-09T12:33:51Z")

</div>

GROMACS version: 2020.3  
GROMACS modification: No

According to the manual [http://manual.gromacs.org/documentation/current/onlinehelp/gmx-msd.html#gmx-msd](http://manual.gromacs.org/documentation/current/onlinehelp/gmx-msd.html#gmx-msd), the diffusion constant is computed through a linear regression of MSD versus lag time. To verify that I had understood it correctly, I did the linear regression using both gnuplot and statsmodels (python package), and I got the same value as printed by gmx msd.

My question concerns the error estimation. In the description of the gmx msd command it says:

> An error estimate given, which is the difference of the diffusion coefficients obtained from fits over the two halves of the fit interval.

Why is this a better error estimate than using the standard error of the regression coefficient?

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [November 17, 2020, 7:57am UTC](https://gromacs.bioexcel.eu/t/gmx-msd-error-estimation-of-the-diffusivity/1060/2 "2020-11-17T07:57:22Z")

</div>

I don’t know what you mean with the standard error of the regression coefficient. If there is only one fit, there is nothing to compute a standard error for.  
We use the two halves, because in unconverged cases the MSD might not be linear, so then the slope might change as a function of lag time and it is good to take that into account.
