## Abstract

Bayesian inference is a conscientious statistical method which is successfully used in many branches of physics and engineering. Compared to conventional approaches, it makes highly efficient use of information hidden in a measured quantity by predicting the distribution of future data points based on posterior information. Here we apply this method to determine the stress-relaxation time and the solvent and polymer contributions to the frequency dependent viscosity of a viscoelastic Jeffrey’s fluid by the analysis of the measured trajectory of an optically trapped Brownian particle. When comparing the results to those obtained from the auto-correlation function, mean-squared displacement or the power spectrum, we find Bayesian inference to be much more accurate and less affected by systematic errors.

## Introduction

Several fluctuation dominated physical phenomena, like, Brownian motion in various fluids, radioactive decay of sub-atomic particles, current fluctuations in resistors, etc^{1,2}, are modeled by stochastic processes. To obtain the relevant parameters characterizing such processes, typically one analyzes a time series of a measured quantity. Examples are the measurement of resistance from the time series of current fluctuations or the inference of rheological parameters (viscosity, time constant) of a fluid from the trajectories of Brownian particles. When analyzing such data, often one only makes partial use of the information provided by the data, e.g., the correlation function, power spectral density in the context of Brownian motion, to an equation which is assumed to describe the underlying process, mainly using least-squares fitting routines. Often such technique delicately depends on the range of the data used for the comparison, and therefore the estimated results are rather unreliable. Bayesian inference with proper likelihood function added to the prior knowledge about the parameters can provide reliable and efficient measurements of the probable values of the parameters with the related uncertainties, for a given set of data. This method has been proved more detailed, advanced and reliable compared to least-squares fittings or the frequentist approaches^{3,4,5,6}. Also, it makes an optimal use of the whole sample path and therefore does not require further guidance for the measurements^{5,6}. Note that also model-free methods exist which allow to extract relevant microrheological parameters^{7}. Often, however, specific models such as the Jeffrey’s model are used because they are based on simple and general mechanical concepts^{8,9,10,11,12,13,14,15}.

Recently, Bayesian probability theory has been used for microrheological measurements, in viscous fluids and it has been shown that such methods are less affected by systematic noise present in the data^{4,16}. However, to the best of our knowledge, so far, this theory has not been applied to viscoelastic fluids. Because most fluids and systems relevant in context of technical and biological entities are viscoelastic^{17,18,19,20}, there exists a strong interest in the scientific community to efficiently measure the rheological properties of such fluids. In contrast to purely viscous fluids, viscoelastic fluids combine viscous and elastic properties which are often quantified by the imaginary and the real parts of the complex shear modulus \(G^{*}(\omega )\) respectively^{21,22,23}. In case of passive microrheology, \(G^{*}(\omega )\) is calculated by Fourier transforming the mean-squared displacement (MSD) of a micro probe particle and using the Stokes-Einstein relation^{22,23}. However, in case of limited data Fourier transformations are not trivial since interpolation and extrapolation from data points can easily yield far-reaching artifacts^{22}.

Several models have been developed to describe viscoelastic fluids^{21,22,23,24,25,26}, e.g., the Maxwell model , the Jeffrey’s model or the generalized Maxwell model^{10,21,27,28}. Among these, Jeffrey’s model is extensively and successfully employed for understanding a wide class of experimental details^{8,9,10,29,30,31}. Contrary to viscous fluids, the motion of a particle in a viscoelastic fluid exhibits memory effects, i.e., it is a non-Markovian process^{23,24}. Nevertheless, Markovianity can be regained at the cost of additional degrees of freedom describing a multivariate Ornstein-Uhlenbeck process^{32,33}. For such stationary, Gaussian and Markovian processes, the likelihood function which corresponds to discretely observed sample paths can be exactly calculated in terms of the process parameters. Using the Bayes’ theorem, the probable parameter values concealed in given discrete observations can be obtained with the corresponding probabilities^{33,34}. Such a Bayesian theory based time domain method is thorough, accurate and avoids limitations such as non-trivial Fourier transformations, data range dependent uncertainty observed in the measurement from the auto-correlation function (ACF), power spectral density (PSD), mean-squared displacement function (MSD) etc.

