Stochastic processes in a confining harmonic potential in the presence of static and dynamic measurement noise

We consider the overdamped dynamics of different stochastic processes, including Brownian motion and autoregressive processes, continuous time random walks, fractional Brownian motion, and scaled Brownian motion, confined by an harmonic potential. We discuss the effect of both static and dynamic noise representing two kinds of localisation error prevalent in experimental single-particle tracking data. To characterise how such noise affects the dynamics of the pure, noise-free processes we investigate the ensemble-averaged and time-averaged mean squared displacements as well as the associated ergodicity breaking parameter. Process inference in the presence of noise is demonstrated to become more challenging, as typically the noise dominates the short-time behaviour of statistical measures, while the long time behaviour is dominated by the external confinement. In particular, we see that while static noise generally leads to a more subdiffusive apparent behaviour, dynamic noise makes the signal seem more superdiffusive. Our detailed study complements tools for analysing noisy time series and will be useful in data assimilation of stochastic data.


Introduction
Single-particle tracking recording the time series x(t) of the position of an individual particle in fact has a long history in the physical sciences. Starting with the observations of granules contained in pollen grains by Brown [1], systematic single-particle tracking was introduced by Perrin [2] in his groundbreaking experiments on Brownian motion of colloidal particles. Not much later Nordlund [3] greatly increased the amount of data points for a single particle trace, allowing to take time-averages of particle tracks. Today, with modern microscopic techniques [4] single particle tracking of labelled submicron-sized tracers or single molecules can be performed even in the complex environment of living biological cells. At the same time, the motion of individual molecules or their subunits can be resolved in supercomputing studies [5,6].
Stochastic motion [7] is observed in a wide variety of fields, ranging from the motion of charge carriers in solids over molecules in live biological cells or water aquifers to higher animals. The mathematical concept of stochastic dynamics in fact stretches further, to applications in disease spreading, financial markets, or population dynamics. However, while Brownian motion, e.g. the diffusion of a passive colloidal particle in a simple liquid is characterised by the linear time dependence ⟨x 2 (t)⟩ ∝ K 1 t of the mean squared displacement (MSD) with the diffusion coefficient K 1 , in a wide variety of systems deviations from this law are observed. Typically, for unconfined motion the MSD assumes the power-law form [5,6,[8][9][10][11][12][13] ⟨x 2 (t)⟩ = 2K α t α (1) where K α of physical dimension cm 2 /sec α is the generalised diffusion coefficient and α the anomalous diffusion exponent. Depending on the size of α one distinguishes subdiffusion (0 < α < 1) from superdiffusion (α > 1). Special cases are that of Brownian motion (α = 1) and ballistic, wave-like motion (α = 2).
Examples for anomalous diffusion include 'indirect' measurements such as the anomalous diffusion of electrical charge carriers in amorphous semiconductors, measured in terms of the electrical current [14,15], the spreading of substances in disordered systems visualised by concentration fields in magnetic resonance imaging [16,17], the dispersion of tracers in water aquifers quantified by 'breakthrough curves' (the concentration at a specific point in space as a function of time) [18][19][20], or the motion of molecules seen in fluorescent correlation spectroscopy based on the correlation function of the fluorescent signal [21,22]. 'Direct' measurements in terms of single-particle tracking or computational studies encode the full trajectory of a tracer particle and demonstrated anomalous diffusion of tracers, i.e. of drug molecules between two silica slabs [23], colloids in hydrogels [24,25], tracers in crowded fluids [26,27] or live biological cells [28][29][30], proteins in membranes [31][32][33][34], internal protein motion [35,36], motor-driven transport of internalised viruses and micron-sized tracers [37,38], moving amoeboid cells [39,40], but also of tracers in porous systems [41] or in weakly chaotic systems [42], as well as the motion of higher animals [43][44][45].
Anomalous diffusion is non-universal in the sense that the MSD (1) does not uniquely specify the physical mechanism behind the observed dynamics. For instance, subdiffusion may be effected by transient trapping events when the probability density function (PDF) ψ(τ ) of the immobilisation times τ is power-law distributed as ψ(τ ) ≃ τ −1−α with 0 < α < 1. An alternative process, often connected to viscoelastic systems, corresponds to long-ranged, power-law correlations of the form ⟨ξ(t)ξ(t + τ )⟩ ≃ α(α − 1)τ α−2 (for sufficiently large τ ) of the driving Gaussian noise [11]. In fact there exist a wide range of different anomalous diffusion processes [11,12]. A central question is then to identify the physical mechanism giving rise to experimentally observed time series x(t) of measured trajectories. Once such a mechanism is identified, the next step is to extract best values for the system parameters. These tasks can be approached by different strategies. One is to use statistical observables such as the time-averaged MSD (TAMSD) and its fluctuations [5,6,46], single-trajectory power spectra [47][48][49][50], (displacement) correlation functions [51,52], extreme value statistics [53], mean maximal excursion statistics [54], covariance-based diffusivity estimators [55], p-variation [56], or codifference measures [57]. Based on the results provided by such observables certain physical processes can be ruled out and decision trees established [13], narrowing down the possible candidates for underlying mechanisms effecting the observed motion. More recently, 'objective' computational methods have been proposed, such as Bayesian-maximum likelihood methods [58][59][60][61] or machine learning approaches [62][63][64][65][66][67][68][69]. The performance and reliability of such methods was put to test in a recent community 'Anomalous Diffusion (AnDi) Challenge' [70], and papers reporting new approaches and methods in diffusive data assimilation have been published in a special issue [71]. Finally, we mention a recent work in which a Bayesian approach was used to provide a reliability measure on top of the output results of a machine learning algorithm [69].
In the analysis of single particle tracking time series it is important to take into consideration that the measured trajectories are always noisy to some degree. Here, two types of noise have to be distinguished: static noise and dynamic noise [72,73]. Static noise is associated with the localisation uncertainty, e.g. due to finite photon counts or limitations to the optical setup itself. Dynamic noise is associated with the movement of the tracked particle during the time it takes to record its position. In the analysis of diffusive data it is known that noise poses a challenge for the correct inference of the MSD [74,75]. At short times, the effect of the noise can in fact be dominant. For finite time series, Brownian trajectories with static noise appear subdiffusive with α < 1 [54,76]. The effects of static and dynamic noise have been studied and methods how to remedy these effects proposed [77][78][79][80]. In particular, it was shown that power spectral analyses of single trajectories can still provide meaningful information on whether a measured dynamics is anomalous-or normal-diffusive [81]. Moreover, it was demonstrated that machine learning methods can provide reliable results for the trajectory analysis even in the presence of noise [69,70].
Here we analyse how noise affects the performance of classical statistical observables for the motion of a particle in a confining harmonic potential. The added complication in the analysis of noise effects for such confined motion is that even in the absence of any noise the motion is characterised by a finite correlation time effected by the restoring Hookean force beyond which the MSD saturates to a plateau. Consequently, in the presence of noise the short time behaviour of statistical observables is dominated by the noise, and the long time limit is dominated by the confinement.
Harmonic confinement is relevant in a number of experimental scenarios, in particular, for optical tweezers experiments, in which the trapped particle can still move, especially when initially placed at the bottom of the harmonic trap potential and the stiffness of the trap is chosen to be low [26,30,82]. Alternatively, a tracer attached to a flexible polymer, whose other end is fixed, will experience a Hookean force [83]. We also mention internal protein dynamics monitored by the relative motion of two labelled aminoacids, which are linked by a number of aminoacids along the sequence [36]. As an approximation, an harmonic potential can also be viewed as the lowest order of a symmetric confining potential.
The manuscript is structured as follows. After introducing the statistical observables and the central stochastic equation of motion in section 2, we will study the effect of static and dynamic noise on Brownian motion in an harmonic potential in section 3. We will then consider processes with finite correlation time, scaled Brownian motion (SBM), fractional Brownian motion (FBM), and continuous time random walks (CTRWs) in section 4. An important measure for trajectory-to-trajectory fluctuations in finite stochastic trajectories, the so-called ergodicity breaking parameter, is addressed in section 5, before drawing our conclusions in section 6. In the appendices we provide detailed calculations for some quantities used in the main text.

Methods
In single particle tracking often only a few particles are tracked instead of a whole ensemble of particles. For some applications, only a single realisation exists at all, e.g. for financial trading data [84,85]. In such cases the method of choice to calculate the propagation of a single particle is the TAMSD [5] where ∆ is the 'lag time' and t the 'observation' or 'measurement time' [5,46]. The expectation value of the observable (2), the mean TAMSD is given by the average over N particles of individual traces δ 2 i (∆) labelled by the index i [5] ⟨ δ 2 (∆) For finite measurement time the TAMSD (2) of any stochastic process remains a random variable, that one can quantify in terms of the dimensionless variable [5,46] It measures the amplitude of the TAMSD at a given lag time ∆ relative to the mean TAMSD at the same ∆. Different stochastic processes have more or less broad amplitude PDFs ϕ(ξ), whose width can be characterised by the 'ergodicity breaking (EB) parameter' [5,46] Its behaviour has been studied for a large range of processes, see, e.g. [11]. As we are interested in typical single particle tracking experiments of micron-sized objects, in the description of the particle dynamics we neglect effects of inertia. In an harmonic potential of the form U(x) = mω 2 x 2 /2 we then describe the particle location x(t) in terms of the overdamped Langevin equation where τ = η/[mω 2 ] is a time scale composed of the frequency ω describing the steepness of the harmonic potential, the mass m, and the friction coefficient η [86]. In our notation the particle mass m is then not present in the Langevin equation (6). The time scale τ takes on the role of a correlation time. Finally, K denotes the diffusion coefficient of the free dynamics, and ζ(t) is the increment of the driving stochastic process. In the case of a Brownian process, ζ represents zero-mean, white Gaussian noise, see below. In what follows, t represents the process time for the considered stochastic processes, for which we will choose different definitions for the noise ζ. For the CTRW, the process time corresponds to a stochastic transform of t, see also below. In the absence of the noise term, equation (6) describes an exponential relaxation with time scale τ . To characterise the spreading dynamics of a particle following the stochastic dynamic (6) we first calculate the position autocovariance function (ACVF) from the increment ACVF ⟨ζ(t 1 )ζ(t 2 )⟩ using the relation Consequently, the (ensemble-averaged) MSD corresponds to the form The expectation values for the mean TAMSD can expressed in terms of the MSD (8) through [5,46] ⟨ δ 2 (∆) When this quantity is identical to the MSD in the limit ∆/t ≪ 1, the process is called ergodic. For a stationary process the MSD approaches the plateau value σ 2 x and the autocovariance ⟨x(t)x(t + ∆)⟩ ≈ σ 2 x C(∆)-with variance σ 2 x and where C(∆) is some function of the lag time-is independent of the measurement time t. Then equation (9) simplifies to [73]. We will analyse the above ensemble-and time-averaged moments for a number of generic stochastic processes [11,12] in the presence of static and dynamic noise for the case of harmonic confinement. Concretely, apart from Brownian motion and a motion driven by a Gaussian noise with finite correlation time [87], we will consider FBM with power-law correlated Gaussian noise [88], SBM with power-law time dependence of the diffusion coefficient [89], and subdiffusive CTRW [14,90].

Noisy stochastic dynamics in harmonic potentials: Brownian motion
In this section we develop the framework for considering effects of static and dynamic noise when the 'pure' underlying process is standard Brownian motion. In the next section we will then apply this framework to non-Brownian stochastic processes.

Brownian motion without noise
For free Brownian motion, the MSD (1) scales linearly with time. The increments are independent identically distributed Gaussian random variables with ACVF ⟨ζ(t)ζ(t ′ )⟩ = 2Kδ(t − t ′ ), where δ(·) is the Dirac δ-function. The overdamped Langevin equation (6) for Brownian dynamics in the harmonic potential U(x) = mω 2 x 2 /2 describes the Ornstein-Uhlenbeck process [86,87]. The discrete version of this model is the autoregressive process AR(1) of order one [91,92]. This autoregressive process and its many generalisations are widely used in statistical literature [93][94][95]. It is given by with the autoregressive parameter a = exp(−1/τ ) and the discrete, zero-mean Gaussian white noise ζ n . It can specifically be used for numerical simulations. A sample trajectory is shown in figure 1. In what follows, numerical calculations are performed based on iterations of the process (10) and its variant, such that 100 iterations correspond to one time step in the process time t. The ACVF obtained from equation (7) reads from which in turn the MSD of the Ornstein-Uhlenbeck process is the well known expression [86,96,97] for particles starting at the origin, x(0) = 0. At short times, equation (12) reduces to the expression 2 Kt for free Brownian motion, whereas in the long time limit the thermal value The mean TAMSD follows from equation (9), and we obtain [96,98] ⟨ δ 2 (∆) Here we note that the relaxation time in the exponential differs by the factor of 2 in the exponential, and an additional factor of 2 appears in front of the diffusion coefficient. Thus the short-time behaviour is ergodic in the sense that time and ensemble averages are identical. In contrast at long times the time average produces twice the thermal value. This counterintuitive result is due to the definition of the TAMSD, which counts twice the stationary value. Extensive discussion of this consequence of the chosen definition can be found in [96][97][98]. In [99] it is shown how this seeming discrepancy can be remedied. The behaviour of the MSD and TAMSD in the absence of noise is shown in figure 2.

Static noise
We take static noise η(t) into account additively [72,73], i.e. the recorded trajectory of the true motion x(t) is given by We assume the noise to be bounded and stationary. The typical choice is the Ornstein-Uhlenbeck process where ζ is a zero-mean white Gaussian noise. The specific realisation of the noise time series of ζ in equation (15) is chosen to be independent of the noise in the parental Langevin equation (6) for the unperturbed process x(t). The variance of the static noise is Since the noise is independent of the process itself, the obtained functions for the MSD and TAMSD are superimposed with the respective functions of the noise. Typically the correlation time τ η of the noise is much smaller than the characteristic time scale τ of the confinement. For our analysis we require τ > τ η . In the plots we use the normalised processes in order to be able to compare between different noise levels, so we choose the superposition where the σ i are the respective standard deviations of the process and the noise, respectively. The mixing parameter v then allows us to freely choose the respective weight of the noise. For instance, with this normalisation we can compare the resulting measured dynamics for the same setup when different light intensities are used for detection, i.e. different errors due to the specific photon yield. A sample trajectory exemplifying the effect of static noise is shown in figure 1, the MSD and mean TAMSD are shown in figure 2.

Maximal slope of the MSD
In general, the resulting MSDs for the perturbed motion (17) involves two characteristic time scales for the pure motion and the noise, respectively. This effects concave crossovers. The resulting shape for short times is described by a more gentle slope smaller than unity (as already discussed in [76]). The asymptotic behaviour is not affected, since the noise MSD converges to a constant, that is typically much smaller than the underlying particle motion. Typically, the slope therefore is smaller than unity at short times, recovers to larger values (ideally, the slope is unity if the confinement sets in very late in shallow harmonic potential), and eventually flattens out. We can quantify this behaviour in terms of the maximal slope of the MSD ⟨X 2 (t)⟩.
To this end we first note that the scaling exponent of both the MSD and TAMSD for unperturbed Brownian motion is always unity. The exact slope of ⟨X 2 (t)⟩ depends on the mixing parameter v as we show. For t > τ η we derive the slope in appendix A as the logarithmic derivative of the MSD. We find the maximum value where z M = 2t M /τ and t M can be expressed in terms of the Lambert W-function W 0 as We find that for 0 < v < 1 and for t > τ η the maximal scaling exponent α M is independent of the correlation times τ and τ η (except for the case v → 0, when the point of maximal scaling t M gets shifted below unity, t M < 1, and approaches zero). It solely depends on the parameter v. We show the values of α M as function of v in figure 3(a).

Dynamic noise
Dynamic noise arises from the finite time it takes to record the particle position, i.e. the position of the particle is not recorded instantaneously, but within a short integration time. During this exposure time the particle continues to move, thus blurring its actual position. The easiest way to account for dynamic uncertainty is by looking at moving averages of window length ('exposure time') s, In figure 1 we show how a trajectory is practically affected by the presence of dynamic noise. Distinctly, the resulting time trace is smoother. We note that in the case of Brownian motion, the dynamics turns out to be a continuous version of the popular ARMA(p, q) (autoregressive moving average) model [91] with p = 1.
The ACVF of the signal with dynamic error can be calculated from In the case of Brownian motion in an harmonic potential with dynamic noise for |t 2 − t 1 | ⩾ s we use equation (20) and the ACVF (11) of the unperturbed process to derive In the limit of vanishing perturbation, i.e. s → 0, we recover equation (11). When t = t 1 = t 2 ⩾ s we obtain from equation (21) the MSD From this expression we see that for vanishing dynamic noise, s → 0, we get back to result (12). When t, s ≪ τ with t ⩾ s we obtain the limiting behaviour of unconfined motion with dynamic noise. In the long time limit we find from which the thermal value Kτ is obtained in the limit s → 0. The mean TAMSD can be calculated from equations (2) and (21), For Brownian motion, this yields [73] In the limit s → 0, we consistently retrieve the mean TAMSD (13) of the pure Ornstein-Uhlenbeck process. For unconfined motion, i.e. when ∆, s ≪ τ , we find that When ∆ → ∞, we see that the plateau of the mean TAMSD gets shifted to from which we consistently find the thermal value 2Kτ for the mean TAMSD (equation (13) for ∆ → ∞) of the unperturbed Ornstein-Uhlenbeck process in the limit s → 0. The effects of dynamics noise on the MSD and mean TAMSD are shown in figures 2(b) and (c).

Maximal slope of the MSD
As compared to the unperturbed process the presence of dynamic noise generally reduces the fluctuations due to the smoothing. At short times, as can be seen in equation (24), the initial value of the MSD is reduced by the dynamic noise, whereas the slope is not affected. While the long-time behaviour has the shifted plateau value (25), the slope is zero as for the unperturbed motion. A numerical simulation of the behaviour is shown in figure 2(b). When we consider the interaction of both static and dynamic noise we can then obtain the maximal slope α M in analogy to what was done for static noise, see appendix A. From equation (23) we find in terms of the dynamic averaging time s and the relative amplitude v of the static noise. Here the corresponding time t M can be found (again using the Lambert W-function) as Note, that in the presence of dynamic noise, the maximal slope depends on the parameter s and also on the relaxation time τ . Numerical results for α M are shown in figure 3(b) as function of the intensity v of static noise for different characteristic times τ and averaging time s of the dynamic error. For v > 0.3, the slope α M is very close to the case without dynamic noise. Figure 3(c) demonstrates the effect of noise on the MSD ⟨X 2 (t)⟩.

Noisy stochastic dynamics in harmonic potentials: non-Brownian motion
We now continue to analyse the effects of the two types of noise on a range of popular models for non-Brownian motion.

Finite correlation time
The Brownian motion model is based on sharply correlated white noise expressed by the δ-function. In some settings (e.g. for 'active' particles [100,101]) finite correlations are relevant which are assumed to be Gaussian, with zero mean and ACVF In the harmonic potential this process thus involves the two characteristic time scales τ and τ ζ . In discrete time it corresponds to the autoregressive model of order two [91,102], with uncorrelated ζ n (see appendix C). The process is stationary for positive relaxation times τ and τ ζ . The time-averaged ACVF of the AR(2) process is known [91]. The ACVF can be obtained from equations (7) and (32), producing with t 2 ⩾ t 1 . For t ′ = 0, the MSD results in the form In the absence of confinement we find Thus, when t ≪ τ ζ we find the ballistic scaling ⟨x 2 (t)⟩ ∼ Kt 2 reflecting the correlation at short times characteristic of active motion [100,101]. In the opposite limit t ≫ τ η we have ⟨x 2 (t)⟩ ∼ 2Kt, independent of τ ζ , as it should be. When the confinement is present, the long time limit reads ⟨x 2 (t)⟩ ∼ Kτ 2 /(τ + τ ζ ), which corresponds to the variance of the process. In this stationary limit t ≫ τ, τ ζ of equations (34) and (35) we also obtain the mean TAMSD ⟨ δ 2 (∆) with the small-∆ limit , which is the same expression as the MSD up to the (typical) factor of 2 for equilibrium states due to the definition of the TAMSD [96]. This process is analysed in terms of the second moments in figures 4(a) and (b).

SBM
SBM is defined by the overdamped Langevin equation (6), in which we replace the diffusion constant K by the deterministic power-law form [103,104] where α is allowed to range in the interval (0, 2). Brownian motion is contained as the limiting case α = 1. SBM in an harmonic potential has the ACVF [105] ⟨x(t + ∆)x(t)⟩ = 2K α t α e −(2t+∆)/τ M(α, 1 + α, 2t/τ ), from which the MSD follows in the form [105] ⟨x 2 (t)⟩ = 2K α t α e −2t/τ M(α, 1 + α, 2t/τ ), where M(a, b, c) is the Kummer function. At short times, we recover the anomalous-diffusive scaling ⟨x 2 (t)⟩ ∼ 2K α t α , while at long times the MSD reflects the non-equilibrium character of SBM, namely, Table 1. Slope ranges for SBM in different noisy scenarios for different time ranges. The scaling without noise is discussed in the main text. The scaling with static noise results from the superposition with the noise process (15) that exhibits linear scaling for t ≪ τη and is constant for t ≫ τη. The window average for dynamic noise (20) yields steeper slopes compared to the unperturbed process.
For the mean TAMSD one can find an exact solution in terms of Kummer functions [105]. In the limit ∆ ≪ t, one finds the quite simple form [105] ⟨ δ 2 (∆)

FBM
In contrast to SBM, FBM is ergodic in the sense that time and ensemble averages converge in the limit ∆/t → 0. FBM is described by the regular Langevin equation (6), driven by zero-mean fractional Gaussian noise [11,88] with the characteristic, long-range power-law decay valid for long t ′ . The ACVF for this process can be found in [96], here we only report the MSD in terms of the lower incomplete Gamma function γ(a, b) =´b 0 t a−1 e −t dt and the Kummer function M(a, b, c). At short times, the MSD encodes the free anomalous diffusion ⟨x 2 (t)⟩ ∼ 2K α t α , while at long times t ≫ τ we find Here the stationary value ⟨x 2 ⟩ st = K α τ α Γ(1 + α) demonstrates that FBM acts as 'external noise' in the sense of Klimontovich [110], i.e. the plateau value is not a true equilibrium state. Note in particular the exponential approach to the stationary state. The corresponding mean TAMSD in the limit of long measurement times reads [96] ⟨ δ 2 (∆) where we used the upper incomplete Gamma function Γ(a, b) =´∞ b t a−1 e −t dt. This result has the short-lag time scaling ⟩ ∼ 2K α t α fully matching the ensemble MSD. At long lag times, however, we remarkably find ⟨ δ 2 (∆) 3 While the form (42) of the noise-noise correlation becomes negative in the subdiffusive case 0 < α < 1, the initial part for short t ′ is positive such that the integral under the full function ⟨ζα(t)ζα(t + t ′ )⟩ is identically zero, see the discussions in [88,108,109].
In contrast to the exponential approach to the stationary value in the MSD, that is, we see that the TAMSD to leading order has a much slower power-law decay proportional to ∆ α−2 which was indeed observed in optical tweezers experiments [26]. Figure 4 demonstrates the effects of noise on the moments of FBM in an harmonic potential. Table 2 shows the ranges of the anomalous scaling exponents of the MSDs.

CTRWs
CTRWs [14] are popular models for anomalous diffusion [11]. In this scenario a particle performs jumps whose length is drawn from a given PDF. In between jumps the particle undergoes waiting periods τ ′ , also drawn from a specific PDF. Here we assume that the jumps are characterised by a finite variance, while the waiting time PDF is assumed to be long-tailed, with 0 < α < 1. The associated characteristic waiting time ⟨τ ′ ⟩ diverges. Waiting time PDFs of such scale-free form have been measured, i.a., for tracers in weakly chaotic systems [42], for colloidal tracers in actin hydrogels [24,25], for potassium channels diffusing in live cell membranes [33], and for drug molecules in between silica slabs [23]. In the CTRW picture this scenario gives rise to subdiffusion of the form (1). The description of CTRW subdiffusion with waiting time PDF (47) can be formulated in terms of the Langevin equation (6), whose time dependence is now viewed as an operational time (corresponding to the number of jumps), combined with a second stochastic equation describing the coupling of operational time and real (laboratory) time. If we replace the time t in the Langevin equation (6) by the variable s, the operational time, and then write the laboratory time t as function of s in the form [111] dt(s) we obtain a stochastic equation formulation of a subdiffusive CTRW. Such a mapping between operational and process time is called a subordination [112]. In some sense subdiffusive SBM can be viewed as a mean field model for a CTRW with scale-free ψ(τ ′ ) [113].
In an external field the particle responds to an external field only while it is mobile [14,114]. This corresponds to the assumption that while being trapped the particle cannot be affected by an external force. CTRWs in an external force field in the diffusion limit can be described in terms of fractional Fokker-Planck equations, from which moments can be conveniently obtained [10,114,115]. In particular for x(0) = 0 the MSD in an external harmonic potential has the form [115] in terms of the Mittag-Leffler function, whose expansions around zero and infinity, respectively, read [116]. At short times, this reduces to the free MSD (1), while at long times ⟨x 2 (t)⟩ ∼ ⟨x 2 ⟩ eq (1 − [t/τ ] α /Γ(1 − α)), where ⟨x 2 ⟩ eq = K α τ α . This MSD is shown in figure 4(g) together with the noise-perturbed dynamics.
In an harmonic potential the position ACVF is given by [117] beta function B(z, a, b) =´z 0 u a−1 (1 − u) b−1 du. This ACVF allows one to calculate the mean TAMSD in the limit ∆/t ≪ 1 while ∆ is longer than the time scale for engaging with the harmonic potential [117], In the limit when ∆ is shorter than the engagement time, the behaviour of free diffusion is obtained Both this free diffusion and the behaviour in the confinement is thus (weakly) non-ergodic, i.e. time and ensemble averages do not converge to each other. In particular, the crossover from ⟨x 2 (t)⟩ ≃ t α to ⟨x 2 (t)⟩ ∼ ⟨x 2 ⟩ eq contrasts ⟨δ 2 (∆)⟩ ≃ ∆ to ⟨δ 2 (∆)⟩ ≃ (∆/t) 1−α , i.e. at long times the mean TAMSD continues to grow, albeit with the reduced exponent 1 − α. This behaviour was observed in experiments and simulations [30,35]. The effects of static and dynamic noise on CTRW dynamics in an harmonic confinement is illustrated in figure 4(h). The associated slopes for the MSDs are given in table 3.

Ergodicity breaking parameter
The mean TAMSD in equation (9) hides potential fluctuations from the TAMSD of one trajectory to that of the next. This is, of course, valid for any stochastic process measured over a finite period of time. However, the extent of such fluctuations strongly depends on the specific class of stochastic process. Thus for Brownian motion or FBM typically these fluctuations converge rather quickly, whereas pronounced scatter in the amplitudes between individual TAMSDs persist asymptotically for CTRW motion [11]. We can measure this amplitude scatter of the TAMSD in terms of the PDF ϕ(ξ) expressed in terms of the dimensionless variable (4). The width of the PDF ϕ(ξ) is quantified by its variance, the ergodicity breaking parameter (5). In general, EB depends on both the lag time ∆ and the measurement time t, where the latter is sometimes considered in the infinite limit [46]. Generally, EB decreases with improving statistic, i.e. decreasing ∆/t. For reproducible, ergodic systems EB → 0 and ϕ(ξ) = δ(ξ − 1) in the limit t → ∞ [11,46,118,119]. SBM is a particular case, as EB → 0 for ∆/t → 0 [120] while the system is weakly non-ergodic in the sense that the MSD always differs from the TAMSD. For the Ornstein-Uhlenbeck process analytical solutions for EB without noise have been analysed [97].
For a general process with superimposed noise of the form The mixed terms cancel out because the TAMSD is strictly positive. Thus the ergodicity breaking parameter of the superimposed process is We show a numerical analysis of the ergodicity breaking parameter for Brownian motion, correlated Brownian motion, FBM, and CTRW in harmonic potentials in figure 5. The ergodicity breaking parameter is changed by static noise. The spread of the distribution around ξ = 1 gets smaller due to noise. Thus, the noise process leads to a more ergodic behaviour of the overall process. The distribution of ξ(1) is close to a Gaussian for Brownian motion and FBM (also for SBM). For larger ∆, the distribution gets more skewed, while the mean increases. CTRW has a much higher variance for small ∆ compared to other processes. For α = 1/2, the distribution of ϕ(ξ) tends to a one-sided Gaussian with maximum at ξ = 0, for α = 1 it goes to the ergodic delta peak at ξ = 1. In between (see figure 5 right column with α = 0.8) it can be approximated by a modified one-sided Lévy stable PDF. Static noise suppresses the width of the distribution and makes it more ergodic.
The initial value for ∆ = 1 can be increased or decreased by the superposition with static noise, depending on weather or not the value of δ 2 ⟩ . In figure 5, we see this is the case for a superposition with static noise, that has a correlation time τ η = 0.3 < 1. Dynamic noise always leads to an increase in EB, i.e. it makes the system appear less ergodic.

Conclusions
Anomalous diffusion is typically characterised by power-law dependencies of the MSD on time for which the associated scaling exponent departs from the Brownian value α = 1. A minimal criterion to observe anomalous diffusion is that the MSD scales with the same exponent α, for at least a decade in time. This scaling behaviour is typically checked in a log-log plot of the MSD versus time. When the window of observation in a given experiment exceeds a certain correlation time in the anomalous diffusion dynamic crossovers to a second anomalous-diffusive or a normal-diffusive behaviour may be observed in the system. Examples include cutoffs in the scaling behaviours of the waiting time PDF [19,30], or in the long-range correlations of viscoelastic motion in lipid bilayers [108,121]. Similarly anomalous-diffusive regimes may arise when the motion is Brownian at both short and long times, but the respective diffusion coefficients are different [20]. Here we studied the situation when such a correlation time is imposed by external confinement, exerted by a restoring Hookean force for the motion in an harmonic potential. In crossover scenarios the observation of scaling behaviours is often impeded by the onset of confinement effects. In such cases, dedicated models including confinement are helpful in the analysis.
Due to the non-universality of anomalous diffusion in the sense that for some MSD scaling exponent α ̸ = 1 a whole range of stochastic processes may effect the dynamic, it is of interest which precise physical mechanism is effecting the observed motion, e.g. whether the anomalous dynamic is due to trapping or correlation effects, etc. To this end we presented the ACVF, MSD, and TAMSD for several processes.
The task of identifying a specific stochastic process and the best estimates of its parameters is hampered by the fact that measured data are compromised by the presence of detection noise. For unconfined motion the effects of both static and dynamic noise (as defined above) have been well studied, both from a conceptual point of view [72][73][74][75][76][77]81] and with respect to objective data analyses [58][59][60][61][62][63][64][65][66][67][68][69][70]. Here we presented a first approach to understanding the effects of static and dynamic noise on different normal-and anomalous-diffusion processes.
Specifically, we investigate the influence of static and dynamic noise on the overdamped motion of stochastic processes in harmonic potentials. We consider several common stochastic models: Brownian motion, Brownian motion with finite correlation time, and three models of anomalous diffusion: FBM, SBM, and CTRW. For the case of Brownian motion in harmonic potentials, the Ornstein-Uhlenbeck process, both the MSD and TAMSD saturate at the thermal value in the potential. Such a saturation can also be observed for FBM, however, with a more complicated slower convergence of the TAMSD. SBM saturates only in the TAMSD while the behaviour of the MSD reflects the strong non-stationarity of the process. In CTRWs the convergence of the MSD to the thermal value has a slow power-law convergence, while the TAMSD exhibits a crossover from a linear to a power-law scaling in the lag time. The effect of static noise on all these processes is quite similar. Static noise is implemented as a superimposed Ornstein-Uhlenbeck process with fast relaxation as compared to the parental, unperturbed process in the harmonic potential. The MSD corresponds to a superposition of the parental process and the noise effect. This changes the long-time behaviour of the MSD only by an additive constant. The short time behaviour becomes linear for both superdiffusive and subdiffusive processes, in the range 0 < t < τ η . In particular, for subdiffusive processes for τ η < t < τ the slope gets flatter due to static noise, since the MSD of the noise is constant and the process only slowly takes over. The maximal slope in this range can be analytically calculated for the Ornstein-Uhlenbeck process. It only depends on the ratio of signal and noise and is independent of the time scales τ η and τ . For the other processes numerical analyses were presented.
Dynamic noise leads to a steeper growth of the MSD at short times. It is implemented as a moving average, reflecting the particle motion during the exposure time (we discuss noisy driving as an alternative implementation in appendix B). Moving averages do not affect the long time behaviour but generally effect a smoother trajectory. This is seen, in particular, when we look at the amplitude fluctuations of individual TAMSDs, as shown here for the PDF ϕ(ξ) and the ergodicity breaking parameter. A process that is subjected to both static and dynamic noise exhibits a maximal scaling in the range τ η < t < τ . In contrast to the case of pure static noise, the slope now explicitly depends on τ . For each process a table was presented with the MSD-slopes for different relevant regimes.
We hope that this analysis will be useful for the evaluation of data of confined stochastic motion from experiments and simulations. Future work should generalise this approach to different processes such as Lévy walks [122] or heterogeneous diffusion processes [123], as well as to non-harmonic potentials, for which, e.g. FBM has more involved interactions [124][125][126]. Moreover, the question of how different forms of noise are included in trapping motion should be explored.

