key: cord-0024013-v5bywp2b authors: Puertas, Antonio M.; Trinidad-Segovia, Juan E.; Sánchez-Granero, Miguel A.; Clara-Rahora, Joaquim; de las Nieves, F. Javier title: Linear response theory in stock markets date: 2021-11-29 journal: Sci Rep DOI: 10.1038/s41598-021-02263-6 sha: 0c6eef1947e8e106e843d6e69520405c6444ac72 doc_id: 24013 cord_uid: v5bywp2b Linear response theory relates the response of a system to a weak external force with its dynamics in equilibrium, subjected to fluctuations. Here, this framework is applied to financial markets; in particular we study the dynamics of a set of stocks from the NASDAQ during the last 20 years. Because unambiguous identification of external forces is not possible, critical events are identified in the series of stock prices as sudden changes, and the stock dynamics following an event is taken as the response to the external force. Linear response theory is applied with the log-return as the conjugate variable of the force, providing predictions for the average response of the price and return, which agree with observations, but fails to describe the volatility because this is expected to be beyond linear response. The identification of the conjugate variable allows us to define the perturbation energy for a system of stocks, and observe its relaxation after an event. Linear response theory (LRT) 1 , allows resolving the response of a system to a weak external perturbation considering the dynamics of the system at equilibrium subjected to fluctuations. This is a practical extension of Onsager's regression hypothesis, namely, a system relaxes to equilibrium after an external perturbation in a similar manner as from fluctuations 2 . This powerful tool and the formalism of time correlation functions have been applied to study several physical systems, such as soft matter [3] [4] [5] [6] , spin glasses 7 , or magnetism 8 , but also it has been used to derive a conceptual basis for equilibrium and non-equilibrium thermodynamics 9, 10 . The drawback is that only the first order in the perturbation is retained, which might not be sufficient in some cases 11 . In LRT, a linear perturbation to the equilibrium Hamiltonian of the system is assumed, H = H 0 + AF , where H 0 denotes the Hamiltonian in the equilibrium (non-perturbed) state, and H ′ = AF the perturbation, with F the external force, which is conjugate to the variable A. The theory restricts to small forces, and states that the change in a variable B(t) due to the application of the force is given by 1,12 : where the after-effect function � BA (s) is set by the correlation function: which is calculated in the unperturbed (equilibrium) state, with β the inverse thermal energy, and Ȧ denotes the time derivative of A. LRT, both in the classical and quantum forms, have been applied mainly to the calculation of transport coefficients in several systems, such as colloids, charge transport, ferromagnetization or liquid crystals 13 , but also in other more exotic fields, such as neurophysiology 14 or climate science 15, 16 . In this paper, we aim to apply LRT to a very different field, namely, stock markets. The application of physical theories and models to financial markets has attracted interest since the work of Bachelier in 1900 17 , and in particular in the last three decades [18] [19] [20] [21] . Most models or applications describe financial market dynamics as equilibrium systems subjected to fluctuations, fulfilling the fluctuation-dissipation theorem 22 , such as a Brownian particle or system [23] [24] [25] [26] , while other works try to analyze its entropy or complexity 27, 28 . The non-Gaussianity of fluctuations causing anomalous diffusion has also received attention from the early works of Mandelbrot 29, 30 , where elaborate models to describe such fluctuation distributions have been resolved, e.g., by considering truncated Levy flights 31, 32 , the Tsallis entropy model 33, 34 , hopping in the free energy landscape in glasses [35] [36] [37] , or extending the continuous-time random walk model 38, 39 . www.nature.com/scientificreports/ Within a Physics scope, regime switching models have been applied to market dynamics 40 . Such transition is straightforward for instance in changes in economic policy, such as the Quantitative Easing policies from the European Central Bank (ECB) and the Federal Reserve Board (FED) 41, 42 , or abrupt when unexpected events occur, such is the case of the Great Recession from 2008, or the still ongoing crisis due to the spread of the COVID-19 pandemics [43] [44] [45] . Such regimes are characterized according to economic and business cycles of expansion and recession 46 . There, different classes of random walks have been identified, where the nature of price changes are resolved not due to the unpredictable nature of incoming news but a direct consequence of competition between market forces led by liquidity and market takers and makers 47 . Long-range correlated market orders and activity lead to diffusive and super-diffusive dynamics, while mean reverting limit orders determine sub-diffusive market conditions 36, 47 . In such framework, the linear response formalism has been considered when studying casual relations in markets, where characteristic volatility and stock dynamic regimes are identified as influencing the overall market dynamics prior to financial crashes, while individual volatility of securities follow collective market behavior after the crash event 48 . Moreover, the breakdown of linear response has been found in periods of low market liquidity and transaction, where fluctuations become large enough so that market dynamics is strongly displaced from equilibrium, and second or larger order energy terms must be accounted for in the Hamiltonian of the system 49 . Our aim in this work is to apply LRT to a system of stocks, thus enlarging the applicability of LRT and also advancing in the knowledge of the mechanisms governing the stock dynamics. For this purpose, a given financial market is assumed to be an equilibrium system subjected to fluctuations due to its internal dynamics, and perturbed by external forces. Within LRT we attempt to study weak forces, where the effects are linear with force strength. LRT can provide then the evolution of the system after the application of the external force. Thus, for this analysis the following steps have been followed: (1) measurement of the response of the system after the application of an external perturbation, (2) identification of the variable A(t), conjugate to the force, and (3) calculation of the response function according to LRT, to finally compare it with the "empirical" function obtained in (1) . As a final result, in addition to the extension of LRT, the perturbation energy in a stock market can be defined. Note that since we do not base the identification of the variable conjugate on a physical model, we only rely only on the validity of LRT for stock markets. A database of 862 stocks has been used, corresponding to the companies in the NASDAQ index from 03/01/2000 to 30/10/2020. The "Supplementary Information" to this article provides a similar analysis for a set of European stocks and the NYSE, yielding similar results. Consider a charged colloidal particle in water: internal forces are caused by thermal and density fluctuations in the solvent and provoke the particle Brownian motion, whereas external forces can be caused by electric or gravitational fields 50 . Stock prices, on the other hand, are set by brokers or other practitioners, according to supply and demand, as well as to their investment strategies and expectations; these can be considered as internal forces. However, there are factors that strongly influence market prices, such as political decisions, announcements of results, companies acquisition or merger, bankrupts, ... These can be considered as external forces, which, different from the physical counterpart, act onto the stock prices through the same practitioners as the internal forces. This ambiguous recognition of external forces poses a major problem on their identification, as well as its strength scale, and the conjugate variable A(t), needed for the application of the LRT formalism. In fact, it is generally accepted that only a fraction of the motion of stocks can be attributed to fundamental economic information that could have had a pronounced impact on cash flow forecasts or discount rates 51, 52 . Therefore, we do not make any assumptions concerning external forces, and adopt a phenomenological point of view following previous works on events 53 : a dramatic event, assumed to be provoked by an external force, takes place whenever the absolute value of the one day log-return of a stock surpasses four times the root mean square deviation of log-returns of this stock. This threshold for the definition of an event is arbitrary but in line with previous studies 54 , as it allows the segmentation of events in equilibrium fluctuations or dramatic perturbations. In any case, its specific value has little effect on the results presented below, as far as it is well above 1. In the following, we assume that the external force starts to act at the event time t * , and keeps acting indefinitely, or until a new event takes place. Furthermore, we assume that the impact of different forces are well separated, i.e. the evolution of a stock price after a force is applied relaxes to equilibrium before a new force acts; thus events separated less than 10 days are discarded. With such criteria, ca. 5000 events are identified in the whole set ( ∼ 2300 positive events, with positive log-return v(t * ) > 0 , and ∼ 2700 negative ones, with v(t * ) < 0 ). Note that very dramatic events, such as the financial crisis in 2008 or the COVID19 pandemic in 2020, provoke drastic changes in the price extending over several days 54, 55 , and are excluded from our analysis according to this selection, because LRT is expected to fail for large external forces. The resulting distribution of events per day (affecting different stocks) is a decreasing function, with 75% of the events in days with less than five events, which guarantees that the events are indeed independent. Fig. 1 analyzes the stock log-price after an event, namely the response function of the log-price after an event". Figure 1A presents the distribution of the total log-price variations provoked by the event, namely is the log-price just before the event, and x ∞ is the log-price well after the event. The local minimum at x ∞ = 0 is caused by our definition of events, and disappears if a smaller threshold is selected. On the other hand, the distribution displays positive deviations from Gaussian behaviour for price differences above 0.15x ∞ in absolute value. These deviations are typical in finance, and have been the topic of intense research and debate 21 . To our purpose, the deviation from the Gaussian profile serves to identify "small" and "large" events, and therefore determine the expected validity range of LRT. All subsequent analysis is restricted to small events. In Fig. 1B www.nature.com/scientificreports/ value is presented. This shows an overshoot at t * , namely when the event takes place, followed by a decay within a few days to reach a steady value ( x ∞ is the average log-price between 10 and 20 days after the event). The inset shows positive and negative events separatedly. In addition to the log-price, the dynamics of stocks is also monitored considering the corresponding logreturn and volatility. (The latter represents how fast the price changes, irrespective of the sign of the change, and is calculated as v 2 i (t) ). The average normalized evolution of the one day return and volatility after an event are shown in Fig. 2 . The average log-return for a positive (negative) event increases (decreases) at the event, and decreases (increases) abruptly immediately after it, followed by a slow relaxation to the equilibrium value. The figure represents the normalized evolution averaged for positive and negative events. The volatility, on the other hand, increases at t * and then decreases to the "equilibrium" magnitude at both positive and negative events. Figures 1 and 2 show that the evolution of the log-price, log-return and volatility is abrupt at the event, and then relaxes to a steady value for a few days. From a physical point of view, this indicates that these variables display memory, and according to LRT, the correlation functions with variable A(t), conjugate of the force, should decay with a time scale of a few days. In order to identify this variable, the log-price, log-return and volatility autocorrelation functions (ACF) have been studied (see "Methods"). They are presented in Fig. 3 and show very different behaviour: whereas the log-return reaches negative values within the first day and then relaxes to zero (resembling the velocity ACF in hard spheres), and the volatility ACF presents a similar time scale, but a monotonous decay, the time scale of the log-price ACF is ∼ 50 days. For the purpose of applying LRT, the log-return is more appropriate due to the similarity with the time scale and behaviour of its response function. Therefore, we tentatively identify the log-return, v(t), as the conjugate variable, www.nature.com/scientificreports/ A(t), to the external force. The response of the log-return is therefore provided directly by its ACF, assuming that the force follows a Heaviside functional form, F(t) = F 0 θ(t) as discussed above: Since the strength of the force is unknown, we plot C(v, v) to compare with the normalized response of the log-return in Fig. 2 (black line) . The prediction from LRT agrees with the empirical response function. Once the conjugate variable, A(t) in Eq. (1), has been identified as the log-return, the average evolution of other variables can be readily obtained using LRT. In particular, for the log-price, the integral of the log-return ACF above provides the predicted response, according to LRT: since ẋ = v . This is included also in the right panel of Fig. 1 . Again, good agreement between this prediction and the observations is found. Similar comparisons between the predictions from LRT and the evolution of the log-price and log-return for a set of European stocks and for the NYSE are presented in Figs. 1 and 3 of the "Supplementary Information". Note that in any case, LRT predicts the average response of the variable, and cannot be used to calculate the evolution of a single stock (or in physical terms, of a single trajectory in phase space). The volatility, on the other hand, is a second-order variable and it is not expected that it can be described within LRT. This is tested in the inset to Fig. 2, where the cross correlation function v 2 (τ )v(0) is included (continuous line), as well as the volatility ACF (broken line). None of them correctly describes the observed evolution of the volatility, although the predction from LRT (continuous line), captures qualitatively the slow decay of the volatility after the event. For constant external forces, LRT also provides the coupling constant of the system in the stationary regime as the integral of � BA (t) extended to +∞ , i.e., � B ∞ � = kF 0 . For the case of autocorrelation functions, these constants are the transport coefficients associated with the flux induced by the external force, and depict the Green-Kubo relations 56 . In our case, two coefficients can be calculated: Note that the correlation function v(τ )v(0) is used here, instead of the normalized C(v, v) used above. To test these results, we display in Fig. 4 the average total variation of the log-return, ��v ∞ � = �v ∞ − v(0)� as a function of the log-price total variation, � x ∞ � for small events. The expected linear relationships with the force, yield ��v ∞ � = k v /k x ��x ∞ � , which is also included in Fig. 4 . The data show good agreement with the predictions, particularly for small price variations, where the theory is expected to perform better. For the volatility, the total variation has been also included in the figure as a function of the log-price variation, but the dependence is clearly not linear. Table 1 presents the results of the coefficients k X and k v for the NYSE and European sets of stocks, studied in more detail in the "Supplementary Information". The concomitant tests of the linearity of � v ∞ � vs. � x ∞ � are also presented there. Note that k x and k v are much larger (in absolute value) for the NASDAQ and NYSE than for the European stocks, implying that the European set is less affected by external forces, probably due to its heterogeneity. www.nature.com/scientificreports/ Once variable A has been identified as the log-return, the perturbation energy can be calculated if the force is known. Nevertheless, within the linear regime, the total log-price variation is proportional to the force, x ∞ = k x F , and the energy can be calculated as: The distribution of perturbation energies shows a symmetric bell shape with the expected wings or tails for large (positive and negative) values. Since for both positive and negative events the product �x ∞ �v(τ ) is positive at the event, the sign of k x determines if the energy is positive or negative for both types of events. Our calculations yield a negative k x , which corresponds to a negative perturbation energy, with respect to the value just before the event. Figure 5 presents this energy for both kinds of events. The energy is near zero before and well after the event, when its effect has dissipated, but grows (in absolute value) notably for all events. This effect dissipates as equilibrium is recovered. From a physical perspective, this is equivalent to a system where the energy input dissipates and the system returns to equilibrium. The time scale for the dissipation is the same as for the decay www.nature.com/scientificreports/ of the log-return ACF, as the force is continuously active for t > t * . Interestingly, the figure indicates that the perturbation energy is also non-zero for t < t * , i.e., before the event. This is beyond our current interpretation of the results, where the force can only affect the system for positive times, but could be tackled with a time dependent force. Also, such feature could serve as an indicator of an event in the next few days. Nevertheless, it must be recalled that our modeling considers averages over many different events in 20 years and a set of ca. 850 stocks. Thus, predicting events to a single stock is far beyond the purpose of this work. We have resolved Linear Response Theory as an efficient framework to determine the response of a system such as the stock market, which is indeed hallmarked by fluctuations. The autocorrelation functions of the log-price, log-return, and volatility indicate that the most appropriate variable to be considered conjugate of the external force is the log-return, due to its relaxation kinetics. Thus, the predicted response functions for the log-price and log-return have been calculated and agree with the results obtained from the empirical analysis of stock prices. Both of them show an overshoot at the event, and a slower recovery towards equilibrium within 2-3 days, in resemblance with the behaviour of a dissipative system. The identification of the energy in a stock market represents a major goal, strikingly supported on a well-established physical ground. The results presented here have been obtained for the NASDAQ, extending over the last 20 years considering the stocks that have belonged continuously to the index. Similar results have been also obtained for a set of European national floors, although the statistics is much better in the case of the NASDAQ, and New York Stock Exchange. These results provide further support of the results and conclusions presented here. In any case, we stress that there is no physical model supporting this identification of the log-return as conjugate to the external force. The results presented here are based on a phenomenological approach, but show the compatibility of financial markets with well-established physical theories, as far as an appropriate analogy of variables is performed. All stocks used for this study have been taken from Yahoo! Finance, with a time resolution of 1 day. The databases have been comprised by all stocks that have belonged continuously to the given market. For the NASDAQ (main text) and NYSE (" Supplementary Information") , stocks that have been active from 03/01/2000 to 30/10/2020 were selected, amounting to 862 stocks and 1084, respectively. For the european stocks, the set of stocks is constructed with companies that have belonged continuously to the national indices of the UK (FTSE100), Germany (DAX30), France (CAC40), Spain (IBEX35), Switzerland (SMI), Italy (FTSE MIB), Portugal (PSI20), and Holland (AEX). This set comprises 240 stocks, corresponding to big and stable European companies, sampled every day since 2010-2019. As usual in financial studies, we consider the logarithm of the price, termed log-price, x i (t) and only working days in the analysis, i.e. weekends are not taken into account. The one-day log-return is defined as v i (t) = x i (t) − x i (t − 1) and the volatility is calculated as v 2 i . A dramatic event, assumed to be provoked by an external force, takes place whenever the absolute value of the one day log-return of a stock surpasses four times the root mean square deviation of log-returns of this stock, i.e., if: where n t is the total number of days in our sample. The time auto-correlation function between the discrete variables X and Y, {X i } = {X(t i )} and {Y i } = {Y (t i )} , with i = 1, . . . N , is calculated as: where X and S x stand for the sample mean and standard deviation, respectively. The non-normalized correlation function, XY , has also been used to calculate the coefficients k x and k v . This is defined as: www.nature.com/scientificreports/ Statistical-mechanical theory of irreversible processes. I. General theory and simple applications to magnetic and conduction problems Reciprocal relations in irreversible processes Linear response of a grafted semiflexible polymer to a uniform force field Stress relaxation in viscous soft spheres Emergence of Goldstone excitations in stress correlations of glass-forming colloidal dispersions Linear response theory and green-kubo relations for active matter Linear response in spin glasses Linear response of crystals to electromagnetic fields: Microscopic charge-current density, polarization, and magnetization From dynamics to thermodynamics: Linear response and statistical mechanics Compatibility of linear-response theory with the second law of thermodynamics and the emergence of negative entropy production rates On van Kampen's objections against linear response theory Theory of Simple Liquids Hydrodynamic Fluctuations, Broken Symmetry, and Correlation Functions (Frontiers in physics Linear response in neuronal networks: From neurons dynamics to collective response Climate response and fluctuation dissipaction Can we use linear response theory to assess geoengineering strategies Theory of Speculation Anomalous fluctuations in the dynamics of complex systems: From DNA and physiology to econophysics. Proceedings of 1995 Calcuta conference on dynamics of complex systems Econophysics: Can physicists contribute to the science of economics? Can there be a physics of financial markets? Methodological reflections on econophysics An Introduction to Econophysics Fluctuations and market friction in financial trading Financial Brownian particle in the layered order-book fluid and fluctuationdissipation relations Financial Knudsen number: Breakdown of continuous price dynamics and asymmetric buy-and-sell structures confirmed by high-precision order-book information Derivation of the Boltzmann equation for financial Brownian motion: Direct observation of the collective motion of high-frequency traders Kinetic theory for financial Brownian motion from microscopic dynamics Entropy and econophysics Information measure for financial time series: Quantifying short-term market heterogeneity The variation of certain speculative prices Fractals and Scaling in Finance: Discontinuity, Concentration, Risk Stochastic process with ultraslow convergence to a Gaussian: The truncated Lévy flight Analytic approach to the problem of convergence of truncated Levy flights towards the Gaussian stochastic process Possible generalization of Boltzmann-Gibbs statistics Q-Gaussian diffusion in stock markets Universal nature of particle displacements close to glass and jamming transitions Diffusive and arrested like dynamics in currency exchange markets A model for foreign exchange markets based on glassy Brownian systems The application of continuous-time random walks in finance and economics Coupled continuous time random walks in finance Regime changes and financial markets Flow and stock effects of large-scale treasury purchases: Evidence on the importance of local supply International channels of the Fed's unconventional monetary policy The reaction of stock prices to unanticipated changes in money: A note Forecasting macroeconomic risk in real time: Great and COVID-19 Recessions Economic effects of coronavirus outbreak (COVID-19) on the world economy A new approach to the economic analysis of nonstationary time series and the business cycle Fluctuations and response in financial markets: The subtle nature of 'random' price changes Cross-correlation asymmetries and causal relationships between stock and market risk Anomalous price impact and the critical nature of liquidity in financial markets An Introduction to Dynamics of Colloids What moves stock prices? What moves stock prices: Another look Event studies in economics and finance Characteristics of 2020 stock market crash: The COVID-19 induced extreme event Statistical properties of the aftershocks of stock market crashes revisited: Analysis based on the 1987 crash, financial-crisis-2008 and COVID-19 pandemic Statistical Mechanics of Non-equilibrium Liquids Authors gratefully acknowledge Prof. Dr. Matthias Fuchs for fruitful discussions and feedback. Financial support for this work was obtained from the Spanish Ministerio de Ciencia, Project No. PGC2018-101555-B-I00, and Universidad de Almería, Project No. UAL18-FQM-B038-A (UAL/CECEU/FEDER). All authors contributed equally to the design of the methodology, discussion, analysis and revisions of the manuscript. The authors declare no competing interests. Supplementary Information The online version contains supplementary material available at https:// doi. org/ 10. 1038/ s41598-021-02263-6.Correspondence and requests for materials should be addressed to A.M.P. Publisher's note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.