# Memory Effects, Multiple Time Scales and Local Stability in Langevin Models
of the S&P500 Market Correlation

Tobias Wand  Institut für Theoretische Physik, Westfälische Wilhelms-
Universität Münster Center for Nonlinear Science Münster, Westfälische
Wilhelms-Universität Münster  Corresponding author’s e-mail address:
<EMAIL_ADDRESS>Martin Heßler  Institut für Theoretische Physik,
Westfälische Wilhelms-Universität Münster Center for Nonlinear Science
Münster, Westfälische Wilhelms-Universität Münster  Oliver Kamps  Center for
Nonlinear Science Münster, Westfälische Wilhelms-Universität Münster

###### Abstract

The analysis of market correlations is crucial for optimal portfolio selection
of correlated assets, but their memory effects have often been neglected. In
this work, we analyse the mean market correlation of the S&P500 which
corresponds to the main market mode in principle component analysis. We fit a
generalised Langevin equation (GLE) to the data whose memory kernel implies
that there is a significant memory effect in the market correlation ranging
back at least three trading weeks. The memory kernel improves the forecasting
accuracy of the GLE compared to models without memory and hence, such a memory
effect has to be taken into account for optimal portfolio selection to
minimise risk or for predicting future correlations. Moreover, a Bayesian
resilience estimation provides further evidence for Non-Markovianity in the
data and suggests the existence of a hidden slow time scale that operates on
much slower times than the observed daily market data. Assuming that such a
slow time scale exists, our work supports previous research on the existence
of locally stable market states.

##### Keywords:

Langevin Equation, Econophysics, Bayesian Estimation, Memory Effects, Non-
Markovian Dynamics

##  1 Introduction

The S&P500 is an aggregated index of the stocks of the 500 largest companies
traded at US stock exchanges and therefore serves as an indicator of the
overall US economic performance. Estimating and predicting the correlation
between different assets is crucial for optimal portfolio selection and risk
management and has been the focus of financial research since Markowitz’s
portfolio theory [27].

Because the economy is a system with a large number of interacting parts
(traders and companies), it is amenable to the analysis tools from complex
systems science [25]. Due to the increasing availability of data for the
economy, highly data-driven methods can be applied in this field of research,
with many researchers choosing to focus on the correlations between the
relative price changes of different stocks, i.e. the correlations of the
stocks’ returns [4, 23, 26, 27, 28, 34]. In [32, 38, 45] the authors
identified states of the economy by analysing correlation matrices of daily
S&P 500 data and found eight clusters. These can be interpreted as economic
states reflecting e.g. times of economic growth or crises [32] and are found
to be locally stable [38, 45]. Further analyses showed that exogenous events,
precursors for crises and collective market behaviour can also be identified
via the correlation matrix approach [14, 13, 15].

Ever since Bachelier’s seminal work introduced the random walk model to
describe stock prices [2], the inherent stochasticity of financial data has
been taken into account by researchers and practitioners alike. The Langevin
equation is a model for stochastic differential equations that includes a
deterministic drift and a random diffusion and can be used to describe such
stochastic data. Much research has been devoted to estimating Langevin
equations from data [7, 43, 35, 6, 36, 20, 54] and Langevin equations have
found applications in various fields of research such as fluid dynamics [42],
molecular dynamics [21] and meteorology [5] (cf. [8] for a review of
applications). The generalised Langevin equation (GLE) expands the Langevin
model by introducing a kernel function to include memory effects [31].
Bayesian statistics includes a collection of methods that reverse the
classical approach to statistics and focuses on calculating posterior
distributions of model parameters as probabilities conditional on the observed
data [44, 49]. This approach enables an efficient estimation of Non-Markovian
Langevin equations [53, 52]. Also, other time series analysis methods can be
implemented in the Bayesian frame work to e.g. detect change points in time
series data [18].
We show that an estimated GLE model manages to achieve a high goodness-of-fit
for the correlation time series and implies a strong memory effect which has
to be taken into account when predicting future market correlations.
Furthermore, we perform a detailed comparison of a Markovian mono-time scale
and a Non-Markovian two-time scale model with a hidden slow time scale which
confirms the GLE analysis results regarding Non-Markovian memory effects.
Additionally, the analysis supports the local quasi-stationary economic state
theory discussed in Stepanov et al. [45] and provides some evidence that a
hidden slow time scale might be involved in the mean market correlation
dynamics. It is not far-fetched to assume that a complex system like the human
economy involves a multitude of time scales and our findings coincide with
such reasoning. The slow time scales might be connected to business and
innovation cycles or similar economic dynamical mechanisms even though we
could not extract a quantitatively reasonable magnitude of the hidden slow
time scale.
The remainder of this article is structured as follows: Section 2 explains the
data gathering and preprocessing in 2.1, the Bayesian methodology in 2.2, the
GLE estimation procedure in 2.3 and the resilience analysis in subsection 2.4.
Section 3 describes the goodness-of-fit and the estimated memory parameters
for the GLE model in 3.1 as well as the resilience results including the two-
time scale discussion in section 3.2. Finally, the results of these analyses
are interpreted and compared to the results from [45] in section 4.

##  2 Data and Methods

###  2.1 Data Preparation

The S&P 500 is a stock index containing 500 large US companies traded at
American stock exchanges. Daily stock data from these companies were
downloaded via the Python package yfinance [1] for the time period between
1992 and 2012, which is the same time period as in [38]. Only stock data of
companies that were part of the S&P 500 index during at least 99.5% of the
time were used for this analysis. If a company’s price time series $P_{t}$ is
not available for the full time period, the remaining 0.5% of the price time
series data are interpolated linearly with the .interpolate() method in pandas
[37, 30]. Overall, there are 249 companies’ time series for 5291 trading days
with one observation per date. Each company’s returns
$R_{t}=(P_{t+1}-P_{t})/P_{t}$ are locally normalised to remedy the impact of
sudden changes in the drift of the time series with the method introduced in
[39] as

$r_{t}=\frac{R_{t}-\langle R_{t}\rangle_{n}}{\sqrt{\langle
R^{2}_{t}\rangle_{n}-\langle R_{t}\rangle^{2}_{n}}}.$ (1)

Here, $\langle\dots\rangle_{n}$ denotes a local mean across the $n$ most
recent data points, i.e. $r_{t}$ is subjected to a standard normalisation
transformation with respect to the local mean and standard deviation (i.e.
volatility $\sigma$). Following [32], $n=13$ was chosen for the daily data.
For each time step $t$ and each pair of sectors $i,j$ the local correlation
coefficients

$C_{i,j}=\frac{\langle r^{(i)}_{t}r^{(j)}_{t}\rangle_{\tau}-\langle
r^{(i)}_{t}\rangle_{\tau}\langle
r^{(j)}_{t}\rangle_{\tau}}{\sigma^{(i)}_{\tau}\sigma^{(j)}_{\tau}}$ (2)

are calculated over a time period of $\tau=42$ trading days like in [32] (the
42 working days correspond to 2 trading months) with the local standard
deviations $\sigma^{(i)}_{\tau}$. As shown via Principle Component Analysis in
[45], the mean correlation

$\bar{C}=\frac{1}{N}\sum_{\textmd{i,j}}C_{i,j}$ (3)

already describes much of the variability in the data. Hence, it makes sense
to restrict the analysis to this one-dimensional time series $\bar{C}(t)$
(shown in figure 1). The time $t$ is here selected as the central value of the
time window of length $\tau$ in order to have a symmetrical window. The
preprocessed time series is available via [50].

Figure 1: The mean correlation of the S&P500 market calculated. The time
series are the mean values of correlation matrices which were calculated based
on moving windows of length $\tau$ days plotted against the centre of the
$\tau$-days-interval. This figure depicts $\tau=5$ and $\tau=42$.

###  2.2 Bayesian Statistics

Bayes’ theorem for the conditional probability distributions $f(\cdot|\cdot)$
of model parameters $\theta$ and observed data

$f_{post}(\theta|x)\sim f_{prior}(\theta)f(x|\theta)$ (4)

connects the standard statistical likelihood $f(x|\theta)$ and prior knowledge
about the model parameters $f_{prior}$ to a posterior distribution $f_{post}$
of the unknown model parameters conditional on the observed data [24]. A
bundle of methods have been derived from this approach and are collectively
referred to as Bayesian Statistics [44, 49]. Markov chain Monte Carlo
algorithms (MCMC) can be used to infer the posterior distribution by
simulating several random walkers that explore the (potentially high-
dimensional) posterior distribution [11]. It generates samples of the model
parameters which are uncorrelated after cutting off the first $n_{burn}$
exploration steps as a burn-in period and thinning the remaining samples. The
resulting MCMC samples can also be used to integrate the posterior
distribution over all but one model parameter $\theta_{i}$ to derive the
marginal posterior distribution $f(\theta_{i}|x)$ of this single parameter.
Parameter estimation can then be done via the mean of the posterior
distribution or via its maximum (abbreviated as MAP for maximum a posteriori)
and credible intervals (CIs) of e.g. $95\%$ credibility can be directly
derived from the quantiles of the samples for $\theta_{i}$.

###  2.3 Fitting a Generalised Langevin Equation with Memory Kernel

Sections 4 and 5 of [45] analyse the one-dimensional mean correlation time
series by fitting a Langevin model

$\odv{\bar{C}}{t}(t)=D^{(1)}\left(\bar{C},t\right)+\sqrt{D^{(2)}\left(\bar{C}\right)}\Gamma(t)$
(5)

with independent Gaussian noise $\Gamma$, a deterministic time-dependent drift
function $D^{(1)}$ and a time-independent diffusion function $D^{(2)}$. Note
that the Langevin equation is a Markovian model, i.e. it has no memory. As an
alternative model, a Generalised Langevin Equation (GLE) includes previous
values of the time series in a memory kernel $\mathcal{K}$, but has only time-
independent parameters with a functional equation

$\odv{\bar{C}}{t}(t)=D^{(1)}\left(\bar{C}\right)+\int_{s=0}^{t}\mathcal{K}(s)\bar{C}(t-s)\mathop{}\\!\mathrm{d}s+\sqrt{D^{(2)}\left(\bar{C}\right)}\Gamma(t).$
(6)

A Bayesian estimation of the parameters of equation $\eqref{eq:GLE}$ is
implemented in [53]. It discretises the memory kernel $\mathcal{K}(k)$ to
$\mathcal{K}_{k}$ and discretises the observed data into $n_{B}$ different
bins to significantly speed up the estimation procedure. Because an overlap of
the windows used to calculate $\bar{C}$ can lead to artefacts in the memory
effects (cf. section A in the appendix), we choose to calculate $\bar{C}$ with
different parameters than $\tau=42$ and $s=1$ from [45] (every $s^{th}$ is
retained for the analysis and hence for $s=1$, the full time series is used).
Instead, we set $\tau=5$ and $s=5$, meaning that the mean market correlation
$\bar{C}$ is calculated over one trading week for the end of the trading week
in disjoint windows (i.e. we create a time series whose length is $1/s=20\%$
of the original time series). Because using disjoint intervals automatically
leads to a thinning of the time series, this seemed like a useful trade-off
with a real-world interpretation as weekly correlation. Note that although
only five trading days contribute to the calculation of $\bar{C}$, there is
still an order of magnitude of $10^{4}$ correlations $C_{i,j}$ whose mean
value is the desired $\bar{C}$. I.e. although only a short time window is used
to calculate each of the $(i,j)$ correlation pairs, the sheer size of the
ensemble of $C_{i,j}$ reaffirms our trust in the accuracy of their mean
$\bar{C}$. The resulting time series is shown in figure 1 together with the
time series used in [45] and although it obviously becomes much noisier due to
the shorter window size, it still retains some of the features of the less
noisy time series like e.g. the position of spikes with high correlation.

As described in [53], the memory effects are aggregated to a quantity $K_{k}$
(named $\kappa_{k}$ in [53]) that measures the strength of all memory effects
from $1$ up to $k$ time steps ago. If $K_{k}$ saturates towards a plateau at
step $k_{0}$, then $k_{0}$ is the maximum length of any reasonable memory
kernel. This often also coincides with kernel values of
$\mathcal{K}_{k_{0}}\approx 0$ at $k_{0}$. The estimated values for the model
parameters are chosen by calculating the marginal posterior distribution and
choosing the mean or MAP parameter estimation. The goodness-of-fit is also
evaluated by using MCMC to simulate an artificial time series
$\bar{C}^{(a)}_{t}$ with the estimated model and comparing the autocorrelation
function and the distributions of $\bar{C}^{(a)}_{t}$ and the increments
$\bar{C}^{(a)}_{t}-\bar{C}^{(a)}_{t-j}$ to those of the original data.
Finally, the inferred model structure can be trained on only a subset of the
data (training data) and be used to predict the remaining test data to
evaluate its predictive performance.

###  2.4 Resilience Estimation

By applying Bayes’ theorem (4) we can deduce a quantitative measure of
resilience under given model assumptions. Therefore, we infer the parameters
of two models of stochastic differential equations in a rolling window
approach that allows for resolving the time evolution of the resilience and
noise level and accounts for the quasi-stationary nature of the time series
that is observed in Stepanov et al. [45]. Following the quasi-stationarity
argument we assume to be in a fixed state per window, i.e. the fixed point
$\bar{C}^{*}$ which is approximated by averaging over the mean market
correlation data per window. First, we estimate a Markovian Langevin equation
(5) with the Taylor-expanded drift

