Directed continuous-time random walk with memory

In this paper, we are addressing the old problem of long-term nonlinear autocorrelation function versus short-term linear autocorrelation function. As continuous-time random walk (CTRW) can describe almost all possible kinds of diffusion, it seems to be an excellent tool to use. To be more precise, for instance, CTRW can successfully describe the short-term negative autocorrelation of returns in high-frequency financial data (caused by the bid-ask bounce phenomena). We observe long-term autocorrelation of absolute values of returns. Can it also be described by the CTRW model? And maybe more importantly, to what extent can it be explained by the same phenomena? To refer to these questions, we propose a new directed CTRW model with memory. The canonical CTRW trajectory consists of spatial jumps preceded by waiting times. In directed CTRW, we consider the case with positive spatial jumps only. We take into account the memory in the model as each spatial jump depends on the previous one. This model, based on simple assumptions, allowed us to obtain the general formula covering most popular types of nonlinear autocorrelation functions.

In the majority of cases, the analyzed CTRW models focus on the spatial distribution with zero mean or even symmetric distribution. In other words, the drift term is usually neglected. The case of drift was studied in [37] (and references therein). The case of canonical CTRW, where both spatial and temporal distributions are i.i.d. and they do not depend on each other, turns out to be a compelling model, able to describe many cases of normal or anomalous diffusion. Different types of CTRW are obtained if the mean waiting time is finite or diverging (but assuming finite variance of the spatial distribution). In the first case, we observe a normal diffusion, in the latter subdiffusion occurs [38]. If the variance of the spatial distribution diverges and waiting time distribution (WTD) has a finite mean, we obtain the description of Lévy flights.
The other promising branch of CTRW models is the one considering memory, i.e., the dependence between successive jumps. Different types of dependencies were already studied: the backward or forward correlations between spatial jump directions [39] in the case of concentrated lattice gas for the study of the tracer coefficient [40], even taking into account the dependencies over several subsequent jumps [41]. Also, models driven by the negative feedback in consecutive jumps were built, considering one-step memory [35,42] and later two-step or even infinite-step memory [34]. Their potential applications cover the Le Chatelier-Braun principle of contrariness.
Our work is directly motivated by the application of CTRW in the description of high-frequency financial data. The universal properties of all financial price time series are sometimes referred to as stylized facts [49,50]. There are two well known stylized facts about autocorrelation of price time series. The first one states that the time-dependent autocorrelation of price increments (or logarithmic returns) is negative and quickly decays to zero [43]. A CTRW model with memory [35] successfully reproduced this fact. The second stylized fact states that autocorrelation of the absolute value of price increments (or absolute values of log returns) is a positive slowly decaying function. Also, the amplitude in the second case is usually an order of magnitude higher than in the first case. It is the reminiscence of the so-called volatility clustering phenomenon [51]. It seems natural to ask if the CTRW model with memory introduced in [35] adapted to describe absolute values of price changes can successfully reproduce the second mentioned stylized fact. We are answering this question below.
The paper is organized as follows: in Section 2, we present the motivation behind our work and define and solve the proper stochastic process. In Section 3, we obtain velocity autocorrelation function (VAF) and in Section 4 the comparison with empirical data is made. The intradayseasonality is taken into account in Section 5. Finally in Section 6, we conclude with remarks on the results presented in this paper.