Data availability statement
The data that support the findings of this study are available upon reasonable request from the authors. Appendix A. Derivation of the maximal slope of the MSD for the Ornstein-Uhlenbeck process with noise A.1. Static noise The MSD of an unperturbed process x(t) with superimposed static noise, X(t) from equation (17), is given in normalised form by ⟨X 2 (t)⟩ = (1 − v)⟨x 2 (t)⟩/σ 2 x + v⟨η 2 (t)⟩/σ 2 η . Within the range t > τ η the MSD of the Ornstein-Uhlenbeck process describing the static noise, has already saturated and we can use ⟨η 2 (t)⟩/σ 2 η ≈ 1. Then we can base our analysis on the MSD (12) of the unperturbed process in an harmonic potential. The slope α of ⟨X 2 (t)⟩ is defined as the first derivative of the MSD on a log-log scale. So we take log(⟨X 2 (e u )⟩) with t = e u and derive We are now looking for the maximal value of the function α(u). To this end we need to find the roots of the derivative dα/dt, Since the denominator is always positive for v < 1 and t > 0, we need to solve . This can be solved by iteratively calculating An explicit solution is given by the Lambert W-function W 0 (the negative branch W −1 is not physical, here). It reads The solutions are given in figure 3. We note that α M solely depends on v and is independent of τ . For all v > 0 the maximal slope turns out to be significantly smaller than one.