$\displaystyle D_{\bar{C}}^{(1)}(\bar{C}(t),t)$
$\displaystyle=\alpha_{0}(t)+\alpha_{1}(t)(\bar{C}-\bar{C}^{*})+\alpha_{2}(t)(\bar{C}-\bar{C}^{*})^{2}+\alpha_{3}(t)(\bar{C}-\bar{C}^{*})^{3}+\mathcal{O}(\bar{C}^{4})$
(7)
$\displaystyle=\theta_{0}(t;\bar{C}^{*})+\theta_{1}(t;\bar{C}^{*})\cdot\bar{C}+\theta_{2}(t;\bar{C}^{*})\cdot\bar{C}^{2}+\theta_{3}(t;\bar{C}^{*})\cdot\bar{C}^{3}+\mathcal{O}(\bar{C}^{4})$
(8)

with the drift parameters
$\theta_{0,...,3}(t;\bar{C}^{*})\equiv\theta_{0,...,3}(\bar{C}^{*})$ per
rolling window and the constant diffusion
$D^{(2)}(\bar{C})=\theta_{4}^{2}\equiv const.=:\sigma^{2}$. We choose
uninformed priors which are given by

$\displaystyle p_{\rm
prior}(\theta_{0},\theta_{1})=\frac{1}{2\pi(1+\theta_{1}^{2})^{\frac{3}{2}}}$
(9)

for the linear part of the drift function and the Jeffreys scale prior [49]

$\displaystyle p_{\rm prior}(\theta_{4})=\frac{1}{\theta_{4}}$ (10)

for the noise level $\theta_{4}$ with suitable prior ranges. The priors of
higher order parameters are chosen to be

$\displaystyle p_{\rm
prior}(\theta_{2})=\mathcal{N}(\mu=0,\tilde{\sigma}=4)\text{ and }$ (11)
$\displaystyle p_{\rm prior}(\theta_{3})=\mathcal{N}(\mu=0,\tilde{\sigma}=8)$
(12)

with Gaussian distributions $\mathcal{N}$ centred around the mean $\mu=0$ with
a standard deviation $\tilde{\sigma}=4$ and $\tilde{\sigma}=8$.
Since we consider economic systems to operate on multiple time scales which
concurrently lead often to Non-Markovian time series, we additionally
introduce a two-dimensional Non-Markovian model analogue to Willers and Kamps
[54]. The model takes the form

$\displaystyle\odv{\bar{C}(t)}{t}$
$\displaystyle=D_{\bar{C}}^{(1)}(\bar{C},t)+\sqrt{D_{\bar{C}}^{(2)}(\bar{C},t)}\cdot\lambda$
(13) $\displaystyle\odv{\lambda(t)}{t}$
$\displaystyle=D_{\lambda}^{(1)}(\lambda,t)+\sqrt{D_{\lambda}^{(2)}(\lambda,t)}\cdot\Gamma(t)$
(14)

with a hidden Ornstein-Uhlenbeck process (OU-process) $\lambda$, drift
$D_{\lambda}^{(1)}(\lambda,t)=-\frac{1}{\theta_{5}^{2}}\cdot\lambda$ and
diffusion $D_{\lambda}^{(2)}(\lambda,t)=\frac{1}{\theta_{5}^{2}}$. Drift
$D_{\bar{C}}^{(1)}(\bar{C},t)$ and diffusion $D_{\bar{C}}^{(2)}(\bar{C},t)$ of
the observed process $\bar{C}(t)$ remain unchanged. The Non-Markovian analogue
to the constant noise level $\sigma^{2}$ of the Langevin equation is given by
the composite noise level

$\displaystyle\Psi=\sqrt{D_{\bar{C}}^{(2)}(\bar{C},t)}\cdot\sqrt{D_{\lambda}^{(2)}(\lambda,t)}\cdot
h$ (15)

with the small discrete sampling time step $h$.
For the OU-process, an invariant prior of a straight line and a scale prior
for the diffusion are multiplied:

$\displaystyle p_{\rm
prior}(\theta_{5})=\frac{\theta_{5}}{2\pi\left(1+\left(-\frac{1}{\theta_{5}}\right)^{2}\right)^{\frac{3}{2}}}.$
(16)

Furthermore, via the prior we introduce a pre-defined time scale separation of
the time scales $\tau_{\bar{C}}$ and $\tau_{\lambda}$ of the observed and
unobserved process, respectively, i.e. we require either
$\tau_{\bar{C}}>\gamma\cdot\tau_{\lambda}$ or
$\tau_{\lambda}>\gamma\cdot\tau_{\bar{C}}$ with a scale separation coefficient
$\gamma$. The characteristic time scales [46] are approximated by

$\displaystyle\tau_{\nu}=\left|\left.\left(\odv{D_{\nu}^{(1)}(\nu,t)}{\nu}\right)^{-1}\right|\right|_{\nu=\nu^{*}}\qquad\text{
with }\nu\in\\{\bar{C},\lambda\\}.$ (17)

The priors for the model of the observed data $\bar{C}(t)$ remain unchanged as
well apart from the term $D_{\bar{C}}^{(2)}(\bar{C},t)=\theta_{4}^{2}$ which
corresponds to a coupling constant in the Non-Markovian model. We simply apply
a Gaussian prior like the one in equation (11) to $\theta_{4}$ in this case.
Inspired by the formalism of linear stability analysis for both models we
calculate the drift slope

$\zeta=\left.\frac{\text{d}D_{\bar{C}}^{(1)}(\bar{C})}{\text{d}\bar{C}}\right|_{\bar{C}=\bar{C}^{*}}$
(18)

per window as a Bayesian parametric resilience measure. For the Markovian
model the calculations are performed with the open-source Python toolkit
antiCPy [16, 17]. In this modelling framework, a stable state corresponds to a
negative drift slope $\zeta$, whereas a changing sign indicates
destabilisation via a bifurcation. More details on the procedure can be found
in [18].

##  3 Results

###  3.1 Estimated GLE Model

The data is split into $n_{B}=10$ equally wide bins and an initial modelling
attempt with a rather long kernel $k_{\max}=10$ is tested, i.e.
$\mathcal{K}_{q}=0$ for all $q>k_{\max}$. It shows a plateau emerging at
around $k\geq 6$ (cf. appendix B). Hence, a model with $k_{\max}=6$ is used as
a reasonable length for the memory kernel and its goodness-of-fit is
evaluated. We then use a very conservative estimation of the memory up to
$k_{\max}=3$ to evaluate the GLE’s predictive power.

####  3.1.1 Goodness-of-fit

A time series of length $10^{5}$ is simulated via Euler-Maruyama integration
of the GLE model to compute the autocorrelation function (ACF) and to compare
it to the ACF of the original time series. The best model is chosen via MAP
estimation in the Bayesian framework of [53], but selecting the mean
estimation yields almost identical results. Both ACFs are computed via the
function statsmodels.tsa.stattools.acf from the Python package statsmodels
[41]. Figure 2 shows that the two ACFs show very good agreement up to lags of
10 trading weeks and decent agreement up to lags of 20 weeks. The
distributions of the time series and the first two increments for the original
and the simulated data are shown in figure 3 for the MAP estimation and also
for the mean estimation. Figure 3 shows an almost perfect overlap between the
two estimation procedures and a good agreement between the estimated time
series and the original time series, especially for the increment
distributions. Overall, these diagnostics indicate that the estimated model
with memory kernel length $6$ manages to reproduce these important statistical
properties of the original time series.

Figure 2: Comparison between the autocorrelation functions of the original
time series (solid line) and the simulated data from the model with kernel
length $6$ (dashed line) simulated via MAP estimation of the MCMC-integrated
marginal densities. Up to lag $30$, the ACFs show good agreement. The
alternative simulation via mean estimation of the density yields an almost
identical ACF. However, the ACF based on the model with no memory kernel
(dotted line) fails to capture the empirical ACF. Figure 3: KDE plots to
compare the distributions between the real data and the MCMC samples for the
two estimated GLE models with kernel length 6 for the time series data
$\bar{C}_{t}$ (left), the increments $\bar{C}_{t}-\bar{C}_{t-1}$ (centre) and
$\bar{C}_{t}-\bar{C}_{t-2}$ (right). Differences between the two simulated
models are hardly visible and overall, there is a good overlap with the real
data. For the LE without memory, the respective distributions are depicted in
appendix C.

Because the realised values of the time series $\bar{C}$ are not distributed
uniformly, we also use a modelling procedure with unequal bin widths so that
each of the $10$ bins has the same amount of data. However, this barely
changes the model diagnostics shown in figures 2 and 3. The only noticeable
change is that for long kernels with length $\geq 10$, the ACF seems to be
captured a little worse in the shown range of figure 2, but manages to fit
more closely to the empirical ACF for large lags at around $r\approx 100$.
While the regular LE without memory has a very similar increment distribution,
the ACF is much worse than for the GLE.

####  3.1.2 Estimated Memory Kernel

To make further inference on the memory kernel and to estimate its
quantitative effect, the posterior distribution of the model with memory
length 6 is sampled via MCMC. 100 walkers are simulated for $10^{5}$ time
steps and after a burn-in period of 450 initial time steps is discarded, the
chains are thinned by only keeping every $450^{\textmd{th}}$ step to obtain
uncorrelated samples. Bayesian CIs can now be calculated at the $95\%$ level
for each parameter in the kernel function and the results are shown in figure
4.
The CIs of $\mathcal{K}_{4}$ are already very close to the zero line and those
of $\mathcal{K}_{5}$ include zero, meaning that there is no evidence for a
memory term at five weeks distance. Interestingly, the CIs for
$\mathcal{K}_{6}$ clearly exclude the value zero. Because it is difficult to
exactly identify the beginning of the plateau in the memory aggregation in
figure 9, it may be possible that the plateau already emerges at $k=5$ and
that the nonzero memory kernel $\mathcal{K}_{6}$ is therefore unreliable.
However, the results in figure 4 clearly imply a nonzero memory effect for
four time steps with a clearly nonzero effect strength for memories up to
$k=3$ trading weeks.

Figure 4: Values for the memory kernel $\mathcal{K}_{k}$ in the model with
memory length 6. Credible intervals were estimated via MCMC at the 95% level.
The inclusion of 0 in the credible interval of $\mathcal{K}_{5}$ combined with
the uncertainty about the beginning of the plateau in figure 9 imply that the
nonzero memory effect for $\mathcal{K}_{6}$ may be misleading. All previous
memory kernels $\mathcal{K}_{1,2,3,4}$ have nonzero values at the 95%
credibility level.

####  3.1.3 Prediction via the GLE with Kernel Length 3

With a conservative interpretation of the results in section 3.1.2, a model
with memory length $k=3$ is used to evaluate the GLE’s power to predict a
future value $y_{t+1}$ by forecasting an accurate prediction $\hat{y}_{t+1}$.
It is tested against a regular Langevin equation (LE) model without any memory
effects (corresponding to $k=0$ and also estimated with the code in [53]) and
against the naive benchmark of predicting the next time step $y_{t+1}$ by
simply setting it to the last previously known value: $\hat{y}_{t+1}=y_{t}$.
To test these three methods, the Langevin models are trained on the first
$\alpha\%$ of the time series (the training data) and the predictions of the
GLE, the LE and the naive forecast are evaluated on both the training data (as
in-sample predictions) and on the remaining $1-\alpha\%$ test data (as out-of-
sample predictions). The coefficient of prediction $\rho^{2}$ is used to
evaluate their predictive accuracy. If $n$ observations $y_{1,\dots,n}$ are
forecasted as $\hat{y}_{1,\dots,n}$, then the coefficient of prediction is
given by

$\rho^{2}=1-\frac{\sum_{i=1}^{n}(\hat{y}_{i}-y_{i})^{2}}{\sum_{i=1}^{n}(\bar{y}-y_{i})^{2}}$
(19)

with the $\bar{y}$ denoting the mean value. It takes the value of
$\rho^{2}=1$, if the prediction is always exactly true, and $\rho^{2}=0$, if
the prediction is only as accurate as always using the mean $\bar{y}$, and
$\rho^{2}<0$, if it is less accurate than using the mean and is computed via
the function sklearn.metrics.r2_score from [33]. The results in table 3.1.3
show that the GLE model consistently achieves the highest accuracy on in-
sample and out-of-sample predictions for the three chosen test data sizes.
Notably, the negative $\rho^{2}$ of the naive method for the test data
indicates that the out-of-sample prediction is by no means trivial, meaning
that the low, but positive $\rho^{2}$ of the GLE on the test data is
nevertheless a good performance. The GLE achieves slightly better results than
the LE, indicating that the memory effect should be taken into account for
prediction tasks. Figure 5 shows the predictions of the LE and GLE for the in-
sample and out-of-sample predictions with $\alpha=90\%$. The same visual
comparison between naive forecast and the GLE can be found in the appendix D.

Model $\alpha$ | In-Sample | Out-Of-Sample
---|---|---
80% | 85% | 90% | 80% | 85% | 90%
Naive | 0.07 | 0.15 | 0.19 | -0.21 | -0.15 | -0.11
LE | 0.29 | 0.32 | 0.35 | -0.14 | -0.01 | 0.08
GLE | 0.39 | 0.42 | 0.45 | 0.01 | 0.08 | 0.10