Model
The CTRW trajectory process is a step function (a piecewise constant function) that can be interpreted as spatial jumps preceded by waiting times. In canonical CTRW, all jumps and waiting times are i.i.d. random variables. The model that successfully described the short term linear autocorrelation of the stock market returns was based on the dependence of two consecutive price changes in the following form h(r n |r n−1 ) = (1 − )h(r n ) + δ(r n + r n−1 ), where h(r n |r n−1 ) is the probability density of the price change r n under the condition of the previous price change value r n−1 . This assumption was based on the technical property of the double auction market named bid-ask bounce. The CTRW formalism allows calculating linear autocorrelation function analytically. It is worth to mention that by changing the distribution h on the right-hand side of (1) we can obtain some nonlinear autocorrelation functions, but only in the limited cases of monotonic nonlinearity. Obtaining the autocorrelation of absolute values of returns cannot be achieved this way. To do so, we construct the directed continuous-time random walk (DCTRW) focused on the absolute values of spatial jumps. This process is defined in such a way that its linear autocorrelation is exactly the nonlinear autocorrelation of absolute values of returns. As in (1) we consider one-step memory for consecutive jumps and no dependence between waiting times or between waiting times and jumps. We take modules of price changes R n = |r n | and obtain dependence in the form where H(R n ) and H(R n |R n−1 ) are respectively distribution of jump modules and conditional distribution of jump modules. Parameter describes the strength of the memory, for = 0 we obtain the model without memory. Considering DCTRW of absolute values of price changes, Dirac delta describes the same consecutive jumps, not the opposite ones, as it was the case in (1). As in the previous case, other types of the nonlinearity can be obtained by changing the distribution H on the right-hand side of (2).
To sum up, our model can be described by the probability density functions of nth jump R n after waiting time t n conditioned on all previous R i and t i : where ψ(t) represents the WTD. Results will be presented for any WTD and in two specific cases.
To make the process stationary, we cannot use the same WTD for the first jump as well as for other jumps [52,53]. This is because the previous (preinitial) jump might have occurred at any time before t = 0. Therefore, we should define as the WTD before the first jump. Moreover, for simplicity of notation it is useful to introduce sojourn probability Ψ(t) = ∞ t ψ(t )dt . Above probabilities can be easily expressed in the Laplace domain: where denotes Laplace transform and t = ∞ 0 tψ(t)dt < ∞ is expected (mean) waiting time. On our path to obtaining nonlinear VAF of the CTRW by calculating the linear VAF of DCTRW we need a few intermediate quantities. One of these intermediate dynamic quantities describing the stochastic process is the stochastic, sharp, n-step propagator Q n (X, R n ; t|ξ), n = 1, 2, . . . This propagator is defined as the conditional probability density that the price, which was initially (at t = 0) in the origin value (X = 0) reached by preinitial jump ξ, makes its nth jump by R n from X − R n to X exactly at time t.Q n (K, R n ; s|ξ) is sharp propagator in the Fourier-Laplace domain. The recurrence relation between two successive sharp stochastic propagators can be written for any form of H(R n |R n−1 ) and n > 1, as follows: The first sharp propagator Q 1 (X, R 1 ; t|ξ) can be calculated directly from definition The following sharp propagators can be calculated using equation (6). After integrating over R n we obtain the recurrence relatioñ The second intermediate quantity is the soft propagator P (X, t), defined as the conditional probability density that the price, which was initially (at t = 0) in the origin value (X = 0) reached by preinitial jump ξ, at time t is equal to X. We can write the relation between the soft propagator P (X, t) and the sharp propagator Q(x, t) (in the Fourier-Laplace domain) as To obtain explicit formula for the right hand side of equation (10), in case of one-step memory defined by equation (2), we use the recurrence relation (8). The precise description of this procedure can be found in Appendix A. The result can be simply substituted into equation (9) and hence we obtain the soft propagator in the following form where S(K; s) = ∞ n=1 (ψ(s) ) n−1H (nK).
As a result, the soft propagator in the Fourier-Laplace domain takes a reasonably simple form; however, it still contains the function S which is given as an infinite sum. Fortunately, to compute moments of the process and VAF we need to know the corresponding derivatives of the soft propagator at point K = 0, which can be determined explicitly.
The first and the second moment of the process in the Fourier-Laplace domain arẽ where M i is the ith moment of jump modules distribution H(R). The first moment of the directed process in the time space rises linearly in time m 1 (t) = M1 t t, exactly like for the process without memory. It is worth to notice that it does not depend on .