Here, we demonstrate a Bayesian inference based technique to evaluate the rheological properties of a Jeffrey’s fluid from the partial observation of the position fluctuation of an optically trapped Brownian particle. We calculate the likelihood function related to the probe’s trajectory and estimate the most probable parameter values and their standard errors by numerically maximizing the likelihood with respect to the parameters. Further, we compare our method with the measurements from the position ACF and show that the estimations obtained from the proposed method are more reliable compared to the regular measurements from the ACF. Note that PSD and MSD are directly linked to the ACF, and hence for comparison, the analysis of only one among these is sufficient. We also show numerically and experimentally that both the methods lead to the same estimations for a given time series provided a least-squares fitting is conducted carefully over a certain data range. Furthermore, we also investigate how the length of the time series and the sampling time step affects the accuracy of the rheological parameters, similar to recent work^{35} where authors quantitatively determine the efficacy of their method.

Finally, we compare our results with macroscopic rheological measurements for various viscoelastic fluids and obtain good agreements.

## Theory

We describe the one dimensional Brownian motion of a microscopic particle of mass *m* confined in a harmonic potential of stiffness *k* in a homogeneous and isotropic viscoelastic medium by using the generalized Langevin equation (GLE)^{24,32,34}:

where *x*(*t*) is the position of the particle at time *t*, \(\Gamma (t-t')\) is the friction kernel and \(\eta (t)\) is the stochastic noise which represents the thermal agitations of the fluid molecules. Within the Jeffrey’s fluid model (generalized Maxwell model with single relaxation time), the memory kernel takes the form^{9,24,32,36}

and to satisfy the *fluctuation-dissipation theorem* (FDT) (and hence causality), the noise correlation function \(\left<\eta (t)\eta (t')\right>=k_{B}T\Gamma (t-t')\); \(k_{B}\) is the Boltzmann constant and *T* is the absolute temperature^{32}. The first term in the expression of Eq. (2) is due to the purely viscous solvent and the second term corresponds to the polymer network present in the fluid. The noise \(\eta (t)\) can be represented as \(\eta (t)=\eta _{0}(t)+\eta _{1}(t)\), where \(\eta _{0}(t)\) and \(\eta _{1}(t)\) are two independent Gaussian random processes with mean zero and correlations \(\left<\eta _{0}(t)\eta _{0}(t')\right>=2k_{B}T\gamma _{0}\delta (t-t')\) and \(\left<\eta _{1}(t)\eta _{1}(t')\right>=k_{B}T\frac{\gamma _{1}}{\tau _{1}}\exp \left( -\frac{|t-t'|}{\tau _{1}}\right)\), respectively. Note that the dynamics of the particle at time *t* depends on its history and thus the process is non-Markovian. At time scales, where inertia is negligible (overdamped limit), Eq. (1) can be written as^{32,37}

In order to model the system as Markovian, we introduce an auxiliary variable

we can write

where \(\phi _{0}\) and \(\phi _{1}\) are two independent delta-correlated Gaussian random variables with mean zero and standard deviation one. If we consider,

and

\(D_{0}=\sqrt{\frac{2k_{B}T}{\gamma _{0}}}\), \(D_{1}=\sqrt{\frac{2k_{B}T}{\gamma _{1}}}\), then Eq. (5) becomes a multivariate Ornstein-Uhlenbeck process^{33} and the transition probability density of the state \({\varvec{Y}}=\begin{bmatrix}x\\ X\end{bmatrix}\), i.e., the probability density \(P_{1|1}(\varvec{Y'},t'|{\varvec{Y}},t)\) of a transition from \({\varvec{Y}}\) at time *t* to \(\varvec{Y'}\) at time \(t'\), follows a Fokker–Planck equation (FP) \(\partial _{t}P_{1|1}={\mathscr {L}}P_{1|1}\), with the Fokker–Planck operator

The solution of the FP is a multivariate normal distribution with mean \(\varvec{\mu }(\Delta t)=\exp {(\varvec{-\lambda }\Delta t)}{\varvec{Y}}\) and covariance \(\varvec{\Sigma }(\Delta t)=\varvec{\sigma } -[\exp {(\varvec{-\lambda }\Delta t)}\varvec{\sigma }\exp {(\varvec{-\lambda } ^{T}\Delta t)}]\); \(\Delta t=|t'-t|\). In the limit of \(\Delta t \rightarrow \infty\) one obtains the stationary probability distribution \(P_{1}({\varvec{Y}})\) which clearly has a zero mean and covariance \(\varvec{\sigma }=\left<{\varvec{Y}}{\varvec{Y}}^{T}\right>\). \(\varvec{\lambda }\), \(\varvec{\sigma }\) and \({\varvec{D}}\) are related by the stationary condition \({\mathscr {L}}P_{1}({\varvec{Y}})={\varvec{0}}\), which results into \(\varvec{\lambda }\varvec{\sigma }+(\varvec{\lambda }\varvec{\sigma })^{T}={\varvec{D}}{\varvec{D}}^{T}\)^{33}. A straight
forward calculation yields^{32}

The auto-regressive (AR) representation of the process, thus, can be written as^{34}

where \(\varvec{\epsilon }_{n}\) is a zero mean Gaussian random vector with co-variance \(\varvec{\Sigma }(\Delta t)\).

## Bayesian inference I

If we consider the observations of the time series with *N* sample points \({\varvec{Y}}\equiv (\varvec{Y_{0}},\varvec{Y_{1}},\varvec{Y_{2}},...,\varvec{Y_{N}})\) being independently selected from the stationary distribution \(P_{1}({\varvec{Y}})\), then according to the Bayes’ theorem if \(\varvec{\Theta }\) is a set of unknown parameters, the conditional probability of the parameters given the observations, \(P_{1}(\varvec{\Theta |Y})\) (posterior probability) is proportional to the product of the conditional probability of the observations given the parameters, \(P_{1}(\varvec{Y|\varvec{\Theta }})\) (likelihood function) and the prior probability of the parameters \(P(\varvec{\Theta })\)^{16,33,38}, i.e.,

Therefore, for a non-informative prior probability, \(\ln P_{1}(\varvec{\Theta |Y}) \propto \ln P_{1}(\varvec{Y|\Theta })\). Straightforwardly using the Gaussian nature of the stationary probability described above^{16,33},

The maximum *a posteriori* probability (MAP) estimation is obtained by optimizing \(\ln P_{1}(\varvec{\Theta |Y})\) with respect to \(\varvec{\Theta }\). The corresponding standard error is obtained from the square root of the inverse of the Hessian matrix, \({\varvec{H}}=-\varvec{\nabla }\varvec{\nabla }\ln P_{1}(\varvec{\Theta |Y})\). Here, if the parameter \(\Theta\) is \(\varvec{\sigma }\) then the MAP estimation is

Clearly, from Eqns. (7) and (11) we conclude

with the corresponding standard error \(\frac{k^{*}}{\sqrt{N}}\).

However, this method can not provide all rheological parameters involved in the process.

## Bayesian inference II

Because of the Markovian property of our process, the conditional probability of the whole sample path given a set of unknown parameters \(\varvec{\Theta }\) is^{16,33,38}

and similar to Bayesian inference I, the log posterior probability (\(\ln P(\varvec{\Theta }|{\varvec{Y}})\)) for non-informative prior information is proportional to the log likelihood function (\(\ln P({\varvec{Y}}|\varvec{\Theta })\)). Nevertheless, the MAP estimation by the optimization of \(\ln P(\varvec{\Theta }|{\varvec{Y}})\) depend both on the particle’s position *x* and the auxiliary variable *X*^{33}. Therefore, we need an appropriate likelihood function which can be calculated only using the partial observation of the process, i.e., the trajectory of the particle \({\varvec{x}}\equiv (x_{0}, x_{1},...,x_{N})\).

### Likelihood function

We can use the Kalman filter method^{34,39,40} to calculate the likelihood function from the partial observation of the process \({\varvec{Y}}\). For the *n*-th step, one can write

where \(C=\begin{bmatrix}c&\,&0\end{bmatrix}\); *c* is the calibration factor related to the experimental time-series which can be set to unity if the data is already in desired units. Using the AR structure (Eq. 8) and the partial observation of the process, the Kalman filter algorithm iteratively approaches to the likelihood \(P(x_{1},...,x_{N}|x_{0},\varvec{\Theta })\) for a certain set of the unknown parameters \(\varvec{\Theta }\). The log-likelihood function has the form^{34}

where \({\hat{x}}_{n|n-1}\) and \(\Omega _{n|n-1}\) are the conditional mean and variance of \(x_{n}\) given \(x_{1}, x_{2},...,x_{n-1}\) and \(\Theta\). Further, as discussed above, the optimization of the log-likelihood function with respect to the parameters (we are interested in the set of parameters \(\varvec{\Theta }=(k, \eta _{0}, \eta _{1}, \tau _{1})\)) can yield the MAP estimations for the parameters. The corresponding standard error can be calculated using the Hessian matrix. For convenience, we use the Bayesian I to infer the MAP estimation of the trap stiffness, i.e., \(k^{*}\) (Eq. 12) and further optimize the log-likelihood function (Eq. 14) for \(\varvec{\Theta }=(\eta _{0}, \eta _{1}, \tau _{1})\). Because of a large amount of literature discussing the Kalman filter^{34,39,40}, we describe it briefly in our context.

### Kalman filter

The Kalman filter algorithm for a linear system generally takes an observation model which linearly depends on the state of the system. Here, the state variable follows the linear transition equation

where \({\varvec{F}}=\exp {(-\varvec{\lambda }\Delta t)}\) and \(\varvec{\epsilon }_{n}\sim {\mathscr {N}}({\varvec{0}},\varvec{\Sigma }(\Delta t))\); the observable \(x_{n}\) depends linearly on the state variable as in Eq. (13). Further, it brilliantly utilizes the Bayes’ theorem to recursively approach the likelihood function \(P(x_{1},...,x_{N}|x_{0},\varvec{\Theta })\). According to Bayes’ theorem, the probability of \({\varvec{Y}}_{n}\) given the observation \(x_{n}\), the previous state \({\varvec{Y}}_{n-1}\) and the parameter set \(\varvec{\Theta }\) is

where \(P(x_{n}|{\varvec{Y}}_{n},{\varvec{Y}}_{n-1},\varvec{\Theta })\) (*n*-th iteration for the likelihood function) is the probability of the observation \(x_{n}\) given \({\varvec{Y}}_{n}\) , \({\varvec{Y}}_{n-1}\) and \(\varvec{\Theta }\); and \(P({\varvec{Y}}_{n}|{\varvec{Y}}_{n-1},\Theta )\) (*n*-th iteration of the prior) is the transition probability of the state \({\varvec{Y}}_{n-1}\) to \({\varvec{Y}}_{n}\) in the sampling time step \(\Delta t\), given the parameter set \(\varvec{\Theta }\), which is a normal distribution as discussed in the previous section. Optimization of \(P({\varvec{Y}}_{n}|x_{n},{\varvec{Y}}_{n-1},\varvec{\Theta })\) should infer the expected *n*-th step of the state given the observation \(x_{n}\) and parameters \(\varvec{\Theta }\), i.e.,

and the corresponding covariance, i.e.,

Straightforwardly, we can update the prior probability distribution function to another normal distribution of mean \(\hat{{\varvec{Y}}}_{n+1|n}={\varvec{F}}\hat{{\varvec{Y}}}_{n|n}\) and covariance \(\varvec{\omega }_{n+1|n}={\varvec{F}}\varvec{\omega }_{n|n}{\varvec{F}}^{T}+\varvec{\Sigma }\). The updated likelihood probability distribution function, i.e., the probability of \(x_{n+1}\) given the previous observations (\(x_{n}\), \(x_{n-1}\), \(x_{n-2}\),...\(x_{0}\)) and \(\varvec{\Theta }\), evidently, is a normal distribution of mean \({\hat{x}}_{n+1|n}=C\hat{{\varvec{Y}}}_{n+1|n}\) and variance \(\Omega _{n+1|n}=C\varvec{\omega }_{n+1|n}C^{T}\).

Therefore, the implemented Kalman filter algorithm is the following:

To initiate the iterations, we choose \(\hat{{\varvec{Y}}}_{1|0}=\begin{bmatrix}0&\,&0\end{bmatrix}^{T}\) and \(\varvec{\omega }_{1|0}=\varvec{\Sigma }(\Delta t)\); where \(\varvec{\Sigma }(\Delta t)={\varvec{D}}^{*}{\varvec{D}}^{*T}\Delta t\). Through the above described iterations we finally obtain the probability of the observation sample path

Therefore, to implement this method one should use the iterations Eqns. (17) to calculate the log-likelihood function Eq. (14) and optimize with respect to the desired set of parameters.

## Numerical analysis and comparison

We numerically solve Eq. (5) with input parameters \(\tau _{1}^{in}=1\) s, \(\eta _{0}^{in}=0.001\) Pa s, \(\eta _{1}^{in}=0.1\) Pa s, \(k^{in}=0.1\times 10^{-6}\) N/m and analyze the simulated data to study the accuracy of the method in comparison to the fitting methods. Note that the smallest time scale of the process \(\tau _{S}=1/\left( \frac{k}{\gamma _{0}} + \frac{\gamma _{1}}{\gamma _{0}\tau _{1}}\right)\) and the largest is \(\tau _{1}\). The input parameters are chosen so that they are experimentally feasible and \(\tau _{S}\) becomes 0.01 s for convenience. In Fig. 1a–d, we show the estimations of the parameters for several sampling time steps (normalized by \(\tau _{S}\)) with varying total sampling time (\(T_{s}\)) normalized by \(\tau _{1}^{in}\). We estimate the trap stiffness using the Bayesian I method and use that in Bayesian II to evaluate other parameters. Note that for \(\Delta t/\tau _{S}\le 1\), the MAP estimations of the parameters reach their true values with \(\sim 1\%\) standard deviation when the normalized sampling time \(T_{s}/\tau _{1}\) crosses \(\sim 500\). Further increase in \(T_{s}/\tau _{1}\), indeed, improves the precision of the result. However, if \(\Delta t/\tau _{S}>1\), i.e, if the sampling time step is lower than the smallest time scale of the process, \(T_{s}/\tau _{1}\) should be greater than \(\sim 2000\) for reliable estimations.

### Auto-correlation function

The position auto-correlation function (ACF) of a Brownian harmonic oscillator in a viscoelastic Jeffrey’s fluid, as described in the theory section, is given by^{24,32}

where \(a=\frac{2k_{B}T}{\gamma _{0}\tau _{1}^{2}}(1+\frac{\eta _{1}}{\eta _{0}})\), \(b=\frac{2k_{B}T}{\gamma _{0}}\), \(\omega _{0}=\frac{k}{\tau _{1}\gamma _{0}}\), \(c=\frac{k}{\gamma _{0}}+\frac{1}{\tau _{1}}(1+\frac{\eta _{1}}{\eta _{0}})\), \(\nu =\sqrt{c^{2}-4\omega _{0}}\). Ideally, the measured ACF from the position time series converges to the functional form (Eq. 19) in the limit \(T_{s}\rightarrow \infty\). However, in practice, we can assume that the calculated ACF for each time lag (\(t_{i}\)) is Gaussian distributed around the trend \(f(t_{i})\) (Eq. 19) with variance *S*, and all the measured ACF data for different time lags are independent of each other. Thus, the corresponding likelihood function is

where \({\mathscr {N}}(f_{i}(\varvec{\Theta }),S)\) represents a normal distribution with mean \(f_{i}\) and variance *S* for the i-th time lag, i.e., \(t_{i}\); \(N_{acf}\) is the total number of ACF data points. Optimization of the logarithm of \(L_{acf}\) with respect to \(\varvec{\Theta }\) provides the estimation of \(\varvec{\Theta }\) with the corresponding standard deviation. Note that the least-squares fitting method also works on the same assumption and approaches to same results^{38}. However, we observe that such fitting predominantly depends on the range of the data considered. In Tab. 1, we show the estimated parameters with one standard deviation by fitting the ACF measured from a simulated data of total sampling time \(T_{s}/\tau _{1}=2000\) and sampling time step \(\Delta t/\tau _{S}=0.1\) with the same parameters as described above as input parameters. We vary the fitting range from time lag \(0-0.1\) upto \(0-30\) and show that the estimated results are closest to the input parameters for fitting rang 0–0.5 to 0–1. Note that in this range the standard errors corresponding to all the parameters are also the smallest.

To better understand the discrepancies in the obtained parameter values for different fitting ranges, we plot the ACF with the corresponding best fit (where the standard deviations are least) and residue in Fig. 2a (from simulated data of \(T_{s}/\tau _{1}=2000\) and \(\Delta t/\tau _{S}=0.1\)) and Fig. 2b (from simulated data of \(T_{s}/\tau _{1}=10000\) and \(\Delta t/\tau _{S}=0.1\)). Vividly, the central assumptions of the method, i.e., Gaussian distribution around the trend and the constant variance of the residue (*S*) are not valid over the whole range of time lag. After a certain time lag the variance of the residue increases exceedingly. The best fitting range increases with the increase in the total sampling time. Therefore, to make this process consistent, further processing of the data, such as careful binning is required^{41}. Note that binning may lose information hidden in short times. If the sampling time step is much smaller compared to the smallest time scale \(\tau _{S}\) of the system then the binning can improve the fitting significantly. The parameter values obtained from the best fitting of the ACF are very close to those calculated using the Bayesian method developed in this paper (as shown in Fig. 1b–d).

## Experiment

As viscoelastic fluids, we use an aqueous solution of polyacrylamide (Polysciences, PAAM, \(M_{w}=18\times 10^6\) gm \(mol^{-1}\)) at different concentrations. Note that the concentrations of the PAAM strongly dictates the viscoelastic parameters of the solution^{25,42}. A very small volume fraction (\(\sim 0.01\)) of spherical polystyrene particles (radius \(1.95 \mu\)m) are added to the PAAM-water solution as probes. For sample making, we seal the suspension between two glass slides with a spacing of 100 \(\mu\)m. We kept this sample cell in contact with a thermal bath kept at \(25^\circ\)C. We trap one of the spherical probe particles in the sample fluid far away from any glass surface (to avoid wall effects) using an optical tweezers built by tightly focused a Gaussian infra red (IR, \(\lambda =1064\) nm) laser beam with a high numerical aperture (\(N.A.=1.3\)) oil immersion microscope objective. We use a CMOS camera to record videos for the thermal position fluctuation of the probe particle at a frequency of 500 Hz. The position of the particle are tracked from the videos using MATLAB by standard particle tracking algorithm. For optimization of the log-likelihood function, we use an inbuilt MATLAB optimization tool. In Fig. 3a, we show a schematic of the setup, and Fig. 3b–c represent a typical position time series of the probe particle and the corresponding probability distribution respectively.

## Data and analysis

For all measurements in this work, we maintain the trapping laser power fixed which results in trap stiffness \(k=(1-1.6)~\mu\)N/m. Note that, the PAAM concentration may slightly change the refractive index of the fluid, which can bring a small modification to the trap stiffness. The trap stiffness is kept relatively lower to avoid any potential coupling of the trap with the fluid^{43}. To experimentally check the dependency of the Bayesian method on the data length and the sampling time step, we analyze data for sampling times ranging from 100 to 4000 s and sampling time steps \(\Delta t=0.002\) s and 0.02 s. We show representative data (\(0.06~\%\) w/w PAAM-water) in Fig. 4a–d for the estimations of \(\eta _{1}\,\tau _{1},\,\eta _{0}\) and *k* respectively. Clearly, after \(T_{s}=200\) s, the estimations are saturating for both the values of \(\Delta t\). However, the precision and accuracy of the measurements are higher for \(\Delta t=0.002\) s. The standard error of the estimations, as expected, decreases with increasing \(T_{s}\). Interestingly, the best fittings of the auto-correlation functions evaluate approximately the same values as obtained from the Bayesian method, and exhibits similar behavior.

As expected, the experimental data also shows the same strong dependence of the ACF fitting method on the range of data used for the fitting, as observed for numerically obtained ACFs. This verifies our theoretical understandings about the fitting method as described in the theory section. In Fig. 5d, we show the residue (inset) of the best fitting which clarifies that the assumption of the Gaussian distribution around the trend and the constant variance is only valid over the initial range of time lags.

In order to verify the estimated results obtained from the Bayesian method, we perform the experiments with various (0.02–0.08% w/w) PAAM-water solutions and compare with the parameters obtained from the bulk rheology using a commercial rheometer (DHR-2-TA Instruments). We fit the frequency dependent viscosity measured using the rheometer with the corresponding theoretical expression for Jeffrey’s fluid^{24} to estimate the parameters. We observe (Fig. 5a–c) a very good agreement for all the three methods (Bayesian, best fitting of the ACF and rheometer measurements). The \(\eta _{0}\) remains close to the viscosity of water at \(25^{\circ }\)C and approximately independent of the concentrations, however, \(\tau _{1}\) and \(\eta _{1}\) increases with the increase of the PAAM concentration. The similar trend is also observed previously in several works^{25,42}. The standard errors are calculated over several independent measurements.

## Conclusion

In conclusion, we present a Bayesian inference based technique to measure the rheological parameters of a Jeffrey’s fluid. We show that the estimations from the proposed technique are more reliable compared to that obtained from the auto-correlation function. The parameter estimations from the ACF depend very sensitively on the range over which the data is fitted. We define the best fitting when the standard deviations corresponding to the estimations are minimum. At the best fitting, the estimations from the fitting method and the proposed method are approximately same. Further, to verify our method, we compare our inferred parameter values for various viscoelastic fluids prepared by mixing PAAM into water in different concentrations, with that measured using a commercial rheometer and obtain a strong agreement. We also observe that for a reliable measurement, the data should have sampling time step comparable to the shortest time scale of the system and total sampling time larger than \(\sim 200\) times the time constant of the fluid. The established method is comparatively fast (as it does not need further processing of the data), advanced, more reliable, and less affected by systematic noises. It uses less inputs from the user than any other least-squares fitting methods as it efficiently utilizes the information hidden in the data. Even though the Jeffrey’s fluid model is a particular simple description of viscoelastic fluids, there exist many examples where such approach has been experimentally confirmed^{8,9,10,11,12,13,14,15}. It should be mentioned, however, that the concept of Bayesian inference can be also applied to more complex models involving more than a single stress relaxation time (even though the accuracy of the method generally becomes worse progressively with the introduction of additional parameters). The standard Bayesian model comparison techniques can be used to choose an appropriate model for a given data to avoid unnecessary generalization. Also, it can be extended for free Brownian probes and active Brownian particles.

## References

Van Kampen, N. G.

*Stochastic processes in physics and chemistry*Vol. 1 (Elsevier, New York, 1992).Chandrasekhar, S. Stochastic problems in physics and astronomy.

*Rev. Mod. Phys.***15**, 1 (1943).O’Hagan, A. Bayesian statistics: Principles and benefits.

*Frontis***3**, 31–45 (2004).Richly, M. U. et al. Calibrating optical tweezers with bayesian inference.

*Opt. Express***21**, 31578–31590 (2013).Jeffreys, H.

*The Theory of Probability*(OUP, Oxford, 1998).Zellner, A. Optimal information processing and bayes’s theorem.

*Am. Stat.***42**, 278–280 (1988).Tassieri, M.

*Microrheology with Optical Tweezers: Principles and Applications*(CRC Press, Boca Raton, 2016).Gomez-Solano, J. R. & Bechinger, C. Transient dynamics of a colloidal particle driven through a viscoelastic fluid.

*New J. Phys.***17**, 103032 (2015).Narinder, N., Bechinger, C. & Gomez-Solano, J. R. Memory-induced transition from a persistent random walk to circular motion for achiral microswimmers.

*Phys. Rev. Lett.***121**, 078003 (2018).Raikher, Y. L., Rusakov, V. V. & Perzynski, R. Brownian motion in a viscoelastic medium modelled by a jeffreys fluid.

*Soft Matter***9**, 10857–10865 (2013).Saad, S. & Natale, G. Diffusiophoresis of active colloids in viscoelastic media.

*Soft Matter***15**, 9909–9919 (2019).Vaippully, R., Ramanujan, V., Bajpai, S. & Roy, B. Measurement of viscoelastic properties of the cellular cytoplasm using optically trapped brownian probes.

*J. Phys. Condensed Matter***32**, 235101 (2020).Berner, J., Müller, B., Gomez-Solano, J. R., Krüger, M. & Bechinger, C. Oscillating modes of driven colloids in overdamped systems.

*Nat. Commun.***9**, 1–8 (2018).Lozano, C., Gomez-Solano, J. R. & Bechinger, C. Active particles sense micromechanical properties of glasses.

*Nat. Mater.***18**, 1118–1123 (2019).Muñoz, J. J. & Albo, S. Physiology-based model of cell viscoelasticity.

*Phys. Rev. E***88**, 012708 (2013).Bera, S. et al. Fast bayesian inference of optical trap stiffness and particle diffusion.

*Sci. Rep.***7**, 1–10 (2017).Ferry, J. D.

*Viscoelastic Properties of Polymers*(Wiley, New York, 1980).Paul, S., Kumar, R. & Banerjee, A. A quantitative analysis of memory effects in the viscously coupled dynamics of optically trapped brownian particles.

*Soft Matter***15**, 8976–8981 (2019).Paul, S. et al. Direct verification of the fluctuation–dissipation relation in viscously coupled oscillators.

*Phys. Rev. E***96**, 050102 (2017).Paul, S., Kumar, R. & Banerjee, A. Two-point active microrheology in a viscous medium exploiting a motional resonance excited in dual-trap optical tweezers.

*Phys. Rev. E***97**, 042606 (2018).Doi, M., Edwards, S. F. & Edwards, S. F.

*The theory of polymer dynamics*, vol. 73 (Oxford University Press, Oxford, 1988).Tassieri, M. et al. Measuring storage and loss moduli using optical tweezers: Broadband microrheology.

*Phys. Rev. E***81**, 026308 (2010).Mason, T. G. & Weitz, D. A. Optical measurements of frequency-dependent linear viscoelastic moduli of complex fluids.

*Phys. Rev. Lett.***74**, 1250 (1995).Paul, S., Roy, B. & Banerjee, A. Free and confined brownian motion in viscoelastic stokes-oldroyd b fluids.

*. Phys. Condens. Matter***30**, 345101 (2018).Paul, S., Kundu, A. & Banerjee, A. Active microrheology to determine viscoelastic parameters of stokes-oldroyd b fluids using optical tweezers.

*J. Phys. Commun.***3**, 035002 (2019).Paul, S. Dynamics of hydrodynamically coupled brownian harmonic oscillators in a maxwell fluid.

*Eur. Phys. J. E***42**, 122 (2019).Grimm, M., Jeney, S. & Franosch, T. Brownian motion in a maxwell fluid.

*Soft Matter***7**, 2076–2084 (2011).Raikher, Y. L. & Rusakov, V. Theory of brownian motion in a jeffreys fluid.

*J. Exp. Theor. Phys.***111**, 883–889 (2010).Götze, W.

*Complex Dynamics of Glass-Forming Liquids: A Mode-Coupling Theory*, vol. 143 (OUP, Oxford, 2008).Boon, J. P. & Yip, S.

*Molecular Hydrodynamics*(Courier Corporation, New York, 1991).Wilhelm, C. & Gazeau, F. Magnetic nanoparticles: Internal probes and heaters within living cells.

*J. Magn. Magn. Mater.***321**, 671–674 (2009).Villamaina, D., Baldassarri, A., Puglisi, A. & Vulpiani, A. The fluctuation-dissipation relation: how does one compare correlation functions and responses?

*J. Stat. Mech. Theory Exp.***2009**, 07024 (2009).Singh, R., Ghosh, D. & Adhikari, R. Fast Bayesian inference of the multivariate ornstein-uhlenbeck process.

*Phys. Rev. E***98**, 012136 (2018).Fricks, J., Yao, L., Elston, T. C. & Forest, M. G. Time-domain methods for diffusive transport in soft matter.

*SIAM J. Appl. Math.***69**, 1277–1308 (2009).Tassieri, M., Ramírez, J., Karayiannis, N. C., Sukumaran, S. K. & Masubuchi, Y. i-rheo gt: Transforming from time to frequency domain without artifacts.

*Macromolecules***51**, 5055–5068 (2018).Narinder, N., Gomez-Solano, J. R. & Bechinger, C. Active particles in geometrically confined viscoelastic fluids.

*New J. Phys.***21**, 093058 (2019).Zamponi, F., Bonetto, F., Cugliandolo, L. F. & Kurchan, J. A fluctuation theorem for non-equilibrium relaxational systems driven by external forces.

*J. Stat. Mech. Theory Exp.***2005**, 09013 (2005).Sivia, D. & Skilling, J.

*Data Analysis: A Bayesian Tutorial Data Analysis: A Bayesian Tutorial*(OUP, Oxford, 2006).Brockwell, P. J., Davis, R. A. & Fienberg, S. E.

*Time Series: Theory and Methods: Theory and Methods*(Springer, New York, 1991).Harvey, A. C.

*Forecasting, Structural Time Series Models and the Kalman Filter*(Cambridge University Press, Cambridge, 1990).Berg-Sørensen, K. & Flyvbjerg, H. Power spectrum analysis for optical tweezers.

*Rev. Sci. Instrum.***75**, 594–612 (2004).Chandra, B., Shankar, V. & Das, D. Onset of transition in the flow of polymer solutions through microtubes.

*J. Fluid Mech***844**, 1052–1083 (2018).Müller, B., Berner, J., Bechinger, C. & Krüger, M. Properties of a nonlinear bath: Experiments, theory, and a stochastic prandtl-tomlinson model.

*New J. Phys.***22**, 023014 (2020).

## Acknowledgements

The authors want to acknowledge Dr. Subhajit Barman and group members for there fruitful discussions. Financial funding is received from SP by the Alexander von Humboldt foundation, in addition the project is supported by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - Project-ID 425217212 - SFB 1432.

## Funding

Open Access funding enabled and organized by Projekt DEAL.

## Author information

### Authors and Affiliations

### Contributions

C.B. conceived the experiment(s) and methodology, S.P. developed the theory and methodology, A.B., K.R.N. contributed the development of methodology. S.P., N.N. and J.S. conducted the experiment(s), S.P. and N.N. analysed the results. C.B., S.P., N.N., A.B., K.R.N. wrote the manuscript. All authors reviewed the manuscript.

### Corresponding author

## Ethics declarations

### Competing interests

The authors declare no competing interests.

## Additional information

### Publisher's note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

## About this article

### Cite this article

Paul, S., Narinder, N., Banerjee, A. *et al.* Bayesian inference of the viscoelastic properties of a Jeffrey’s fluid using optical tweezers.
*Sci Rep* **11**, 2023 (2021). https://doi.org/10.1038/s41598-021-81094-x

Received:

Accepted:

Published:

DOI: https://doi.org/10.1038/s41598-021-81094-x

## Comments

By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.