Table 1: Comparing the predictions of the naive forecast
$\hat{y}_{t+1}=y_{t}$, the Langevin equation (LE) and the GLE with memory
kernel length $k=3$ via their $\rho^{2}$ score on in-sample training data and
out-of-sample test data ($\alpha\%$ training data and the last $1-\alpha\%$ of
the time series as test data). Note that the partially negative $\rho^{2}$ for
the test data indicates that the test data is quite difficult to predict,
which corresponds to the high fluctuations in the final part of the time
series in figure 1.

Figure 5: Comparison between one-step-ahead forecasts of the GLE model with
Kernel against a regular Langevin estimation without memory effects on the
training data (left) and the test data (right). The identity $f(x)=x$ is given
as a benchmark for perfect predictive accuracy. Here, $\alpha=90\%$ of the
time series were used as training data.

###  3.2 Hidden Slow Time Scale and Non-Markovianity

Applying the resilience analysis method, described in subsection 2.4, we can
deduce some interesting evidence for multiple time scales and further
confirmation of Non-Markovianity present in the considered economic time
series. The results for both the simple Markovian and multi-scale Non-
Markovian model (cf. (5) and (13), respectively) are compared in figure 6
(a-c). For better readability the parameters of the calculations are listed in
table 2 of appendix E.

Figure 6: Results of the resilience analyses based on the Markovian Langevin
equation 5 and the Non-Markovian model 13 with an unobserved slow time scale
$\tau_{\lambda}$, i.e. under the prior assumption
$\tau_{\lambda}>2\cdot\tau_{\bar{C}}$: (a) For the mean market correlation
$\bar{C}(t)$. (d) For a synthetic dataset $x$ that shares the multi-scaling
features and Non-Markovianity with the economic time series $\bar{C}(t)$. (b)
The Markovian model suggests persistent latent instability, i.e.
$\hat{\zeta}\approx 0$, whereas the Non-Markovian slopes agree with locally
quasi-stationary economic states as observed in Stepanov et al. [45]. (c) The
noise level estimates are almost identical and tend to increase over time
which might reflect more turbulent economic times towards the the financial
crisis 2008. The plateau of ca. one rolling window length around 1998 might be
due to the incorporation of some outliers in the time of the ending Asian
crisis and the beginning of the Russian financial crisis. (e) Drift slope
results of the synthetic dataset $x$ analogue to (b). The qualitative results
are in good agreement to (b) which might be a hint that the mean market
correlation $\bar{C}(t)$ exhibits Non-Markovian features and is additionally
governed by processes on a slower time scale $\tau_{\lambda}$. (f) The
estimated noise levels of the synthetic dataset $x$ are almost identical which
is also observed for the noise levels of the mean market correlation
$\bar{C}(t)$ in (c). For more details see the running text.

Stepanov et al. [45] argue for quasi-stationary economic states which are
occupied over finite time periods, before they transition into another quasi-
stationary economic state. The approximated state potentials from the mean
market correlation in the article [45] suggest that there might be shifts in
the fixed point positions over time, but no bifurcation-induced tipping
(B-tipping) is involved, i.e. no qualitative change of stable and unstable
fixed points or attractors is observed. Instead of B-tipping mechanisms, the
intrinsic economic stochasticity drives the jumps between alternative quasi-
stationary states, which is a mechanism basically related to noise-induced
tipping (N-tipping). If we choose a model that captures the key features of
the data generating process, we should thus be able to uncover generally
negative drift slope estimates $\hat{\zeta}$, corresponding to data of a
locally quasi-stationary state in each rolling window of the mean market
correlation $\bar{C}(t)$ the data of which is shown again in figure 6 (a). In
this spirit, we find the Non-Markovian model with an unobserved slow time
scale, i.e. $\tau_{\lambda}>\gamma\cdot\tau_{\bar{C}}$ with $\gamma=2$, to
yield the expected result of negative drift slope estimates $\hat{\zeta}$ as
presented in figure 6 (b) and indicated by the red solid line with green
credibility bands (CBs). This result is supported by rather intuitive
qualitative considerations: Economic processes are well-known to operate on
various fast and slow time scales, on the one hand e.g. high frequency
trading, trading psychology and sudden external events, whether that might be
political, sociological, severe weather or other impacts. These fast-scale
processes could be termed as “economic weather” in a climatologist’s metaphor.
On the other hand, long-term “economic climate evolution” takes place on much
slower time-scales. Examples could be innovation processes and technical
revolutions like the invention of the steam engine or the internet, economic
cycle theories like that of Marx
($\tau\sim$2\text{\,}\mathrm{a}10\text{\,}\mathrm{a}$$) [29, 10], Keynes,
Schumpeter or Kondratjew [3, 22, 40], cycles of fiscal and demographic
developments [48], cultural evolution [51] and generation changes influencing
economic reasoning, adaptions to climate change and the scarcity of resources
and much more. Keeping that in mind, the trading day resolution of the data is
rather fine-grained and it might be reasonable to assume that a hidden slow
time scale is present in the data. The slow time scale of the presented Non-
Markov model is determined by the upper boundary of the prior range which is
chosen to correspond roughly to $6\text{\,}\mathrm{a}$ which is the time of an
average business cycle and coincides with the first zero-crossing of the
autocorrelation function of the mean market correlation $\bar{C}(t)$. If the
prior is chosen broader the model converges to roughly
$700\text{\,}\mathrm{a}4000\text{\,}\mathrm{a}$ which is not a plausible
magnitude of the time scale of economic evolution (cf. Appendix E). However,
the main results of local quasi-stationary economic states is not affected by
the prior choice. The estimation of a more reasonable magnitude of the slow
time scale without prior restriction might be prohibited by the very limited
amount of data per window, since the window range does not even include one
complete business cycle which would be the smallest proposed slow time scale
candidate. Further note that the two-time scale Non-Markovian model in eq.
(13) incorporates noise in the slow non-observed variable $\lambda$. In that
way it could formally reflect intermediate dynamics on a time scale $\tau_{\rm
N}$ with $\tau_{\bar{C}}<\tau_{\rm N}<\tau_{\lambda}$. But since it is coupled
to the mean market correlation $\bar{C}(t)$ on trading day resolution, we
consider the noise operating on a time scale $\tau_{\rm N}<\tau_{\bar{C}}$. In
contrast to the multi-scale Non-Markovian model, the mono-scale Markovian
model cannot reflect the local quasi-stationarity of the economic states,
postulated in Stepanov et al. [45], but the drift slope estimates
$\hat{\zeta}$, indicated by the blue solid line with orange CBs in figure 6
(b), suggest persistently latent instability with $\hat{\zeta}\approx 0$. The
noise analogues $\sigma$ and $\Psi$ of the Markovian and Non-Markovian model,
respectively, are almost identical as observable in figure 6 (c) following the
same color-coding. The noise level seems to increase over the years with a
clear increase in the periods of the global financial crisis and the Euro
crisis which accounts for a higher N-tipping probability in this highly
turbulent economic period. The noise plateau of roughly one window length
around the end of the Asian and the beginning of the Russian financial crises
around 1998 is probably the results of the outliers that are incorporated into
the windows.

Since the discussed observations alone only allow for relatively weak
qualitative deduction of the discussed features of multi-scaling and Non-
Markovianity, we additionally perform an analogous analysis on a synthetic
time series $x$ that shares the key features of a hidden slow time scale and
Non-Markovianity with the original one. In figure 7 we provide a comparison of
the per definition stationary first differences, (a) of the original mean
market correlation $\bar{C}(t)$ and (b), of the synthetic time series $x$. The
noise level in $x$ is assumed to increase over time to mirror the noise level
evolution of the mean market correlation $\bar{C}(t)$, suggested by the
estimates in figure 6 (c), and is adjusted to cover almost the range of the
first differences in $\bar{C}(t)$. Only the positive trend of the mean market
correlation visible in figure 6 (a) is not included in the simulations of $x$.
In that way the PDFs of the two time series’ first differences are shaped
similar apart from the fact that the highly centered probability mass of the
mean market correlation $\bar{C}(t)$ with steep tails due to rare outliers is
a bit more smeared out into flatter tails of the synthetic time series $x$.
More simulation details can be found in the Appendix E.

Figure 7: First differences (FD) and corresponding PDFs of the raw mean market
correlation data $\bar{C}(t)$ and the synthetic dataset $x$ which shares the
key features of Non-Markovianity and an unobserved slow time scale with the
mean market correlation data $\bar{C}(t)$. (a) The FDs of the mean market
correlation are highly centered around zero with some outliers. (b) The FD
capture essentially the same range as the FDs of $\bar{C}(t)$, but are less
centered arount zero. The time series is modeled with increasing coupling
strength to imitate the increase of the noise level found for the mean market
correlation $\bar{C}(t)$ in figure 6 (c). (c) The FD PDFs of both time series
are comparable. The PDFs only deviate to some extent in the flatter tails of
the synthetic orange histogram with less dense probability density around
zero. The positive trend of $\bar{C}(t)$ is not modelled in the simulated time
series $x$.

The resilience analyses on the synthetic time series $x$ are shown in figure 6
(d-f) and are in very good agreement to the original analyses results in
figure 6 (a-c). That appears at least as an independent qualitative
confirmation of our findings’ interpretation. Moreover, this interpretation is
supported by two additional facts: First, the estimation of a Markovian model
on the Gaussian kernel detrended version of the mean market correlation
$\bar{C}(t)$ results in similar results to the multi-scale Non-Markovian
model. This strengthens our previous findings, because the detrending
subtracts a non-stationary slow process suspected to be present in the data.
We notice that weaker detrending leads to positive trends in the drift slope
estimates $\hat{\zeta}$ which could be due to increasing distortions due to
incomplete detrending of the non-stationarity. Second, we fit a multi-scale
Non-Markovian model with inverse time scale separation
$\tau_{\bar{C}}>\gamma\cdot\tau_{\lambda}$ with $\gamma=2$ (i.e. the observed
trading day time scale of the mean market correlation $\bar{C}(t)$ is
considered to be at least two times slower than the hidden time scale). This
leads to results similar to the Markovian model with and without detrending.
This is an expected result, since the prior restriction of the time scale
separation basically restricts the model to the Markovian case in which only
the trading day time scale can be resolved apart from an even faster
stochastic contribution. In other words, the prior assumption
$\tau_{\bar{C}}>\gamma\cdot\tau_{\lambda}$ with $\gamma=2$ prohibits the
incorporation of an unobserved slower time scale even if it is present in the
data. The discussed results are presented in more detail in Appendix E.

##  4 Discussion and Conclusion

The estimated GLE model manages to reproduce the statistical properties of the
original data for the end-of-week correlations as shown in figs. 2 and 3. The
estimated memory kernel parameters show that even with a highly conservative
interpretation of the 95% credible level, there are clearly nonzero memory
effects for memory terms for all lags as far back as a lag of 3 weeks.
Therefore, it is advised to use a model with memory to describe the
correlation of the S&P500 market, which is an improvement to the Markovian
Langevin model estimated in [45]. Moreover, the GLE estimation presented in
this article achieves a high goodness-of-fit for the entire time series,
whereas Stepanov et al. used a time-dependent Langevin model by splitting the
time series into different intervals and estimating Markovian Langevin
equations for each of them. Our work shows that this procedure can be
circumvented by using a model with memory of at least 3 trading weeks. The
major advantage of our method is its possible application in predicting future
market correlation: The time-dependent drift estimation in [45] has no clear
or smooth functional dependence on time and therefore, little information can
be inferred about future values of the correlation time series. Our method
needs no time dependency, generalises over the entire time series and can be
used to predict future correlation values which can be used for portfolio risk
assessment. As shown in section 3.1.3, the memory kernel helps the GLE to
achieve better prediction accuracy than the regular Langevin equation and much
better results than the naive forecasting method of using the last observation
as the predicted value. Notably, the existence of memory effects in the
market’s correlation structure can be interpreted in the context of volatility
clustering. It is a well-known stylised fact from empirical research on
financial markets that the volatility of a stock’s returns tends to cluster:
periods of high volatility are often followed by periods of high volatility
and vice versa for low volatility [9, 12]. The correlation $\rho_{X,Y}$
between two asset returns $r_{X}$ and $r_{Y}$ with expectation values
$\mu_{X},\mu_{Y}$ and volatilities $\sigma_{X},\sigma_{Y}$ with is defined as

$\rho_{X,Y}=\frac{\mathbb{E}\left[(X-\mu_{X})(Y-\mu_{Y})\right]}{\sigma_{X}\sigma_{Y}}$
(20)

and therefore directly includes the volatility values $\sigma_{X}$ and
$\sigma_{Y}$. Because the time series of volatility estimators $\sigma_{X}(t)$
shows a well-known memory effect, it is not far-fetched to assume a similar
memory effect in the correlations $\rho_{X,Y}$ between two assets or, as we
have discussed in this article, in the mean correlation of the market as a
whole.

