# Mean squared displacement

In statistical mechanics, the mean squared displacement (MSD, also mean square displacement, average squared displacement, or mean square fluctuation) is a measure of the deviation of the position of a particle with respect to a reference position over time. It is the most common measure of the spatial extent of random motion, and can be thought of as measuring the portion of the system "explored" by the random walker. In the realm of biophysics and environmental engineering, the Mean Squared Displacement is measured over time to determine if a particle is spreading slowly due to diffusion, or if an advective force is also contributing. Another relevant concept, the variance-related diameter (VRD, which is twice the square root of MSD), is also used in studying the transportation and mixing phenomena in the realm of environmental engineering. It prominently appears in the Debye–Waller factor (describing vibrations within the solid state) and in the Langevin equation (describing diffusion of a Brownian particle).
The MSD at time $t$ is defined as an ensemble average:
${\text{MSD}}\equiv \left\langle \left|\mathbf {x} (t)-\mathbf {x_{0}} \right|^{2}\right\rangle ={\frac {1}{N}}\sum _{i=1}^{N}\left|\mathbf {x^{(i)}} (t)-\mathbf {x^{(i)}} (0)\right|^{2}$
where N is the number of particles to be averaged, vector $\mathbf {x^{(i)}} (0)=\mathbf {x_{0}^{(i)}}$ is the reference position of the $i$-th particle, and vector $\mathbf {x^{(i)}} (t)$ is the position of the $i$-th particle at time t.

## Derivation of the MSD for a Brownian particle in 1D

The probability density function (PDF) for a particle in one dimension is found by solving the one-dimensional diffusion equation. (This equation states that the position probability density diffuses out over time - this is the method used by Einstein to describe a Brownian particle. Another method to describe the motion of a Brownian particle was described by Langevin, now known for its namesake as the Langevin equation.) ${\frac {\partial p(x,t\mid x_{0})}{\partial t}}=D{\frac {\partial ^{2}p(x,t\mid x_{0})}{\partial x^{2}}},$ given the initial condition $p(x,t=0\mid x_{0})=\delta (x-x_{0})$; where $x(t)$ is the position of the particle at some given time, $x_{0}$ is the tagged particle's initial position, and $D$ is the diffusion constant with the S.I. units $m^{2}s^{-1}$ (an indirect measure of the particle's speed). The bar in the argument of the instantaneous probability refers to the conditional probability. The diffusion equation states that the speed at which the probability for finding the particle at $x(t)$ is position dependent.
The differential equation above takes the form of 1D heat equation. The one-dimensional PDF below is the Green's function of heat equation (also known as Heat kernel in mathematics): $P(x,t)={\frac {1}{\sqrt {4\pi Dt}}}\exp \left(-{\frac {(x-x_{0})^{2}}{4Dt}}\right).$ This states that the probability of finding the particle at $x(t)$ is Gaussian, and the width of the Gaussian is time dependent. More specifically the full width at half maximum (FWHM)(technically/pedantically, this is actually the Full duration at half maximum as the independent variable is time) scales like ${\text{FWHM}}\sim {\sqrt {t}}.$ Using the PDF one is able to derive the average of a given function, $L$, at time $t$: $\langle L(t)\rangle \equiv \int _{-\infty }^{\infty }L(x,t)P(x,t)\,dx,$ where the average is taken over all space (or any applicable variable).
The Mean squared displacement is defined as ${\text{MSD}}\equiv \left\langle \left(x(t)-x_{0}\right)^{2}\right\rangle ,$ expanding out the ensemble average $\left\langle \left(x-x_{0}\right)^{2}\right\rangle =\left\langle x^{2}\right\rangle +x_{0}^{2}-2x_{0}\langle x\rangle ,$ dropping the explicit time dependence notation for clarity. To find the MSD, one can take one of two paths: one can explicitly calculate $\langle x^{2}\rangle$ and $\langle x\rangle$, then plug the result back into the definition of the MSD; or one could find the moment-generating function, an extremely useful, and general function when dealing with probability densities. The moment-generating function describes the $k$-th moment of the PDF. The first moment of the displacement PDF shown above is simply the mean: $\langle x\rangle$. The second moment is given as $\langle x^{2}\rangle$.
So then, to find the moment-generating function it is convenient to introduce the characteristic function: $G(k)=\langle e^{ikx}\rangle \equiv \int _{I}e^{ikx}P(x,t\mid x_{0})\,dx,$ one can expand out the exponential in the above equation to give $G(k)=\sum _{m=0}^{\infty }{\frac {(ik)^{m}}{m!}}\mu _{m}.$ By taking the natural log of the characteristic function, a new function is produced, the cumulant generating function, $\ln(G(k))=\sum _{m=1}^{\infty }{\frac {(ik)^{m}}{m!}}\kappa _{m},$ where $\kappa _{m}$ is the $m$-th cumulant of $x$. The first two cumulants are related to the first two moments, $\mu$, via $\kappa _{1}=\mu _{1};$ and $\kappa _{2}=\mu _{2}-\mu _{1}^{2},$ where the second cumulant is the so-called variance, $\sigma ^{2}$. With these definitions accounted for one can investigate the moments of the Brownian particle PDF, $G(k)={\frac {1}{\sqrt {4\pi Dt}}}\int _{I}\exp \left(ikx-{\frac {\left(x-x_{0}\right)^{2}}{4Dt}}\right)\,dx;$ by completing the square and knowing the total area under a Gaussian one arrives at $G(k)=\exp(ikx_{0}-k^{2}Dt).$ Taking the natural log, and comparing powers of $ik$ to the cumulant generating function, the first cumulant is $\kappa _{1}=x_{0},$ which is as expected, namely that the mean position is the Gaussian centre. The second cumulant is $\kappa _{2}=2Dt,\,$ the factor 2 comes from the factorial factor in the denominator of the cumulant generating function. From this, the second moment is calculated, $\mu _{2}=\kappa _{2}+\mu _{1}^{2}=2Dt+x_{0}^{2}.$ Plugging the results for the first and second moments back, one finds the MSD, $\left\langle \left(x(t)-x_{0}\right)^{2}\right\rangle =2Dt.$