A.2. Static and dynamic noise
Adding dynamic noise to Brownian motion renders the slope steeper. If then the noisy signal gets additionally superimposed with static noise, we can calculate a maximal slope analogously to the section above. Again, for t > τ η we use the simplified form ⟨η 2 (t)⟩/σ 2 η ≈ 1 and take the derivative of log(⟨X 2 (e u )⟩) with t = e u , finding Note that the limit s → 0 consistently yields equation (A.1). The maximum can be found by calculating the root of the nominator of dα/du, ( which is calculated from (A.8) Figure B1. Effect of driving noise on the MSD for processes in harmonic potentials. (a) MSD of Brownian motion (τ = 1) without noise, with moving average dynamic noise (s = 1 and s = 3), and with noisy driving (τ λ = 1 and τ λ = 3). Both types of noise lead to a steeper slope for small t. (b) MSD of SBM with α = 1.4 with and without noisy driving. The noise leads to a steeper slope for small t and a flatter slope for larger t. Therefore, some values of the MSD are increased due to noise which does not happen with a moving average implementation. (c) mean TAMSD of FBM with α = 0.6 with and without noisy driving. The noise leads to a steeper slope, but for very small t, the slope flattens again.
The solution is given by the Lambert W-function W 0 as (A.9) Thus the maximal slope depends on all three parameters v, s, and τ . The solutions are shown in figure 3. We see that only for small mixing parameter v, the maximal slope exceeds unity.

Appendix B. Dynamic noise due to noisy driving
Dynamic noise in the main text is modelled by a moving average, leading to a steeper slope of the MSD for short times. The second way of modelling dynamic noise is to consider noise λ(t) on the driving ζ(t) instead of static noise superimposed to x(t). The Langevin equation (6)  where λ(t) is modelled as Ornstein-Uhlenbeck noise. The characteristic time scale τ λ is considered to be small compared to the correlation time τ induced by the potential. This stochastic noise process is affected by the potential. With the form X(t) = x(t) + y(t) we can then make use of the linearity of the model. Here x(t) is and the zero-mean white Gaussian noise ζ(t) here is independent of the noise in (B.1). This corresponds to a process y(t) with two time scales as described in section 4.1. The variance σ 2 y is given by equation (C.7). The shape of the MSD of y(t) is given in section 4.1. It is similar to the Ornstein-Uhlenbeck process x(t), but with a steeper initial slope. The MSD of the superposition X(t) of process and noise at short times it is steeper than the MSD of the unperturbed process. In figure B1 we use the normalised form where σ are the respective standard deviations and v is the mixing parameter. Table B1 shows the slope of the MSDs in different time ranges. While for Brownian motion the resulting dynamic looks similar to the moving average implementation, for subdiffusive processes the MSD is not strictly smaller than the unperturbed MSD. Moreover, there is an additional crossover at short t, when the unperturbed process becomes dominant in the limit t → 0.

Appendix C. Noisy driving in discrete models
We here derive the effect of noisy driving for discrete form of the processes. The discrete version of the Langevin equation (B.1) is X n = aX n−1 + (ζ n + λ n ), (C.1) where 0 < a < 1 (a = exp(−1/τ )), the process increments are ζ n , and λ n = bλ n−1 + ζ n , (C.2) with 0 < b < 1 (b = exp(−1/τ λ )). We use zero-mean Gaussian white noise λ n . This dynamic is solved by Here x n has the form of an AR(1) process and is identical to the unperturbed process. y n is an AR(2) process driven by the white noise λ n . The statistical properties of such autoregressive processes are well known [91]. They can be reformulated in terms of τ and τ λ . We can thus find the variance of X t from the variance of x t and y t , The ACVF is given as where G 1,2 = 2e −1/τ −1/τ λ e −1/τ + e −1/τ λ ± √ ( e −1/τ + e −1/τ λ ) 2 + 4e −1/τ −1/τ λ (C.9) and with the parameters as well as A 2 = 1 − A 1 .