These considerations are complemented by a resilience analysis that involves
the estimation of a mono-time scale Markovian model and a two-time scale Non-
Markovian model. In contrast to the memoryless Markovian model, only the Non-
Markovian model exhibits the negative drift slopes which are in line with the
hypothesis of locally quasi-stationary economic states postulated and observed
in Stepanov et al. [45]. An independent change point analysis approach also
supports this view [19]. Overall, these findings provide new evidence for the
existence of such locally quasi-stationary economic states and for the
presence of a significant non-Markovian memory effect. Interestingly, the
resilience analysis yields some evidence that a second time scale which is
slower than the trading day time scale of the mean market correlation data, is
involved in the underlying economic dynamics. Economic processes operate on
various fast and slow time scales, e.g. day trading, trading psychology and
sudden external events — whether that might be political, sociologic, severe
weather or other impacts — may be incorporated in the fast trading day
resolution of the mean market correlation data. We refer to these fast-scale
processes in terms of “economic weather” to employ a metaphor from climatology
(cf. also the distinction in climate-like and weather-like tasks in [47]). In
contrast, the long-term evolution of the “economic climate” might involve
innovation processes and technical revolutions like the invention of the steam
engine or the internet, economic cycle theories like that of Marx
($\tau\sim$2\text{\,}\mathrm{a}10\text{\,}\mathrm{a}$$), Keynes, Schumpeter or
Kondratjew [29, 10, 3, 40, 22, 48], cultural evolution [51] and generational
changes influencing economic reasoning, adaptions to climate change and the
scarcity of resources and much more. However, we were not able to derive an
economically reasonable magnitude of the slow time scale which we would expect
to lie in the range of decades up to hundred years corresponding to well-known
economic cycle theories or cultural evolution processes. Instead, our applied
MCMC model estimation without prior range restriction converges to a hidden
slow time scale of roughly $700\text{\,}\mathrm{a}4000\text{\,}\mathrm{a}$.
Nevertheless, our results suggest that there should be involved at least two
time scales in the data-generating process which is an interesting starting
point for future research. Notably, it is not particularly surprising that we
could not quantify the hidden time scale, since we employ a very simple model
parametrisation, have only access to one variable of the high-dimensional
economic state space and perform our estimation on small windows that not even
include the smallest economic cycle time scale of roughly
$2\text{\,}\mathrm{a}10\text{\,}\mathrm{a}$ that typically correspond to
business cycles. Against this background it might be a very interesting
challenge of future research to develop more realistic models and estimation
procedures that perform reliably under the circumstances of limited data per
window and incomplete variable sets to uncover the manifold of hidden time
scales in the complex system of human economy.

## References

  * [1] Ran Aroussi “yfinance 0.1.70”, 2022
  * [2] Louis Bachelier “Théorie de la spéculation” In _Annales scientifiques de l’École Normale Supérieure_ 3e série, 17 Elsevier, 1900, pp. 21–86
  * [3] Lucas Bernard, Aleksandr V Gevorkyan, Thomas Palley and Willi Semmler “Time Scales and Mechanisms of Economic Cycles: A Review of Theories of Long Waves 1” In _PERI Working Paper Series WP337_ PERI Working Paper Series WP337, 2013 DOI: 10.13140/RG.2.2.27355.16160
  * [4] Stephen J. Brown “The Number of Factors in Security Returns” In _The Journal of Finance_ 44.5 Wiley, 1989, pp. 1247–1262
  * [5] Zbigniew Czechowski “Reconstruction of the modified discrete Langevin equation from persistent time series” In _Chaos: An Interdisciplinary Journal of Nonlinear Science_ 26.5, 2016, pp. 053109
  * [6] R. Friedrich, Ch. Renner, M. Siefert and J. Peinke “Comment on “Indispensable Finite Time Corrections for Fokker-Planck Equations from Time Series Data”” In _Phys. Rev. Lett._ 89 American Physical Society, 2002, pp. 149401
  * [7] R. Friedrich et al. “Extracting model equations from experimental data” In _Physics Letters A_ 271.3, 2000, pp. 217–222
  * [8] Rudolf Friedrich, Joachim Peinke, Muhammad Sahimi and M. Reza Rahimi Tabar “Approaching complexity by stochastic methods: From biological systems to turbulence” In _Physics Reports_ 506.5, 2011, pp. 87–162
  * [9] Andrea Gaunersdorfer, Cars H. Hommes and Florian O.O. Wagener “Bifurcation Routes to Volatility Clustering under Evolutionary Learning” In _Journal of Economic Behavior & Organization_ 67.1, 2008, pp. 27–47 DOI: https://doi.org/10.1016/j.jebo.2007.07.004
  * [10] Andrew C. Harvey, Thomas M. Trimbur and Herman K. Van Dijk “Trends and cycles in economic time series: A Bayesian approach” In _Journal of Econometrics_ 140.2, 2007, pp. 618–649 DOI: https://doi.org/10.1016/j.jeconom.2006.07.006
  * [11] W.. Hastings “Monte Carlo sampling methods using Markov chains and their applications” In _Biometrika_ 57.1, 1970, pp. 97–109
  * [12] Xue-Zhong He, Kai Li and Chuncheng Wang “Volatility clustering: A nonlinear theoretical approach” In _Journal of Economic Behavior & Organization_ 130, 2016, pp. 274–297 DOI: https://doi.org/10.1016/j.jebo.2016.07.020
  * [13] Anton J Heckens and Thomas Guhr “A new attempt to identify long-term precursors for endogenous financial crises in the market correlation structures” In _Journal of Statistical Mechanics: Theory and Experiment_ 2022.4 IOP Publishing, 2022, pp. 043401
  * [14] Anton J Heckens, Sebastian M Krause and Thomas Guhr “Uncovering the dynamics of correlation structures relative to the collective market motion” In _Journal of Statistical Mechanics: Theory and Experiment_ 2020.10 IOP Publishing, 2020, pp. 103402
  * [15] Anton J. Heckens and Thomas Guhr “New collectivity measures for financial covariances and correlations” In _Physica A: Statistical Mechanics and its Applications_ 604, 2022, pp. 127704
  * [16] Martin Heßler “antiCPy” In _GitHub repository_ GitHub, https://github.com/MartinHessler/antiCPy, 2021 DOI: 10.5281/zenodo.6046562
  * [17] Martin Heßler “antiCPy’s documentation”, https://anticpy.readthedocs.io, 2021 URL: https://anticpy.readthedocs.io
  * [18] Martin Heßler and Oliver Kamps “Bayesian on-line anticipation of critical transitions” In _New Journal of Physics_ , 2021
  * [19] Martin Heßler, Tobias Wand and Oliver Kamps “Efficient Multi-Change Point Analysis to decode Economic Crises Information from the S&P500 Mean Market Correlation” To be published, 2023
  * [20] David Kleinhans and Rudolf Friedrich “Maximum likelihood estimation of drift and diffusion functions” In _Physics Letters A_ 368.3, 2007, pp. 194–198
  * [21] Viktor Klippenstein et al. “Introducing Memory in Coarse-Grained Molecular Simulations” In _The Journal of Physical Chemistry B_ 125.19, 2021, pp. 4931–4954
  * [22] N.. Kondratieff and W.. Stolper “The Long Waves in Economic Life” In _The Review of Economics and Statistics_ 17.6 The MIT Press, 1935, pp. 105–115 URL: http://www.jstor.org/stable/1928486
  * [23] Laurent Laloux, Pierre Cizeau, Jean-Philippe Bouchaud and Marc Potters “Noise Dressing of Financial Correlation Matrices” In _Phys. Rev. Lett._ 83 American Physical Society, 1999, pp. 1467–1470
  * [24] “LII. An essay towards solving a problem in the doctrine of chances.” In _Philosophical Transactions of the Royal Society of London_ 53 The Royal Society, 1763, pp. 370–418
  * [25] Rosario Mantegna and H. Stanley “An Introduction to Econophysics” Cambridge: Cambridge University Press, 2000
  * [26] Rosario Nunzio Mantegna “Degree of correlation inside a financial market” In _AIP Conference Proceedings_ 411.1, 1997, pp. 197–202
  * [27] Harry Markowitz “Portfolio Selection” In _The Journal of Finance_ 7.1 JSTOR, 1952, pp. 77
  * [28] Gautier Marti, Frank Nielsen, Mikołaj Bińkowski and Philippe Donnat “A Review of Two Decades of Correlations, Hierarchies, Networks and Clustering in Financial Markets” In _Progress in Information Geometry: Theory and Applications_ Cham: Springer International Publishing, 2021, pp. 245–274
  * [29] Karl Marx “Das Kapital - Kritik der politischen Ökonomie” English Version: ISBN 9780140445688 Nikol Verlagsges. mbH, 2014
  * [30] Wes McKinney “Data Structures for Statistical Computing in Python” In _Proceedings of the 9th Python in Science Conference_ , 2010, pp. 56–61
  * [31] Hazime Mori “Transport, Collective Motion, and Brownian Motion*)” In _Progress of Theoretical Physics_ 33.3, 1965, pp. 423–455
  * [32] Michael C. Münnix et al. “Identifying States of a Financial Market” In _Scientific Reports_ 2.1 Springer ScienceBusiness Media LLC, 2012
  * [33] F. Pedregosa et al. “Scikit-learn: Machine Learning in Python” In _Journal of Machine Learning Research_ 12, 2011, pp. 2825–2830
  * [34] Vasiliki Plerou et al. “Universal and Nonuniversal Properties of Cross Correlations in Financial Time Series” In _Phys. Rev. Lett._ 83 American Physical Society, 1999, pp. 1471–1474
  * [35] Mario Ragwitz and Holger Kantz “Indispensable Finite Time Corrections for Fokker-Planck Equations from Time Series Data” In _Phys. Rev. Lett._ 87 American Physical Society, 2001, pp. 254501
  * [36] Mario Ragwitz and Holger Kantz “Ragwitz and Kantz Reply:” In _Phys. Rev. Lett._ 89 American Physical Society, 2002, pp. 149402
  * [37] Jeff Reback et al. “pandas-dev/pandas: Pandas 1.4.3” Zenodo, 2022
  * [38] Philip Rinn et al. “Dynamics of quasi-stationary systems: Finance as an example” In _EPL (Europhysics Letters)_ 110.6 IOP Publishing, 2015, pp. 68003
  * [39] Rudi Schäfer and Thomas Guhr “Local normalization. Uncovering correlations in non-stationary financial time series” In _Physica A_ 389.18, 2010, pp. 3856–3865
  * [40] Joseph Schumpeter “Konjunkturzyklen” Göttingen: Vandenhoeck & Ruprecht, 1961
  * [41] Skipper Seabold and Josef Perktold “statsmodels: Econometric and statistical modeling with python” In _9th Python in Science Conference_ , 2010
  * [42] Moritz Sieber, C. Paschereit and Kilian Oberleithner “Stochastic modelling of a noise-driven global instability in a turbulent swirling jet” In _Journal of Fluid Mechanics_ 916 Cambridge University Press, 2021, pp. A7
  * [43] S Siegert, R Friedrich and J Peinke “Analysis of data sets of stochastic systems” In _Physics Letters A_ 243.5, 1998, pp. 275–280
  * [44] Devinderjit Sivia and John Skilling “Data analysis” London, England: Oxford University Press, 2006
  * [45] Yuriy Stepanov et al. “Stability and hierarchy of quasi-stationary states: financial markets as an example” In _Journal of Statistical Mechanics: Theory and Experiment_ 2015.8 IOP Publishing, 2015, pp. P08011
  * [46] Steven H. Strogatz “Nonlinear dynamics and chaos. With Applications to Physics, Biology, Chemistry and Engineering.” Westview Press, 2015
  * [47] Erica Thompson and Leonard Smith “Escape from model-land” In _Economics: The Open-Access, Open-Assessment E-Journal_ 13, 2019 DOI: 10.5018/economics-ejournal.ja.2019-40
  * [48] Peter Turchin “Historical Dynamics: Why States Rise and Fall” Princeton University Press, 2003
  * [49] Wolfgang Von der Linden, Volker Dose and Udo Von Toussaint “Bayesian probability theory: applications in the physical sciences” Cambridge University Press, 2014
  * [50] Tobias Wand “S&P500 Mean Correlation Time Series (1992-2012)” Zenodo, Available at https://doi.org/10.5281/zenodo.8167592, 2023 DOI: 10.5281/zenodo.8167592
  * [51] Tobias Wand and Dan Hoyer “The Characteristic Time Scale of Cultural Evolution”, 2023 arXiv:2212.00563 [stat.AP]
  * [52] Clemens Willers and Oliver Kamps “Efficient Bayesian estimation of a non-Markovian Langevin model driven by correlated noise” arXiv, 2022 URL: https://arxiv.org/abs/2207.10637
  * [53] Clemens Willers and Oliver Kamps “Efficient Bayesian estimation of the generalized Langevin equation from data” arXiv, 2021 URL: https://arxiv.org/abs/2107.04560
  * [54] Clemens Willers and Oliver Kamps “Non-parametric estimation of a Langevin model driven by correlated noise” In _The European Physical Journal B_ 94.7 Springer ScienceBusiness Media LLC, 2021

##  Appendix A GLE: Overlapping Windows for the Mean Correlation

If the mean correlation is calculated via a window size of $\tau=42$ and a
shift of $s=1$ like in [45], then the GLE fit indicates some problems: The
estimated memory kernel shows very strong negative values at
$\mathcal{K}_{42}$ and the doubled temporal distance $\mathcal{K}_{84}$.
Although the memory kernel suggests that there is a strong memory effect, this
is most probably only attributable to the overlap of the window ranges used to
calculate $\bar{C}$.