## Derivation for n dimensions

For a Brownian particle in higher-dimension Euclidean space, its position is represented by a vector $\mathbf {x} =(x_{1},x_{2},\ldots ,x_{n})$, where the Cartesian coordinates $x_{1},x_{2},\ldots ,x_{n}$ are statistically independent.
The n-variable probability distribution function is the product of the fundamental solutions in each variable; i.e.,
$P(\mathbf {x} ,t)=P(x_{1},t)P(x_{2},t)\dots P(x_{n},t)={\frac {1}{\sqrt {(4\pi Dt)^{n}}}}\exp \left(-{\frac {\mathbf {x} \cdot \mathbf {x} }{4Dt}}\right).$
The Mean squared displacement is defined as
$\mathrm {MSD} \equiv \left\langle |\mathbf {x} -\mathbf {x_{0}} |^{2}\right\rangle =\left\langle \left(x_{1}(t)-x_{1}(0)\right)^{2}+\left(x_{2}(t)-x_{2}(0)\right)^{2}+\dots +\left(x_{n}(t)-x_{n}(0)\right)^{2}\right\rangle$
Since all the coordinates are independent, their deviation from the reference position is also independent. Therefore,
${\text{MSD}}=\left\langle \left(x_{1}(t)-x_{1}(0)\right)^{2}\right\rangle +\left\langle \left(x_{2}(t)-x_{2}(0)\right)^{2}\right\rangle +\dots +\left\langle \left(x_{n}(t)-x_{n}(0)\right)^{2}\right\rangle$
For each coordinate, following the same derivation as in 1D scenario above, one obtains the MSD in that dimension as $2Dt$. Hence, the final result of mean squared displacement in n-dimensional Brownian motion is:
${\text{MSD}}=2nDt.$

## Definition of MSD for time lags

In the measurements of single particle tracking (SPT), displacements can be defined for different time intervals between positions (also called time lags or lag times). SPT yields the trajectory ${\vec {r}}(t)=[x(t),y(t)]$, representing a particle undergoing two-dimensional diffusion.
Assuming that the trajectory of a single particle measured at time points $1\,\Delta t,2\,\Delta t,\ldots ,N\,\Delta t$, where $\Delta t$ is any fixed number, then there are $N(N-1)/2$ non-trivial forward displacements ${\vec {d}}_{ij}={\vec {r}}_{j}-{\vec {r}}_{i}$ ($1\leqslant i<j\leqslant N$, the cases when $i=j$ are not considered) which correspond to time intervals (or time lags) $\,\Delta t_{ij}=(j-i)\,\Delta t$. Hence, there are many distinct displacements for small time lags, and very few for large time lags, ${\rm {MSD}}$ can be defined as an average quantity over time lags:
${\overline {\delta ^{2}(n)}}={\frac {1}{N-n}}\sum _{i=1}^{N-n}{({\vec {r}}_{i+n}-{\vec {r}}_{i}})^{2}\qquad n=1,\ldots ,N-1.$
Similarly, for continuous time series :
${\overline {\delta ^{2}(\Delta )}}={\frac {1}{T-\Delta }}\int _{0}^{T-\Delta }[r(t+\Delta )-r(t)]^{2}\,dt$
It's clear that choosing large $T$ and $\Delta \ll T$ can improve statistical performance. This technique allow us estimate the behavior of the whole ensembles by just measuring a single trajectory, but note that it's only valid for the systems with ergodicity, like classical Brownian motion (BM), fractional Brownian motion (fBM), and continuous-time random walk (CTRW) with limited distribution of waiting times, in these cases, ${\overline {\delta ^{2}(\Delta )}}=\left\langle [r(t)-r(0)]^{2}\right\rangle$ (defined above), here $\left\langle \cdot \right\rangle$ denotes ensembles average. However, for non-ergodic systems, like the CTRW with unlimited waiting time, waiting time can go to infinity at some time, in this case, ${\overline {\delta ^{2}(\Delta )}}$ strongly depends on $T$, ${\overline {\delta ^{2}(\Delta )}}$ and $\left\langle [r(t)-r(0)]^{2}\right\rangle$ don't equal each other anymore, in order to get better asymptotics, introduce the averaged time MSD:
$\left\langle {\overline {\delta ^{2}(\Delta )}}\right\rangle ={\frac {1}{N}}\sum {\overline {\delta ^{2}(\Delta )}}$
Here $\left\langle \cdot \right\rangle$ denotes averaging over N ensembles.
Also, one can easily derive the autocorrelation function from the MSD:
$\left\langle {[r(t)-r(0)]^{2}}\right\rangle =\left\langle r^{2}(t)\right\rangle +\left\langle r^{2}(0)\right\rangle -2\left\langle r(t)r(0)\right\rangle ,$where $\left\langle r(t)r(0)\right\rangle$ is so-called autocorrelation function for position of particles.

## MSD in experiments

Experimental methods to determine MSDs include neutron scattering and photon correlation spectroscopy.
The linear relationship between the MSD and time t allows for graphical methods to determine the diffusivity constant D. This is especially useful for rough calculations of the diffusivity in environmental systems. In some atmospheric dispersion models, the relationship between MSD and time t is not linear. Instead, a series of power laws empirically representing the variation of the square root of MSD versus downwind distance are commonly used in studying the dispersion phenomenon.