Nonlinear velocity autocorrelation function of CTRW
In the general case, the VAF in the time domain is given by In the case of the DCTRW process considered in this paper, it takes the form where L −1 [·] is the inverse Laplace transform. To investigate the behavior of our nonlinear VAF in the limits t → 0 and t → ∞, we have to check the behavior in limits s → ∞ and s → 0 of the expressions inside inverse Laplace transforms. It is known that for s → ∞,ψ(s) goes to 0, while for s → 0 the approximationψ(s) ≈ 1 − t s should be used. Therefore, in the limit of long times VAF vanishes and for short times we obtain the variance of the process C(t) ≈ M2 2 t δ(t). Normalized VAF C n (t) has Dirac delta at t = 0 so C n (t) = 2 t M2 C(t). To compare our model with empirical data we use two specific WTDs: exponential and double-exponential, with explicit results for both. First one is a simple distribution and its characteristics match stylized facts of financial time series. The second one can be fitted to empirical data with high accuracy and still allows to obtain analytical VAF from the model. Exponential WTD with the mean waiting time equals to t is given as and double-exponential WTD with partial mean waiting times equals to τ 1 and τ 2 and weighting parameter w is given as Mean waiting time of double-exponential WTD is t = For the exponential WTD, nonlinear VAF is easily expressed as where Although exponential WTD does not describe properly the empirical WTD, one can easily interpret meaning of the parameters. Firstly, for t > 0 nonlinear VAF is positive (unlike the negative linear VAF) and decreases exponentially. Relaxation time increases and the amplitude reduces with longer mean waiting time. Increasing parameter results in higher relaxation time and amplitude, especially for = 0 VAF is non-zero only for t = 0. It is also noticeable that normalized nonlinear VAF depends only on a ratio between the first moment squared and the second moment of jumps modules. The amplitude of nonlinear VAF decreases with the increase of M . For the double-exponential WTD, which satisfactorily fits empirical data, normalized VAF is There are three exponential functions in this formula, except Dirac delta, all with positive amplitudes. The first one is worth mentioning, as it does not depend on . It implicates that for DCTRW processes linear VAF (equal to nonlinear VAF for CTRW) can be non-zero even in the case without memory ( = 0). That effect does not occur in linear VAF of the original CTRW. In the limit when two-exponent WTD goes to exponential WTD (w → 0 or 1) this element vanishes. Two other exponential functions depend on and describe decaying at different rates. Similarly like for exponential WTD, increasing results in higher VAF. In the case of spatial changes with zero variance (M → 1), these terms are equal to zero.

Empirical results
To compare our model with empirical data, we use tick-by-tick transaction data from Polish stock market (Warsaw Stock Exchange) from years 2011-2012. Presented results are calculated for KGHM (copper mining company) -one of the most liquid stocks. We extract waiting times (periods between transactions) and jumps (price changes) from this data. Comparing the model with empirical data requires estimating parameters. We obtain τ 1 , τ 2 , w from fitting two-exponential WTD to empirical histogram using least squares method. We calculate two first moments of price changes absolute values M 1 and M 2 explicitly from the empirical distribution. Parameter is calculated as one-step autocorrelation of price changes absolute values. Empirical linear VAF and nonlinear VAF were calculated using the method described in [35]. We want to remind that linear VAF obtained from the CTRW model based on (1) (and its modifications in [34,54]) built using these parameters fits satisfactorily with empirical data. This result is presented in Figure 1, as linear VAF of CTRW (dashed line) with good approximation fits the empirical point (gray dots). The situation is completely different in the case of nonlinear VAF. As shown in Figure 1, theoretical approach does not explain observed nonlinear VAF (solid line, and black dots). Theoretical nonlinear VAF decays slower than linear VAF, but empirical nonlinear VAF decays much slower than both of them. There can be many reasons explaining obtained disagreement: daily seasonality, long-term jump modules dependencies and long-term waiting times dependencies (see Fig. 2). In the next section, we check if taking into account the first one (daily seasonality) can significantly improve the quality of the description of data. Taking into account the two latter cases require new CTRW models with memory and go beyond the scope of this article.