Figure 8: Example for a model with a long kernel memory for correlation matrix
window size $\tau=42$ and shift $s=1$ with the lag $k$ in days on the x-axis.
The kernel has noticeably negative values for $\mathcal{K}_{\tau}$ and
$\mathcal{K}_{2\tau}$. This probably indicates that the overlap of the
artificially created windows ends at a distance of $\tau$ instead of
reflecting a real-world relationship.

##  Appendix B GLE: Selection of Reasonable Kernel Length

To select a model with a reasonable kernel length, we first fit a model with a
rather large kernel length and evaluate its combined memory aggregation
$K_{k}$. The $k_{0}$ for which $K_{k}$ reaches a plateau is then chosen as a
memory kernel length for the subsequent model fitting.

Figure 9: For a model with a long kernel $k_{\max}=10$, the combined memory
effect $K_{k}$ reaches a plateau at around $k=6$ and oscillates around it.

##  Appendix C LE: Increment Distribution

Figure 10: The same plots as in figure 3 for the Langevin Equation without any
memory kernel. The distributions look very similar to the ones in figure 3.

##  Appendix D GLE: Prediction

The results of the naive forecasting method are compared to the GLE in this
figure, showcasing the superior accuracy of the GLE, which can also be seen by
comparing the $\rho^{2}$ values in table 3.1.3.

Figure 11: The same comparison between the prediction results as in figure 5,
but now for the naive forecasting method $\hat{y}_{t+1}=y_{t}$ vs. the GLE.
Again, $\alpha=90\%$.

##  Appendix E Supplementary Material: Resilience Analyses

This section complements the interpretation of the resilience analysis which
hints to a hidden slow time scale and non-Markovianity, discussed in
subsection 3.2 of the main article. In subsection E.1 we describe the
simulation of the synthetic time series $x$ of the main article in detail,
before we provide additional calculations in E.2 which fit in with our
previous results. At last, we provide the analyses’ parameters in subsection
E.3.

###  E.1 Synthetic Time Series

The synthetic model

$\displaystyle\dot{x}$ $\displaystyle=15+x-x^{3}+q\cdot y$
$\displaystyle\dot{y}$ $\displaystyle=-0.1\cdot y+\sqrt{0.1}\cdot\Gamma(t)$

is simulated via the Euler-Maruyama scheme for $30000$ steps in the time
interval $[0,2000]$. The X coupling parameter $q$ is linearly increased from
$0.5$ to $4$ over the whole time interval to create a first differences PDF
with a width comparable to the PDF of the original mean market correlation
data $\bar{C}(t)$.

###  E.2 Additional Results

Figure 12: Additional resilience analyses of the mean market correlation data
$\bar{C}(t)$ without and with subtracting the slow trend fitted by a Gaussian
kernel of width $10$ using the Python function
scipy.ndimage.filters.gaussian_filter for the mono-scale Markovian model and
the non-Markovian model with inverse time scale separation of the observed
time scale $\tau_{\bar{C}}$ and the unobserved one $\tau_{\lambda}$, i.e.
$\tau_{\bar{C}}>2\cdot\tau_{\lambda}$. (a-c) Results of both models evaluated
on the original raw data. (d-f) Results of both models evaluated on the
detrended data. The results of both models are almost the same. See the
running text for a more detailed discussion.

The evaluation of the resilience analysis of the mean market correlation
$\bar{C}(t)$ without and with Gaussian kernel detrending is performed for the
Markovian model and the multi-scale non-Markovian model with the inverse prior
time scale separation $\tau_{\bar{C}}>\gamma\cdot\tau_{\lambda}$, whereby
$\gamma=2$. the results are shown in figure 12. Since the chosen time scale
separation of the non-Markovian model determines the slowest time scale to be
the observed trading day scale which is identical to the Markovian one, the
calculations of both models are almost the same. The suggested local stability
in the detrended cases confirms the interpretation that a second slow time
scale might be hidden in the mean market correlation data. Detrendings with
broader kernel widths tend to exhibit more pronounced positive trends which
could on the one hand indicate a destabilisation of the local potential
landscape due to uprising bifurcations. On the other hand this behaviour might
be triggered by remaining non-stationarity of the data due to more and more
incomplete detrending of the slow trend if the kernel width is increased. In
order to guarantee that the overall qualitative behaviour of the non-Markovian
model in the main article with an unobserved slow time scale, i.e.
$\tau_{\lambda}>\gamma\cdot\tau_{\bar{C}}$ with $\gamma=2$, remains unchanged
if the Ornstein-Uhlenbeck (OU) parameter is not restricted by the upper bound
of its prior range, we present the converging results of significantly broader
prior ranges in figure 13. The exact parameters are listed in table 2 of
subsection E.3. The drift slope estimates indicate locally stable economic
states with $\hat{\zeta}<0$ in agreement with the results of the main article.
The range of the OU parameter $\theta_{5}$ is roughly between $420$ and $1000$
which does not correspond to any reasonable slow economic time scale. However,
this might due to the low amount of data per window which does not capture at
least the smallest suggested time scale of business cycles that operate on
scale of roughly two up to ten years. Furthermore the assumed polynomial model
might be too simple to estimate quantitatively reasonable time scales.

Figure 13: Results of the multi-scale non-Markovian model of the main article,
i.e. the slow time scale is unobserved with time scales
$\tau_{\lambda}>2\cdot\tau_{\bar{C}}$, but with significantly broader prior
ranges that allow for an OU parameter convergence independent from the upper
prior bound. The parameters are listed in table 2 of subsection E.3. The
qualitative results remain unchanged indicating locally stable economic
statets by negative drift slope estimates $\hat{\zeta}$. However, the
determined slow time scale does not correspond to any reasonable economic
scale. See the running text for a more detailed discussion.

###  E.3 Parameter Documentation

In this subsection we summarise the parameter sets involved in the resilience
calculations of the main article and the appendices in order to guarantee
reproducibility without affecting the readability of the main article. The
parameters are listed in table 2 and prior configurations are given in table
3.

Figure | Model | Rolling Window | MCMC Parameters
---|---|---|---
|  | Size | Shift | Walkers | Steps | Burn In
6(a-c) | Markov | 500 | 15 | 50 | 15000 | 200
6(a-c) | Non-Markov | 500 | 15 | 50 | 20000 | 200
6(d-f) | Markov | 500 | 15 | 50 | 20000 | 200
6(d-f) | Non-Markov | 500 | 15 | 50 | 30000 | 200
12(a-c) | Non-Markov | 500 | 15 | 50 | 20000 | 200
12(d-f) | Markov | 500 | 15 | 50 | 15000 | 200
12(d-f) | Non-Markov | 500 | 15 | 50 | 20000 | 200
13(a-d) | Non-Markov | 500 | 15 | 50 | 30000 | 200
Table 2: Rolling window and MCMC parameters of the resilience calculations. Figure | Model | Prior (Range)
---|---|---
|  | $\boldsymbol{\theta}_{0}$ | $\boldsymbol{\theta}_{1}$ | $\boldsymbol{\theta}_{2}$ | $\boldsymbol{\theta}_{3}$ | $\boldsymbol{\theta}_{4}$ | $\boldsymbol{\theta}_{5}$ | TSS
6(a-c) | Markov | $[-50,50]$ | $[-50,50]$ | $[-50,50]$ | $[-50,50]$ | $[0,50]$ | — | —
6(a-c) | Non-Markov | $[-50,50]$ | $[-50,50]$ | $[-50,50]$ | $[-50,50]$ | $[0,50]$ | $[0,50]$ | $\tau_{\lambda}>2\tau_{\bar{C}}$
6(d-f) | Markov | $[-50,50]$ | $[-50,50]$ | $[-50,50]$ | $[-50,50]$ | $[0,50]$ | — | —
6(d-f) | Non-Markov | $[-50,50]$ | $[-50,50]$ | $[-50,50]$ | $[-50,50]$ | $[0,50]$ | $[0,50]$ | $\tau_{\lambda}>2\tau_{\bar{C}}$
12(a-c) | Non-Markov | $[-25,25]$ | $[-25,25]$ | $[-25,25]$ | $[-25,25]$ | $[0,5]$ | $[0.01,5]$ | $\tau_{\bar{C}}>2\tau_{\lambda}$
12(d-f) | Markov | $[-50,50]$ | $[-50,50]$ | $[-50,50]$ | $[-50,50]$ | $[0,50]$ | — | —
12(d-f) | Non-Markov | $[-25,25]$ | $[-25,25]$ | $[-25,25]$ | $[-25,25]$ | $[0,5]$ | $[0.01,5]$ | $\tau_{\bar{C}}>2\tau_{\lambda}$
13(a-d) | Non-Markov | $[-100,100]$ | $[-100,100]$ | $[-100,100]$ | $[-100,100]$ | $[0,250]$ | $[0.01,2000]$ | $\tau_{\lambda}>2\tau_{\bar{C}}$
Table 3: Prior configurations of the resilience calculations. TSS is an
abbreviation for Time Scale Separation.


$\displaystyle\leq(\mu^{2})w(1+\mu\sqrt{w})+\frac{4(1+\mu\sqrt{w})^{2}}{\sqrt{\pi}}<\frac{6}{\sqrt{\pi}}w_{0}(1+\mu\sqrt{w_{0}})^{2}.$

With this upper bound proven, we choose $M=10^{6}$ uniformly distributed
points in the interval $[0,w_{0}]$, and argue that

$\sup_{w\in[0,w_{0}]}b_{1}(20/27,w)\leq\sup_{0\leq m\leq
M}b_{1}\left(20/27,\frac{m}{M}w_{0}\right)+\frac{w_{0}}{M}\sup_{w\in[0,w_{0}]}\left|\frac{\partial
b_{1}}{\partial w}(20/27,w)\right|.$

The result of this calculation turns out to be $1.3860<1.39$ (accurate to the
last significant digit given), which finishes the proof. ∎

######  Corollary A.4.

For $u,v\in\mathbb{R}^{+}$ and $x_{0}\in[0,u/v]$, we have

$\displaystyle\int^{x_{0}}_{0}e^{-ux^{2}}\left(\cosh(vx^{3})-1\right)\,dx\leq\beta_{1}\left(x_{0}\frac{v}{u}\right)\frac{v^{2}}{u^{7/2}}\operatorname{erf}(x_{0}\sqrt{u}),$
(A.15)
$\displaystyle\int^{x_{0}}_{0}xe^{-ux^{2}}\sinh(vx^{3})\,dx\leq\beta_{2}\left(x_{0}\frac{v}{u}\right)\frac{v}{u^{5/2}}\operatorname{erf}(x_{0}\sqrt{u}),$
(A.16)
$\displaystyle\int^{x_{0}}_{0}e^{-ux^{2}}\sinh(vx^{4})\,dx\leq\beta_{3}\left(x_{0}\sqrt{\frac{v}{u}}\right)\frac{v}{u^{5/2}}\operatorname{erf}(x_{0}\sqrt{u}),$
(A.17)
$\displaystyle\int^{x_{0}}_{0}xe^{-ux^{2}}\sinh(vx^{4})\,dx\leq\beta_{4}\left(x_{0}\sqrt{\frac{v}{u}}\right)\frac{v}{u^{3}}\operatorname{erf}(x_{0}\sqrt{u}).$
(A.18)

###### Proof.

This follows immediately from Lemma A.3 by, on the one hand, performing the
substitutions $y\to(v/u)x$ and $w\to u^{3}/v^{2}$ in (A.11) and (A.12), and
performing the substitutions $y\to(\sqrt{v/u})x$ and $w\to u^{2}/v$ in (A.13)
and (A.14). ∎

###  A.3. A Maclaurin summation estimate

The following upper bound for an alternating sum is crucial in the proof of
Lemma 8.2, see (8.12).

######  Lemma A.5.

For $n\in\mathbb{Z}^{+}$ and $f\in C^{4}[0,3n]$, we have

$\left|\sum_{k=1}^{n}\left(f(3k-2)-f(3k-1)\right)\right|\\\
\leq\frac{1}{3}\left|f(3n)-f(0)\right|+\frac{2}{3}\left|f^{\prime\prime}(3n)-f^{\prime\prime}(0)\right|+\frac{11}{96}\sup_{x\in[0,3n]}|f^{(4)}(x)|.$

###### Proof.

We use the offset Maclaurin summation formula (see, for example, [15, Theorem
D.2.4]) to see that

$\displaystyle\sum_{k=1}^{n}\left(f(3k-2)-f(3k-1)\right)$
$\displaystyle=\sum_{k=1}^{4}\frac{3^{k-1}(B_{k}(2/3)-B_{k}(1/3))}{k!}\left(f^{(k-1)}(3n)-f^{(k-1)}(0)\right)$
$\displaystyle\kern
28.45274pt-\frac{9}{8}\int^{3n}_{0}f^{(4)}(x)\left(\bar{B}_{4}\left(\frac{2-x}{3}\right)-\bar{B}_{4}\left(\frac{1-x}{3}\right)\right)dx$
$\displaystyle=\frac{1}{3}\left(f(3n)-f(0)\right)-\frac{2}{3}\left(f^{\prime\prime}(3n)-f^{\prime\prime}(0)\right)$
$\displaystyle\kern
28.45274pt-\frac{9}{8}\int^{3n}_{0}f^{(4)}(x)\left(\bar{B}_{4}\left(\frac{2-x}{3}\right)-\bar{B}_{4}\left(\frac{1-x}{3}\right)\right)dx,$

where the Bernoulli polynomials $B_{k}(u)$ are defined by

$\sum_{k\geq 0}B_{k}(u)\frac{t^{k}}{k!}=\frac{te^{ut}}{e^{t}-1},$

and $\bar{B}_{k}(u)=B_{k}\left(\\{u\\}\right)$, with $\\{u\\}$ denoting the
fractional part of $u$ as usual, is the $k$-th periodic Bernoulli function.
The lemma follows from the fact that

$\int^{3n}_{0}\left|\bar{B}_{4}\left(\frac{2-x}{3}\right)-\bar{B}_{4}\left(\frac{1-x}{3}\right)\right|\,dx=\frac{11n}{108}.\qed$

###  A.4. Estimates for sums and differences of exponentials

Here we record two elementary estimates for the difference respectively the
sum of two exponentials that are used in the proof of Lemma 8.1.

######  Lemma A.6.

For $z,w\in\mathbb{C}$, we have the following inequalities:

$\displaystyle\left|e^{z}-e^{w}\right|$ $\displaystyle\leq
2\sinh\max(|z|,|w|)+2\sinh\frac{|z+w|}{2},$ (A.19)
$\displaystyle\left|e^{z}+e^{w}-2\right|$ $\displaystyle\leq
2\cosh\max(|z|,|w|)-2+2\sinh\frac{|z+w|}{2}.$ (A.20)

###### Proof.

Without loss of generality, we assume that $\operatorname{Re}(w-z)\leq 0$. By
the triangle inequality, we have

$\displaystyle\left|e^{z}-e^{w}\right|$
$\displaystyle\leq\left|e^{z}-e^{-z}\right|+\left|e^{-z}-e^{w}\right|$
$\displaystyle\leq 2\sinh|z|+2\left|e^{(w-z)/2}\right|\sinh\frac{|z+w|}{2}$
$\displaystyle\leq 2\sinh\max(|z|,|w|)+2\sinh\frac{|z+w|}{2},$

and

$\displaystyle\left|e^{z}+e^{w}-2\right|$
$\displaystyle\leq\left|e^{z}+e^{-z}-2\right|+\left|e^{-z}-e^{w}\right|$
$\displaystyle\leq 2\cosh|z|-2+2\left|e^{(w-z)/2}\right|\sinh\frac{|z+w|}{2}$
$\displaystyle\leq 2\cosh\max(|z|,|w|)-2+2\sinh\frac{|z+w|}{2}.\qed$

###  A.5. Inequalities for the sums $X_{j}(n,r)$

The lemma below provides inequalities for various expressions involving the
sums $X_{j}(n,r)$ defined in (4.6). These are used in the proof of Lemma 8.2
and for the proof of several particular bounds presented in Corollary A.8
below. In their turn, the bounds of the corollary are used in Lemmas 8.3 and
9.5.

######  Lemma A.7.

For $n\in\mathbb{Z}^{+}$ and $r\in(0,1]$, we have the following inequalities
concerning the quantities $X_{j}(n,r)$:

  1. (1)

$X_{1}(n,r)\geq\frac{r(1+2r+2r^{3}+r^{4})(1-r^{3n})(1-r^{3n/2})}{(1-r^{3})^{2}}.$
(A.21)

  2. (2)

For $j=0,1,2,3$, we have

$\frac{X_{j+1}(n,r)}{X_{0}(n,r)X_{j}(n,r)}\leq\frac{X_{j+1}(\infty,r)}{X_{0}(\infty,r)X_{j}(\infty,r)}.$
(A.22)

  3. (3)

For $j=0,1,2$, we have

$\frac{X_{j}(n,r)X_{j+2}(n,r)}{X_{j+1}^{2}(n,r)}\leq\frac{X_{j}(\infty,r)X_{j+2}(\infty,r)}{X_{j+1}^{2}(\infty,r)}.$
(A.23)

###### Proof.

(1) Inequality (A.21) can be proved by observing that

$\displaystyle X_{1}(n,r)(1-r^{3})^{2}$
$\displaystyle=r(1+2r+2r^{3}+r^{4})(1-r^{3n})-3nr^{3n+1}(1+r)(1-r^{3})$
$\displaystyle\geq
r(1+2r+2r^{3}+r^{4})(1-r^{3n})-r^{3n/2+1}(3r^{3/2}+3r^{5/2})(1-r^{3n})$
$\displaystyle\geq
r(1+2r+2r^{3}+r^{4})(1-r^{3n})-r^{3n/2+1}(1+2r+2r^{3}+r^{4})(1-r^{3n})$
$\displaystyle=r(1+2r+2r^{3}+r^{4})(1-r^{3n})(1-r^{3n/2}).$

(2) To prove (A.22) and (A.23), we claim that the expressions

$\frac{(1-r^{3})^{j+2}}{(1+r)r^{3n+3}}\left(X_{j+1}(\infty,r)X_{0}(n,r)X_{j}(n,r)-X_{j+1}(n,r)X_{0}(\infty,r)X_{j}(\infty,r)\right)$

and

$\frac{(1-r^{3})^{2j+4}}{3nr^{3n+4}}\left(X_{j}(\infty,r)X_{j+2}(\infty,r)X_{j+1}^{2}(n,r)-X_{j}(n,r)X_{j+2}(n,r)X_{j+1}^{2}(\infty,r)\right)$

are actually polynomials in $r$ with non-negative coefficients. This claim can
be routinely verified by explicitly calculating each coefficient of these
expressions as piecewise polynomial function. As an illustrative example, we
have

$\frac{(1-r^{3})^{4}}{3nr^{3n+4}}\left(X_{0}(\infty,r)X_{2}(\infty,r)X_{1}^{2}(n,r)-X_{0}(n,r)X_{2}(n,r)X_{1}^{2}(\infty,r)\right)=(1+r)\sum_{m=0}^{3n+2}a_{m}r^{m},$

where the coefficients are given by $a_{0}=3n$, $a_{1}=15n-2$, $a_{2}=24n-4$,
$a_{3}=30n-18$, $a_{3n}=27n-18$, $a_{3n+1}=3n-4$, $a_{3n+2}=3n-2$, and

$a_{m}=\begin{cases}3(2m-3)(3n-m)+9(m-2),&\mbox{if }m\equiv 0\pmod{3},\\\
3(3m-4)(3n-m)+9(m-2),&\mbox{if }m\equiv 1\pmod{3},\\\
3(3m-5)(3n-m)+18(m-2),&\mbox{if }m\equiv 2\pmod{3}.\end{cases}$

for $4\leq m\leq 3n-1$. ∎

######  Corollary A.8.

For $n\geq 1$ and $r\in(0,1]$, we have

$\displaystyle\frac{X_{0}^{2}(n,r)}{rX_{1}(n,r)}$
$\displaystyle\leq\frac{4}{3},$ (A.24)
$\displaystyle\frac{rX_{2}(n,r)}{X_{0}(n,r)X_{1}(n,r)}$ $\displaystyle\leq 3,$
(A.25) $\displaystyle\frac{r^{2}X_{2}(n,r)}{X_{0}^{3}(n,r)}$
$\displaystyle\leq\frac{9}{2},$ (A.26)
$\displaystyle\frac{rX_{3}(n,r)}{X_{0}(n,r)X_{2}(n,r)}$
$\displaystyle\leq\frac{9}{2},$ (A.27)
$\displaystyle\frac{r^{2}X_{4}(n,r)}{X_{0}^{2}(n,r)X_{2}(n,r)}$
$\displaystyle\leq 27,$ (A.28)
$\displaystyle\frac{X_{0}(n,r)X_{3}(n,r)}{X_{1}(n,r)X_{2}(n,r)}$
$\displaystyle\leq 3,$ (A.29)
$\displaystyle\frac{X_{0}(n,r)X_{3}^{2}(n,r)}{X_{2}^{3}(n,r)}$
$\displaystyle\leq\frac{9}{2},$ (A.30)
$\displaystyle\frac{X_{0}(n,r)X_{4}(n,r)}{X_{2}^{2}(n,r)}$ $\displaystyle\leq
6,$ (A.31)

where the $X_{j}(n,r)$ are defined in (4.6).

###### Proof.

To prove (A.24), we argue that

$4rX_{1}(n,r)-3X_{0}^{2}(n,r)=r^{2}(1-r)(1+3r)\geq 0$

for $n=1$, and make use of (A.21) to see that

$\frac{X_{0}^{2}(n,r)}{rX_{1}(n,r)}\leq\frac{(1+r)^{2}(1+r^{3n/2})}{(1+2r+2r^{3}+r^{4})}\leq\frac{(1+r)^{2}(1+r^{3})}{(1+2r+2r^{3}+r^{4})}\leq\frac{4}{3}$

for $n\geq 2$.

For the other seven inequalities, we invoke (A.22) for (A.25)–(A.28) and
(A.23) for (A.29)–(A.31) to see that the left-hand side of all six
inequalities does not exceed the corresponding $n\to\infty$ limit. The six
limits in question are simple rational functions in $r$ and can be routinely
shown to be bounded above by the right-hand side; as an example, for (A.26) we
have

$\frac{r^{2}X_{2}(n,r)}{X_{0}^{3}(n,r)}\leq\frac{r^{2}X_{2}(\infty,r)}{X_{0}^{3}(\infty,r)}=\frac{1+3r-3r^{2}+16r^{3}-3r^{4}+3r^{5}-r^{6}}{(1+r)^{2}},$

and

$9(1+r)^{2}-2(1+3r-3r^{2}+16r^{3}-3r^{4}+3r^{5}-r^{6})=(1-r)(7+19r+34r^{2}+2r^{3}+8r^{4}+2r^{5})\geq
0.\qed$

###  A.6. Upper bounds for certain trigonometric sums

This subsection contains two auxiliary results, of different flavour, which
provide upper bounds for the absolute value of certain trigonometric sums, the
second more special than the first. Lemma A.9 is used in the proofs of Lemmas
9.1 and 9.4, while Lemma A.10 is used in the proof of Lemma 9.2. An auxiliary
result that is needed in the proof of Lemma A.10 is stated separately in Lemma
A.11.

######  Lemma A.9.

Suppose that $0<r\leq 1$ and $\theta,\varphi\in\mathbb{R}$. For all positive
monotonically increasing sequences $\\{u_{n}\\}_{n\geq 0}$, and for all non-
negative integers $a,b$ such that $a\leq b$, we have

$\left|\sum_{k=a}^{b}u_{k}r^{k}\cos(k\theta+\varphi)\right|\leq\frac{1}{|1-re^{i\theta}|}\left((1-r)\sum_{k=a}^{b}u_{k}r^{k}+2r^{b+1}u_{b}\right).$

###### Proof.

We write $z=re^{i\theta}$, and note that the sum
$S_{a,b}:=\sum_{k=a}^{b}r^{k}\cos(k\theta+\varphi)$ can be bounded above by

$\displaystyle\left|\sum_{k=a}^{b}r^{k}\cos(k\theta+\varphi)\right|$
$\displaystyle\leq\left|\sum_{k=a}^{b}z^{k}\right|=\left|\frac{z^{a}-z^{b+1}}{1-z}\right|\leq\frac{r^{a}+r^{b+1}}{|1-z|}.$

Therefore, we can use Abel’s lemma (summation by parts) to get

$\displaystyle\left|\sum_{k=a}^{b}u_{k}r^{k}\cos(k\theta+\varphi)\right|\leq
u_{a}|S_{a,b}|+(u_{a+1}-u_{a})|S_{a+1,b}|+\dots+(u_{b}-u_{b-1})|S_{b,b}|$
$\displaystyle\kern
20.0pt\leq\frac{1}{|1-z|}\left(u_{a}(r^{a}+r^{b+1})+(u_{a+1}-u_{a})(r^{a+1}+r^{b+1})+\dots+(u_{b}-u_{b-1})(r^{b}+r^{b+1})\right)$
$\displaystyle\kern
20.0pt=\frac{1}{|1-z|}\left((1-r)\sum_{k=a}^{b}u_{k}r^{k}+2r^{b+1}u_{b}\right).\qed$

The following inequality improves Lemma B.4 from [16].

######  Lemma A.10.

For $r\in(0,1)$, $n\in\mathbb{Z}^{+}$, and $\theta\in[-\pi,\pi]$, we have

$\sum_{k=1}^{n}r^{k-1}\cos
k\theta\leq\frac{1-r^{n}}{1-r}\sqrt{\frac{1}{1+4\kappa\tan^{2}(\theta/2)}},$
(A.32)

where

$\kappa=\frac{(1+r)(1-r^{n})(1-r^{n/6})}{(1-r)^{2}}.$

###### Proof.

Writing $\cos(k\theta)=\frac{1}{2}\left(e^{ik\theta}+e^{-ik\theta}\right)$, we
see that the sum on the left-hand side can be evaluated as it is just the sum
of two geometric series. After substitution of the result, it turns out that
the claimed inequality is equivalent to

$\frac{-r+\cos\theta+r^{n+1}\cos(n\theta)-r^{n}\cos(n\theta+\theta)}{1-2r\cos\theta+r^{2}}\leq\frac{1-r^{n}}{1-r}\sqrt{\frac{1}{1+4\kappa\tan^{2}(\theta/2)}}.$
(A.33)

Without loss of generality we assume that $\theta\geq 0$. We prove (A.33) for
all real $n\geq 1$ and $\theta\in[0,\pi]$. We divide the proof into two parts
according to whether $\theta$ is larger than $\frac{\pi}{n+1}$ or not.