Nonstationarity
Varying mean inter-trade time during trading session is a stylized fact observed on stock prices on every market [50,55,56]. This intraday pattern, often called the "lunch effect", is characterized by low volatility and long intertrade times in the middle of the day. On the contrary, activity on the stock market is higher at the beginning and the end of a trading session. This effect influences both linear and nonlinear VAF of the process, as described in [54], where the general formula for the impact of this phenomenon is given. Following [54] we describe the daily pattern with the rational function where θ(t) can be interpreted as varying mean of the waiting times distribution during a trading session. Now, we can obtain an explicit expression for normalized VAF taking the seasonality into account: where T is the length of a day, parameters p and q are fitted to data and come from the rational form of day seasonality and erf is the error function. Unfortunately taking nonstationarity into account only slightly improves the results, making a difference that is within the line width in Figure 1 (solid line). This result implies that definitely it is not the daily volatility pattern that creates the disagreement between empirical and theoretical nonlinear VAF.

Conclusions
We proposed a methodology of calculating the general nonlinear VAF within the CTRW model, by creating specifically suited DCTRW. The nonlinear VAF of the CTRW can be obtained as linear VAF of the DCTRW. In the specific case of CTRW created to describe stock price in time, we solved DCTRW model with one-step memory in jumps and obtained the analytical equation for propagator, first two moments and VAF (21). The obtained nonlinear VAF shows interesting properties: it is positive; it decays exponentially but slower than the linear VAF; nonlinear VAF can be non-zero even without any memory ( = 0) for non-exponential WTD. Next, we considered nonstationarity in the form of rational function (22) and obtained analytical nonlinear VAF (23). The presented simple model turned out to be unable to describe empirical data (Fig. 1). This result implies that simple bid-ask bounce phenomenon is not sufficient to explain long memory in financial time series and volatility clustering. Moreover, taking into account the daily seasonality of the time series does not change this result.
The CTRW framework with memory in price increments seems to be a perfect tool to describe stock market price changes, but as our results suggest a different approach is necessary. In Figure 2, we present empirical step autocorrelation functions of waiting times and modules of price changes. Focusing on the correlation of two consecutive modules of price changes and two consecutive waiting times may suggest that the memory in price changes is more important and the dependence in waiting times can be neglected. Looking at the whole plot suggests exactly the opposite, as the autocorrelation in waiting times decays much slower than the autocorrelation of modules of price changes. We suggest that taking into account the long memory in waiting times would improve the results, but it is still a great challenge and an open problem.
Author contribution statement T. Gubiec set the idea for this paper, contributed to the calculations and discussed the results. J. Klamut did the calculations, data analysis and graphs. Both authors participated in the writing of the manuscript.
Open Access This is an open access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Appendix A: Closed-form of the soft propagatorP (K; s) In this Appendix, we present the details of derivation of the soft propagatorP (K; s) (11). Firstly, we recursively expand the integral in relation (8) using equations (6) and (7). We obtain the recurrence relation, expressing each n-step sharp propagators in terms of all sharp propagators with all smaller n. The one-step propagator can be calculated directly from its definitioñ As the type of recurrence relation is completely different than in work [35], we present a different method to solve this equation. Firstly, we do not need to know exactly each n-step propagator, our goal is to obtain the general propagator given by equation (10). By reordering and grouping the same step sharp propagators in summation of allQ n (K; s|ξ), one can calculate the general propagator: Q(K; s|ξ) =ψ 1 (s) (1 − )S(K; s)+ From that we can obtain the soft propagator using equation (9). and the rest of the variables are defined in main text. To obtain the final result given by equation (23) we have to calculate integrals above.