Part I. $\theta\leq\frac{\pi}{n+1}$. We construct Padé approximants as bounds
for the various non-rational functions involved, with the goal of reducing the
proof of the inequality to the proof of an inequality for a rational function.
The reason is that inequalities for rational functions are easier to handle.
In particular, they can be automatically proved by using Cylindrical Algebraic
Decomposition (CAD),888Cylindrical Algebraic Decomposition (CAD) is an
algorithm that, among others, is able to prove that a given polynomial in
several variables is positive (non-negative), respectively provides a
description of the subset of the parameter space for which the polynomial is
positive (non-negative). It also allows one to verify the positivity (non-
negativity) of polynomials in several variables under (polynomial) constraints
on the variables. The reader is referred to the “user guide” [13] and the
references therein. Implementations of CAD are available within any standard
computer algebra programme. The one that we used is the command
CylindricalDecomposition within Mathematica. and this is what we are going to
do in the end for the most intricate ones.

We let $t=\tan^{2}(\theta/2)$ so that $\cos\theta=\frac{1-t}{1+t}$. Using
Lemma A.11 below, Lemma B.3 from [16], and elementary manipulations, we obtain

$\displaystyle\cos(n\theta)=\frac{3+(3-5n^{2})t-n^{2}t^{2}}{(1+t)(3+n^{2}t)}$
$\displaystyle\geq\frac{3-(5n^{2}-2)t}{3+(n^{2}+2)t},\quad\text{for all
}\theta\in\mathbb{R},$ $\displaystyle\cos(n\theta)-\cos(n\theta+\theta)$
$\displaystyle\leq\frac{6(2n+1)t}{3+(2n^{2}+2n+3)t},\quad\text{for all
}\theta\in[0,\pi/n],$ $\displaystyle\frac{1}{\sqrt{1+4x}}$
$\displaystyle\geq\frac{1}{1+2x},\quad\text{for all }x\geq 0.$

With these inequalities in mind, it is sufficient to prove that

$(1-r)\left(1-r^{n}\frac{3-(5n^{2}-2)t}{3+(n^{2}+2)t}\right)-1+\frac{1-t}{1+t}+r^{n}\frac{6(2n+1)t}{3+(2n^{2}+2n+3)t}\\\
\leq\frac{1-r^{n}}{1-r}\left(1-2r\frac{1-t}{1+t}+r^{2}\right)\frac{1}{1+2\kappa
t}.$ (A.34)

The difference between the two sides of (A.34) can be written as

$\frac{2t(9a_{0}+3a_{1}t+a_{2}t^{2}+\kappa(1-r)a_{3}t^{3})}{(1-r)^{2}(1+t)(3+(n^{2}+2)t)(3+(2n^{2}+2n+3)t)(1+2\kappa
t)},$ (A.35)

where

$\displaystyle a_{0}$
$\displaystyle=1+r-r^{n}\left(\left(1+n(1-r)\right)^{2}+r\right)-\kappa(1-r)^{2}(1-r^{n}),$
$\displaystyle a_{1}$
$\displaystyle=2(n^{2}+n+3)a_{0}+3\kappa(1-r)(1+r-3r^{n}+r^{n+1})$
$\displaystyle\qquad+(n^{2}-1)(1+r-2r^{n+1})+(n+1)^{2}(2n+1)r^{n}(1-r)$
$\displaystyle\qquad-\kappa(1-r)\left((n^{2}-1)(1-r)(1+5r^{n})+12nr^{n}\right),$
$\displaystyle a_{2}$ $\displaystyle=\sum_{j=0}^{4}a_{2j}n^{j},\text{with}$
$\displaystyle a_{20}=3(1-r^{n})(2+2r+\kappa(1-r)(3+7r)),$ $\displaystyle
a_{21}=4(1+r-3r^{n}+r^{n+1})+2\kappa(1-r)(1+5r-25r^{n}-5r^{n+1})),$
$\displaystyle
a_{22}=7+7r-12r^{n}+7r^{n+1}-9r^{n+2}+2\kappa(1-r)(1+8r-13r^{n}+10r^{n+1}),$
$\displaystyle
a_{23}=2(1+r-6r^{n}+7r^{n+1}-3r^{n+2})-2\kappa(1-r)(1-r+11r^{n}-5r^{n+1}),$
$\displaystyle
a_{24}=2(1+r-3r^{n}+4r^{n+1}-6r^{n+2})-2\kappa(1-r)^{2}(1+5r^{n}),$
$\displaystyle a_{3}$ $\displaystyle=(1+r)(1-r^{n})(n^{2}+2)(2n^{2}+2n+3)$
$\displaystyle\qquad-6n^{2}r^{n}(1-r)(2n^{2}+2n+3)+4nr^{n}(n-2)(n^{2}+2).$

In the following, we are going to prove non-negativity results for these
coefficients.

(1) $a_{0}\geq 0$. We substitute the definition of $\kappa$ in (A.35). After
some simplification, the inequality can be shown to be equivalent to

$\frac{\left(1+n(1-r)\right)^{2}+r}{1+r}\leq\frac{1-(1-r^{n})^{2}(1-r^{n/6})}{r^{n}}.$
(A.36)

In order to prove this, we first use the classical inequalities $1-r\leq(-\log
r)$ and $\frac{1-r}{1+r}\leq(-\log r)/2$ to conclude that

$\frac{\left(1+n(1-r)\right)^{2}+r}{1+r}\leq 1+(-\log r)n+(-\log
r)^{2}\frac{n^{2}}{2}.$

Note that the right-hand side is exactly the Taylor polynomial of

$r^{-n}(1-(1-r^{n})^{2}(1-r^{n/6}))$

of order $2$ at $n=0$. So, in order to prove (A.36), it suffices to show that
its third derivative is non-negative. Indeed, this third derivative can be
calculated as

$\left(\frac{d}{dn}\right)^{3}\frac{(1-(1-r^{n})^{2}(1-r^{n/6}))}{r^{n}}\\\
=\frac{(-\log
r)^{3}r^{n/6}}{216}\left(125r^{-n}+2+216r^{5n/6}-343r^{n}\right)\geq 0.$

(2) $a_{1}\geq 0$. We claim that

$(n^{2}-1)(1+r-2r^{n+1})+(n+1)^{2}(2n+1)r^{n}(1-r)\\\
\geq\kappa(1-r)^{2}(n^{2}-1)(1+5r^{n})+12n\kappa r^{n}(1-r).$ (A.37)

By substituting the definition of $\kappa$ and using the inequality
$1+5r^{n}\leq(1-r^{n})/(1-r^{n/6})$, we see that (A.37) is implied by

$2n(n+1)(n+2)\geq\frac{1-r^{n}}{1-r}(1+r)\left(12n\frac{1-r^{n/6}}{1-r}-n^{2}+1\right).$

This can be proved by noting that $n\geq(1-r^{n})/(1-r)$, and that

$\displaystyle(1+r)\left(12n\frac{1-r^{n/6}}{1-r}-n^{2}+1\right)$
$\displaystyle\leq\begin{cases}(1+r)\left(2n^{2}-n^{2}+1\right),&\mbox{if
}n\geq 6,\\\ 12n\frac{1-r^{n/6}}{1-\sqrt{r}}-n^{2}+1,&\mbox{if
}n<6,\end{cases}$ $\displaystyle\leq\begin{cases}2n^{2}+2,&\mbox{if }n\geq
6,\\\ 12n\max(1,n/3)-n^{2}+1,&\mbox{if }n<6,\end{cases}$
$\displaystyle<2(n+1)(n+2).$

(3) $a_{2}\geq 0$. We prove that $a_{20}$, $a_{22}$, $a_{24}$,
$(1-r^{1/6})a_{21}+(1-r^{n/6})a_{22}$
and$\sum_{j=0}^{4}(1-r^{1/6})^{4-j}(1-r^{n/6})^{j}a_{2j}$ are non-negative.
All these expressions are rational functions in $r^{1/6}$ and $r^{n/6}$. In
order to get these expressions ready for application of CAD, we replace each
occurrence of $r^{n/6}$ by $X$, and each occurrence of $r^{1/6}$ by $Y$, say.
In this manner, we obtain rational functions in $X$ and $Y$. (In order to
illustrate this: a term $r^{n+2/3}$ would be replaced by $X^{6}Y^{2}$.) Now
CAD can be applied under the constraints $0<X\leq Y<1$, and it yields the
claimed result.

(4) $(1-r^{n/6})a_{2}+\kappa(1-r)(1-r^{1/6})a_{3}\geq 0$. The proof is
completely analogous to the proof of $a_{2}\geq 0$ above: we write

$(1-r^{n/6})a_{2}+\kappa(1-r)(1-r^{1/6})a_{3}=\sum_{j=0}^{4}n^{j}b_{j},$

and verify by CAD that $b_{0},b_{2},b_{4},(1-r^{1/6})b_{1}+(1-r^{n/6})b_{2}$
and

$\sum_{j=0}^{4}(1-r^{1/6})^{4-j}(1-r^{n/6})^{j}b_{j}$

are non-negative.

With these non-negativity results proven, the inequality (A.34) follows from
the fact that

$t\leq\tan^{2}\left(\frac{\pi}{2n+2}\right)\leq\frac{1}{n}\leq\frac{1-r^{1/6}}{1-r^{n/6}}.$

Part II. $\theta>\frac{\pi}{n+1}$. We apply the Cauchy–Schwarz inequality to
the vectors$(r-\cos\theta,\sin\theta)$ and $(\cos n\theta,\sin n\theta)$. This
yields

$(r-\cos\theta)\cos n\theta+\sin\theta\sin
n\theta\leq\sqrt{(r-\cos\theta)^{2}+\sin^{2}\theta}\cdot 1,$

which is equivalent to

$r\cos(n\theta)-\cos(n\theta+\theta)\leq\sqrt{1-2r\cos\theta+r^{2}}.$ (A.38)

Equality in (A.38) holds if and only if the two vectors are proportional to
each other, that is, if and only if

$\frac{r-\cos\theta}{\sin\theta}=\frac{\cos n\theta}{\sin n\theta}=\cot
n\theta.$

We define the quantity

$n_{0}(\theta,r)=\frac{1}{\theta}\left(\frac{\pi}{2}-\arctan\frac{r-\cos\theta}{\sin\theta}\right)\in\left[\frac{\pi-\theta}{2\theta},\frac{\pi-\theta}{\theta}\right].$

From the above observation, it follows readily that we have equality in (A.38)
for $n=n_{0}(\theta,r)$.

We now claim that the strengthened inequality

$\frac{-r+\cos\theta+s\sqrt{1-2r\cos\theta+r^{2}}}{1-2r\cos\theta+r^{2}}\leq\frac{1-s}{1-r}\sqrt{\frac{1}{1+4\kappa^{*}\tan^{2}(\theta/2)}},$
(A.39)

holds in the region

$\left\\{(r,s,\theta):r,s\in[0,1),\ 0\leq\theta<\pi,\ s\leq
r^{\max(1,n_{0}(\theta,r))}\right\\},$

where $\kappa^{*}$ is defined by

$\kappa^{*}:=\frac{(1+r)(1-s)(1-s^{1/6})}{(1-r)^{2}}.$

If we assume the validity of this inequality, then the desired result follows
by choosing $s=r^{n}$ in (A.39), and applying (A.38); we point out that, since
$n_{0}(\theta,r)\leq\pi/\theta-1<n$, our desired value of $s=r^{n}$ indeed
belongs to the region.

In order to prove (A.39), first note that the left-hand side of (A.39) is
linear with respect to $s$. Furthermore, computation of the second derivative
of the right-hand side shows that it is concave with respect to $s$. Therefore
it suffices to prove (A.39) for the values of $s$ on the boundary — that is,
for $s=0$ and $s=r^{\max(1,n_{0}(\theta,r))}$. We write $c:=\cos\theta$ for
simplicity of notation.

(1) $s=0$. In this case, the inequality (A.39) reduces to

$\frac{c-r}{1-2rc+r^{2}}\leq\sqrt{\frac{1}{(1-r)^{2}+4(1+r)\frac{1-c}{1+c}}}.$

This inequality clearly holds if $c\leq r$. If $r<c\leq 1$, then we have

$\frac{1}{(1-r)^{2}+4(1+r)\frac{1-c}{1+c}}-\frac{(c-r)^{2}}{(1-2cr+r^{2})^{2}}\\\
=\frac{(1-c)^{2}(1+r)^{2}(1+3c-2r)}{(1-2cr+r^{2})^{2}((1-c)(1+r)(5-r)+2(c-r)(1-r))}\geq
0.$

(2) $s=r$ and $n_{0}(\theta,r)\leq 1$. Elementary manipulations reveal that
the inequality for $n_{0}$ is equivalent to $r\geq 2c$. Moreover, the equality
$s=r$ implies that

$\kappa=\frac{(1+r)(1-r^{1/6})}{1-r}\leq\frac{1+r}{1+\sqrt{r}}\leq 1.$

So it suffices to prove that

$\frac{c-r+r\sqrt{1-2rc+r^{2}}}{1-2rc+r^{2}}\leq\sqrt{\frac{1}{1+4\frac{1-c}{1+c}}}=\sqrt{\frac{1+c}{5-3c}}$
(A.40)

holds for $r\in[0,1]$ and $c\in[-1,r/2]$. We argue that the left-hand side of
(A.40) is increasing with respect to $r$ for $r\in[\max(0,2c),1]$ because of

$\frac{\partial}{\partial
r}\frac{c-r+r\sqrt{1-2rc+r^{2}}}{1-2rc+r^{2}}=\frac{(1-cr)\sqrt{1-2cr+r^{2}}-(1-c^{2}-(r-c)^{2})}{(1-2cr+r^{2})^{2}},$

and that

$(1-cr)^{2}(1-2cr+r^{2})-(1-c^{2}-(r-c)^{2})^{2}=(1-c^{2})(r-2c)(3r-2c-r^{3})\geq
0.$

Therefore we have

$\displaystyle\frac{c-r+r\sqrt{1-2rc+r^{2}}}{1-2rc+r^{2}}\leq\frac{1}{\sqrt{2-2c}}-\frac{1}{2}\leq\frac{1+c}{3}\leq\sqrt{\frac{1+c}{5-3c}},$

as desired.

(3) $s=r^{n_{0}(\theta,r)}$ and $n_{0}(\theta,r)\geq 1$. We recall that (A.38)
holds for $n=n_{0}(\theta,r)$. This means that (A.39) is equivalent to the
special case of (A.33) where $n$ is replaced by $n_{0}(r,\theta)$. Since we
have $n_{0}\leq\pi/\theta-1$ and therefore $\theta\leq\pi/(n_{0}+1)$, we
invoke the result of the first part to conclude the proof. ∎

The following inequality proves that a Padé approximant of
$\cos(n\theta)-\cos(n\theta+\theta)$ is a lower bound in a small interval
around 0.

######  Lemma A.11.

For $n\geq 1$ and $\theta\in[-\pi/n,\pi/n]$, we have

$\cos(n\theta)-\cos(n\theta+\theta)\leq\frac{6(2n+1)}{3\cot^{2}(\theta/2)+2n^{2}+2n+3}.$
(A.41)

###### Proof.

Without loss of generality assume that $\theta\in[0,\pi/n]$. If
$\theta>2\pi/(2n+1)$ then the left-hand side of (A.41) is negative and there
is nothing to prove. Otherwise let $\phi:=(2n+1)\theta/2\in[0,\pi]$ and
$m:=2n+1$. By elementary manipulations, we see that the inequality (A.41) is
equivalent to

$m\sin\frac{\phi}{m}\geq\left(1+\frac{m^{2}-1}{6}\sin^{2}\frac{\phi}{m}\right)\sin\phi.$

We use the fact that $\sin^{2}({\phi}/{m})\leq(\phi/m)^{2}$ to observe that it
suffices to prove

$m\sin\frac{\phi}{m}\geq\left(1+\frac{m^{2}-1}{6m^{2}}\phi^{2}\right)\sin\phi.$

This is evidently an equality if $m=1$. We claim that the difference between
the two sides is increasing with respect to $m$. Indeed, we have

$\displaystyle\frac{\partial}{\partial
m}\left(m\sin\frac{\phi}{m}-\left(1+\frac{m^{2}-1}{6m^{2}}\phi^{2}\right)\sin\phi\right)$
$\displaystyle=\sin\frac{\phi}{m}-\frac{\phi}{m}\cos\frac{\phi}{m}-\frac{\phi^{2}}{3m^{3}}\sin\phi$
$\displaystyle\geq\sin\frac{\phi}{m}-\frac{\phi}{m}\cos\frac{\phi}{m}-\frac{\phi^{2}}{3m^{2}}\sin\frac{\phi}{m}$
$\displaystyle=\frac{1}{3}\int^{\phi/m}_{0}t(\sin t-t\cos t)\,dt\geq 0.\qed$

###  A.7. A decreasing function

The following technical lemma is of crucial importance in the proof of the
monotonicity property in Lemma 9.5.

######  Lemma A.12.

For $\lambda>0$ and $n\geq 6+36/\lambda$, the function

$\frac{1-r^{n}}{1-r}\exp\left(-\lambda\frac{1-r^{n/6}}{1-r}\right)$

is decreasing with respect to $r$ in the interval $(\exp(-8\lambda/9),1)$.

###### Proof.

By taking logarithmic derivatives with respect to $r$, we see that it suffices
to prove that

$\frac{\partial}{\partial
r}\log\frac{1-r^{n}}{1-r}\leq\lambda\frac{\partial}{\partial
r}\frac{1-r^{n/6}}{1-r}.$

For the left-hand side, we have

$\frac{\partial}{\partial
r}\log\frac{1-r^{n}}{1-r}\leq\frac{(1-r^{n}+r^{n}\log(r^{n}))}{(1-r)(1-r^{n})}$

(which, after simplification, turns out to be equivalent to the obvious $-\log
r^{-1}\geq 1-r^{-1}$), and for the right-hand side (without $\lambda$ and with
$n$ replaced by $6n$)

$\frac{\partial}{\partial
r}\frac{1-r^{n}}{1-r}\geq\frac{(1-r^{n})(1-r^{(n-1)/2})}{(1-r)^{2}}$

(which, after simplification, turns out to be equivalent to the easily derived
inequality $n\leq r^{-(n-1)/2}+r^{-(n-3)/2}+\dots+r^{(n-1)/2}$). Therefore, it
suffices to prove that

$\frac{(1-r^{n}+r^{n}\log(r^{n}))}{(1-r)(1-r^{n})}\leq\lambda\frac{(1-r^{n/6})(1-r^{(n-6)/12})}{(1-r)^{2}},$

or, equivalently,

$\frac{(1-r^{n/6})(1-r^{(n-6)/12})(1-r^{n})}{(1-r^{n}+r^{n}\log(r^{n}))(1-r)}\geq\frac{1}{\lambda}.$

We write $s:=r^{n-6}$. It is not difficult to show that the function
$x\mapsto\frac{(1-x)(1-x^{1/6})}{1-x+x\log x}$ is decreasing for $x\in(0,1)$.
Since $s=r^{n-6}\geq r^{n}$, this observation implies that

$\displaystyle\frac{(1-r^{n/6})(1-r^{(n-6)/12})(1-r^{n})}{(1-r^{n}+r^{n}\log(r^{n}))(1-r)}$
$\displaystyle\geq\frac{(1-s^{1/6})(1-s^{1/12})(1-s)}{(1-s+s\log s)(-\log r)}$
$\displaystyle=(n-6)\frac{(1-s^{1/6})(1-s^{1/12})(1-s)}{(1-s+s\log s)(-\log
s)}.$

Therefore it remains to prove that

$\frac{(1-s^{1/6})(1-s^{1/12})(1-s)}{(1-s+s\log s)(-\log
s)}\geq\frac{1}{\lambda(n-6)}$ (A.42)

for $s\in(e^{-8\lambda/9},1)$. Let $h(s)$ denote the left-hand side of (A.42).
The function $s\mapsto h(s)$, for $s\in(0,1)$, equals $0$ for $s\to 0^{+}$
(due to the term $-\log s$ in the denominator), it equals $1/36$ for $s\to
1^{-}$, it is increasing at the beginning, has a unique maximum at
(numerically) $s=0.00003158\ldots=e^{-10.3629\dots}$ (with value
$h(0.00003158\ldots)=0.0459021\dots$), and from there on is decreasing. Since,
by assumption, we have $\lambda(n-6)\geq 36$, the inequality (A.42) will be
satisfied on an interval of the form $[y,1]$, with $y$ depending on $\lambda$
and $n$.

We have $h(10^{-12})=0.0322464\ldots>\frac{1}{36}=0.02777\dots$. Since
$10^{-12}$ is smaller than the place of the unique maximum of $h(s)$, this
implies

$h(s)\geq\frac{1}{36}\geq\frac{1}{\lambda(n-6)},\quad\quad\text{for
}s\in(10^{-12},1).$ (A.43)

In order to get an estimate for $y$, we observe that the function $s\mapsto
h(s)(-\log s)$, that is,

$s\mapsto\frac{(1-s^{1/6})(1-s^{1/12})(1-s)}{(1-s+s\log s)},$

is decreasing for $s\in(0,1)$. Its value at $s=10^{-12}$ is
$0.891\dots>\frac{8}{9}$. Therefore, we have

$h(s)\geq\frac{8}{9}\frac{1}{(-\log s)},\quad\quad\text{for
}s\in(0,10^{-12}).$

If we now choose $y=e^{-\frac{8}{9}\lambda(n-6)}$, then we have

$h(s)\geq\frac{8}{9}\frac{1}{(-\log
s)}\geq\frac{1}{\lambda(n-6)},\quad\quad\text{for }s\in(y,10^{-12}).$

Together with (A.43) and the fact that $n\geq 7$ by assumption, we have proven
(A.42) and thus the lemma. ∎

###  A.8. A cosine inequality

The elementary cosine estimate below is needed in the proofs of Theorems 10.2,
10.3, and 10.5.

######  Lemma A.13.

For $x\in[-\pi/6,0]$ and all integers $m$, we have

$\left|\cos\left(x-2m\pi/3\right)\right|\geq\begin{cases}\frac{1}{2},&\text{for
}m\equiv 0,1~{}\text{\em(mod $3$)},\\\
\left|\cos\left(\pi/3-x\right)\right|,&\text{for }m\equiv 2~{}\text{\em(mod
$3$)}.\end{cases}$ (A.44)

###### Proof.

We distinguish the congruence classes of $m$ modulo $3$. If $m\equiv 0$ (mod
$3$), then we have

$\left|\cos\left(x-2m\pi/3\right)\right|=\left|\cos\left(x\right)\right|.$
(A.45)

The claim on the right-hand side of (A.45) is then straightforward to verify.
The case where $m\equiv 1$ (mod $3$) can be treated similarly. On the other
hand, for $m\equiv 2$ (mod $3$) we actually have

$\left|\cos\left(x-2m\pi/3\right)\right|=\left|\cos\left(\pi/3-x\right)\right|.\qed$

## References

  * [1] G. E. Andrews, On a conjecture of Peter Borwein, J. Symbolic Comput., 20 (1995), 487–501.  Symbolic computation in combinatorics $\Delta_{1}$ (Ithaca, NY, 1993).
  * [2] G. E. Andrews, R. A. Askey and R. Roy, Special Functions, Encyclopedia of Math. And Its Applications, vol. 71, Cambridge University Press, Cambridge, 1999.
  * [3] G. E. Andrews, R. J. Baxter, D. M. Bressoud, W. H. Burge, P. J. Forrester, and G. Viennot, Partitions with prescribed hook differences, European J. Combin., 8 (1987), 341–350.
  * [4] A. Berkovich, Some new positive observations, Discrete Math., 343 (2020), Art. 112040, 8 pp.
  * [5] A. Berkovich and S. O. Warnaar, Positivity preserving transformations for $q$-binomial coefficients, Trans. Amer. Math. Soc., 357 (2005), 2291–2351.
  * [6] G. Bhatnagar and M. J. Schlosser, A partial theta function Borwein conjecture, Ann. Comb., 23 (2019), 561–572.
  * [7] J. M. Borwein, P. B. Borwein and F. G. Garvan, Some cubic modular identities of Ramanujan, Trans. Amer. Math. Soc., 343 (1994), 35–47.
  * [8] D. M. Bressoud, The Borwein conjecture and partitions with prescribed hook differences, Electron. J. Combin., 3 (1996), Research Paper 4, 14 pp.  The Foata Festschrift.
  * [9] G. Gasper and M. Rahman, Basic Hypergeometric Series, Encyclopedia of Mathematics And Its Applications 35, Cambridge University Press, Cambridge, 1990.
  * [10] T. Granlund and the GMP development team, GNU MP: The GNU Multiple Precision Arithmetic Library, 2002–2016.  http://gmplib.org/.
  * [11] M. E. H. Ismail, D. Kim, and D. Stanton, Lattice paths and positive trigonometric sums, Constr. Approx., 15 (1999), 69–81.
  * [12] D. M. Kane, Resolution of a conjecture of Andrews and Lewis involving cranks of partitions, Proc. Amer. Math. Soc., 132 (2004), 2247–2256.
  * [13] M. Kauers, How to use cylindrical algebraic decomposition, Sém. Lothar. Combin., 65 (2010/12), Art. B65a, 16 pp.
  * [14] M. J. Schlosser and N. H. Zhou, On the infinite Borwein product raised to a positive real power, Ramanujan J., (2021), to appear.
  * [15] A. Sidi, Practical Extrapolation Methods. Theory and Applications. Cambridge Monographs on Applied and Computational Mathematics, vol. 10. Cambridge University Press, Cambridge, 2003.
  * [16] C. Wang, An analytic proof of the Borwein Conjecture, Adv. Math., 394 (2022), Paper No. 108028, 54 pp.
  * [17] S. O. Warnaar, The generalized Borwein conjecture. I. The Burge transform, in $q$-series with applications to combinatorics, number theory, and physics (Urbana, IL, 2000), vol. 291 of Contemp. Math., Amer. Math. Soc., Providence, RI, 2001, pp. 243–267.
  * [18] , The generalized Borwein conjecture. II. Refined $q$-trinomial coefficients, Discrete Math., 272 (2003), 215–258.
  * [19] A. Zaharescu, Borwein’s conjecture on average over arithmetic progressions, Ramanujan J., 11 (2006), 95–102.