Alt

Blog

Recession Prediction via Signature Kernels Enhanced with Quantum Features


Rigetti Computing¹, Moody’s Analytics², Imperial College London³ 

¹Marco Paini, Ernesto Palidda, David Garvin, Rebecca Malamud, Alice Boughton

²Sergio Gago, Ricardo Garcia, Eric Gaus

³Antoine Jacquier, Cristopher Salvi


Introduction

Quantum computing is a transformative emerging technology with the potential to significantly improve how we solve complex computational problems. By leveraging the laws of quantum physics, quantum computers process information in a fundamentally new and more powerful way compared to classical computers. Many financial organizations are using machine learning to improve their efficiency, reduce their risk, and deliver better outcomes to their customers. Combining these new methods may further improve capabilities.


Among different classes of data, data streams are of notable importance for financial institutions, and understanding and extracting value from them can generate a significant advantage. Imperial College London researchers have focussed on this challenge and have developed algorithms for processing complex streams of data using rough path theory — a modern mathematical framework describing the effects a stream can generate when interacting with non-linear dynamical systems.


Forecasting economic recession periods is an interesting example of a machine learning problem on data streams and is vital for policymakers, financial regulators, and market participants in the face of the potential downside risks of an economic slowdown. Moody’s has developed classical machine learning algorithms to classify recessions and models to assess how national and global market data inform us of the risks of future recessions.


In this blog post, we illustrate a novel approach for addressing the problem of forecasting economic recession periods using cutting-edge quantum machine learning techniques, combining classical signature methods with a quantum data transformation. To demonstrate the computational power of the method, we simulated the quantum computer on classical hardware, separating the effects of the quantum computer’s errors from the algorithmic results.


Rigetti’s priority is achieving narrow quantum advantage (nQA), the inflection point at which quantum computers can solve a practical, operationally relevant problem with improved accuracy, speed, and/or cost, when compared with the best classical alternatives. To progress toward achieving this goal, Rigetti focuses on quantum machine learning applications, working closely with financial and academic institutions, to ensure that the problems examined are real-world problems of value and that the methods developed have a strong theoretical foundation.


The Business Problem

“What is the likelihood of a recession occurring in the United States over the next 12 months?”

 

This question helps policy and decision makers mitigate the negative consequences of an incoming recession. Furthermore, asset managers can use these signals for scenario analysis and to build factor portfolios.

Estimating the probability of a recession can be cast as a regression problem. For the United States, the dependent binary variable (label), namely the recession status, can be determined using the National Bureau of Economic Research (NBER) criteria [1] of a sustained slowdown in economic activity. A common definition of recession is two consecutive quarters of economic contraction — or ‘negative growth’ — in Gross Domestic Product (GDP); however, NBER takes a holistic view on data, inclusive of the labor market, consumer and business spending, industrial production, and incomes. The set of independent, explanatory variables (features) consists of macroeconomic and financial time series and can broadly be classified as consumer (e.g. house prices), industrial (e.g. industry price index) and macro financial (e.g. stock price, yield curve) variables. Specifications for the recession forecast model of each country may vary. Structural economic factors, data frequency, accuracy, and length of historical time series are some of the considerations within these specifications. As the NBER relies on various government statistics that are reported with lags, it cannot designate a recession until after it has started.

We focus in this work on a set of predictors or leading indicators that have historically been confirmed to signal recessions quite well for the United States economy. In this case, some of the best indicators of an impending recession are macro financial variables. Recessions are, in fact, always preceded by big declines in stock prices, as investors sniff out weakening sales and profits at large publicly traded companies. However, the converse is not necessarily true, as stock declines do not always signal the start of a recession. Therefore, it is necessary to look at financial market conditions through a broader lens. More specifically, the yield curve, a consistent and reliable recessions predictor at the 12-month forecast horizon, with the addition of alternative macroeconomic and financial market related predictors enhances recessions predictability.

Regression-based models for discrete events such as probit/logit [2] models are used by Moody’s economists and, more generally, by the wider community of economists and risk modellers, to calculate probabilities of a recession. In this work, we will therefore use the forecasts generated by these models, specifically by a probit model [3], as the reference baseline.


Establishing the Classical Baseline

Probit models are a type of regression where the dependent variable can take only two values (e.g. 0 or 1). The purpose of the model is to estimate the probability that an observation with particular characteristics will fall into one of the two categories. The inverse standard Normal distribution of the probability is modelled as a linear combination of the predictors [2]. The use of the probit model presents two main drawbacks: (1) because the probit model is designed to predict recessions at a given forecast horizon, the model may miss recessions that exhibit unusual lead times, and (2) as with any regression framework, the probit model may be subject to the statistical problem of overfitting.

 

The following data, which Moody’s uses for production level cases and predictions, was used for the recession forecasting problem:

  • A binary variable indicating for each month from 06/1978 to 01/2023 whether the US economy is in recession and a 12m-forward-looking recession label, equal to 1 if in the next 12 months there is a recession and 0 otherwise.

  • A set of 8 economic variables that are deemed to be relevant indicators/predictors of a future recession. These are transformations such as moving average, moving standard deviation and/or the difference between two time series of well-known and publicly available economic indicators such as: the US yield curve, the CPI, US employment numbers…


Moody’s economists team aims to answer the following question: ‘what is the probability of a recession in the next 12 months?’. At any date t, the estimated probability of a recession occurring in the next 12 months is given by the estimated probability calculated using the probit model. The parameters of the probit model used at date t are obtained through maximum likelihood estimation using the data available between 06/1978 and time t. Because the target variable used to estimate the probit model is the 12m-forward-looking recession label, the data available goes up to 12 months before t.

The ability of the model to forecast the probability of a recession in the future was evaluated through a backtesting exercise over a ten-year period, which includes two recession events. For every (monthly) date t between 01/2000 and 01/2010, the probit model provided the estimated probability of a recession in the following 12 months.

The performance of the model is measured using the separation indicator, which is defined as the proportion of months over the backtesting period when the estimated probability of recession is less than 1/3 when the forward looking recession label is 0, and when the estimated probability of recession is greater than 2/3 when the forward looking recession label is equal to 1.

Let us note that this backtesting exercise remains in a way of theoretical nature, as it neglects a number of practical factors. The appropriate dataset for an out-of-sample test like this would be to use the real-time data series produced by the federal reserve of Richmond [4], as sometimes time series get revised over time. In particular, CPI and Employment get heavily revised and would be impacted. Also, the exercise ignores any publishing/release delay of economic indicators (for example, CPI corresponding to month t is only available the following month).


Figure 1 illustrates the results of the backtesting exercise for the probit model.

Alt

Figure 1 — Probit model probability estimates of recession occurring within the following 12 months. The solid blue line represents the 12m-forward-looking recession label, the dotted green line is the estimated probability of recession in the next 12 months as given by the probit model. The grey area on the graph corresponds to the backtesting period (01/2000–01/2010).


Quantum-Enhanced Signature Kernels

Signature Kernels

In recent years, rough path theory has played a key role in the design of state-of-the-art machine learning algorithms for processing irregularly sampled, noisy and high-dimensional data streams. The signature, a centrepiece of the theory, provides a top-down description of a signal by capturing its essential information, such as the order of events occurring, and filtering out potentially superfluous information like the sampling rate of the signal. The integration of signature-based tools within existing machine learning pipelines can dramatically decrease memory requirements and increase their expressivity in a wide range of contexts including time series forecasting, optimisation, and generative modelling [5–9].

As for other feature maps, the exponential explosion of signature features makes their application to high-dimensional streams difficult. Nonetheless, inner products of signatures (signature kernels) provide a “dual”, seemingly more amenable, learning approach. The efficient and fast computation of these objects — through well-designed kernel tricks based on recent groundbreaking works [10] led by the Imperial College London team of this blog unveiling a surprising connection between signatures and a class of hyperbolic partial differential equations [10–13] — allows one to benefit from the advantages of working with infinitely many signature features without some of the concomitant drawbacks.


Quantum Features

Many machine learning algorithms map input data into a higher-dimensional space, allowing for easier classifications or regressions. This transformation is known as a feature map. For example, the left-hand side of Figure 2 shows two classes that are hard to separate using a linear boundary. Applying a feature map to transform the data points into the higher-dimensional space of the right-hand side enables easy classification using a linear separator (hyperplane).


Alt

Figure 2: Example of a feature map


A quantum feature map is a special case of a feature map that transforms an input vector of real numbers into a quantum state, which is a vector belonging to a linear space of dimension 2^N for a system of N qubits. The quantum feature map is performed on a gate-based quantum computer by encoding the inputs in the parameters of available parametric gates [14,15]. Given that the outputs of a quantum computer are distributions, we can construct feature maps from the input values to the output distributions (or some properties thereof), which represent the quantum features, as they represent the input features transformed through a quantum circuit.

The quantum features can be used as an alternative to the original dataset in a classical machine learning pipeline. In other terms, with an opportune definition of the quantum circuit and of the observables, replacing the original dataset with one using the quantum features can improve the performance of the machine learning algorithm that would have been applied to the original data set. We will show explicit results in the specific case of the recession forecasting problem in the next section.

Of course, the improvement to the classical machine learning algorithm does not hold in all possible cases and depends on the dataset, on the classical machine learning algorithm, on the choice of the quantum circuit, and on the observables. However, the favourable results are not limited to the recession forecasting problem and the overall transformation from the original features to the quantum features originates from a generalisation of quantum kernel methods [16,17]. The computation of the expectation values of the observables makes use of classical shadows [18], or, more specifically, of the closely related approximate state [19] and can be executed at speed on Rigetti’s system through the FPGA accelerations introduced in [20]. The methods of [20] also enable a scalable readout error mitigation. The circuits used are relatively shallow to allow for effective quantum error mitigation and are parametric to enable adaptability to the input dataset. Nonetheless, for the recession forecasting experiment, given the small number of features, we will use simulation of the QPU results. The reason is to be able to measure the net performance of the quantum-enhanced signature kernel algorithm, separating the effects of noise from the measured results.


Application of the quantum-enhanced signature kernels to the recession forecasting problem — Results

Signature kernel methods can be used to tackle supervised learning problems such as time series regressions and classification as well as unsupervised learning problems such as time series clustering and generative modelling. We follow the methods of [10] and use the Python library [21] (released in [10]) with the original recession forecasting dataset in one case and with the original dataset transformed with the quantum transformation in the other. For the comparison against the probit baseline, we used a classification problem approach, with the target label given by the 12m-forward-looking recession label.

Table 1 presents the experimental results obtained with the probit model and signature kernel models (classical and quantum-enhanced) for recession prediction in the backtesting period. The separation metric is used to report results. It can be seen that the probit model obtains a separation of 77.5%. Classic signature kernels improve the result to 79.2% and the quantum-enhanced version of the signature kernel outperforms both models with a separation of 85.8%, demonstrating how quantum features can improve the performances of a classical machine learning pipeline.


Alt

Table 1 — Experimental results obtained for recession forecasting. The column SEPARATION shows the separation metric obtained by the different models tested over the backtesting period (01/2000–01/2010).


We also considered a more difficult problem, one that produces a prediction over a longer time horizon, using a single model without retraining as in the backtesting exercise we have just presented. This single-shot approach does not correspond to the current practice in most econometrics and financial markets applications. However, the stability of the model can be a desirable property in certain contexts as it improves explainability. The increased difficulty helps to provide further indications on the predictive power of signature kernels, especially when enhanced with quantum features. Furthermore, to also verify the ability of signature kernels in capturing weaker signals, the signature models were tested on a different set of economic variables (S&P500 monthly moves, CMS spread 10Y2Y, Payrolls), one that based on Moody’s SME experience does not have a high explanatory power and that is not currently used in the probit model. The independent and dependent variables used for this experiment ranged from 1960 to 2019. The comparison was only made between the classical and quantum-enhanced signatures as the probit model is too simple and not designed for use in this manner.

In addition, differently from the backtesting approach, the problem in this case was formulated as a regression problem, where the target variable is a continuous recession score, defined as a weighted sum of the recession label over 18 future months for each point in time. Figure 3 shows the results. The results of this additional test are consistent with previous observations: the use of the quantum features improves the performance of the classical signature kernel model. The quantum-enhanced signature kernel, in fact, outperforms the classical signature kernel in the out-of-sample prediction, as visually evident in the smaller difference between the green and red curves in the grey areas of Figure 3.


Alt

Figure 3 — Classical and quantum-enhanced signature kernels for the single-shot prediction of recession for the United States economy. The time interval considered is 1960–2019. The green line is the target recession indicator computed from the binary recession indicator (blue line). The signature kernels are trained to match the target recession indicator on the data of the period in the white part of the figure and tested on the period in grey in the figure.


Looking ahead

Achieving narrow quantum advantage would be a significant milestone for the quantum computing community. In the NISQ era [22], Rigetti believes this is most likely to occur based on improvements made to both the quantum computing hardware and the software algorithms. This work combines enhancements made across Rigetti’s hardware and software stack in order to increase performance. Close collaboration with both theorists and financial industry partners ensure that progress is based on strong foundations and made on use cases of real-world value.

The work presented in this blog can be extended in several directions. From an econometric modelling point of view, the quantum signature kernel based recession predictor can be applied to other countries’ economies, where modelling is often more challenging than the United States case, as some of the economic and financial features can be unavailable and inconsistent. Extending the model to a multi-country setting would also be an interesting undertaking, for example, modelling the Eurozone and providing a probability of recession for each country member. In general, obtaining good predictive performance across a larger sample of countries is difficult and it would be intriguing to assess the predictive accuracy of quantum-enhanced signature kernels in this case.

Beyond the case of recession modelling, different financial time series could be investigated with the same techniques and, even more in general, different applications of machine learning beyond classifications and regressions through signature kernels could be examined. The enhancement of classical machine learning pipelines through quantum features does not seem to be specific to signature kernels.

Finally, we will continue to investigate improvements to the quantum model and, even more importantly, we will optimise execution times and quantum error mitigation techniques, to outperform classical simulation of a quantum circuit on problems with a higher number of features and target nQA.


Cautionary Language Concerning Forward-Looking Statements

This blog post includes “forward-looking statements’’ within the meaning of the federal securities laws relating to the updated business plan, including with respect to its objectives and its technology roadmap, including its ability to achieve milestones including using quantum machine learning and quantum-enhanced signature kernels to progress toward achieving narrow quantum advantage; Rigetti Computing's (from now on the Company) expectations with respect to the anticipated stages of quantum technology maturation, including its ability to develop a quantum computer that is able to solve a practical, operationally relevant problem significantly better, faster, or cheaper than a current classical solution and achieve narrow quantum advantage on the anticipated timing or at all. These forward-looking statements are based upon estimates and assumptions that, while considered reasonable by the Company and its management, are inherently uncertain. Factors that may cause actual results to differ materially from current expectations include, but are not limited to: the Company’s ability to achieve milestones, technological advancements, including with respect to its technology roadmap, help unlock quantum computing, and develop practical applications; the ability of the Company to obtain government contractors successfully and in a timely manner; the potential of quantum computing; the ability of the Company to obtain government contracts and the availability of government funding; the ability of the Company to expand its QCaaS business; the success of the Company’s partnerships and collaborations; the Company’s ability to accelerate its development of multiple generations of quantum processors; the outcome of any legal proceedings that may be instituted against the Company or others; the ability to meet stock exchange listing standards; the ability to recognize the anticipated benefits of the business combination, which may be affected by, among other things, competition, the ability of the Company to grow and manage growth profitably, maintain relationships with customers and suppliers and attract and retain management and key employees; costs related to operating as a public company; changes in applicable laws or regulations; the possibility that the Company may be adversely affected by other economic, business, or competitive factors; the Company’s estimates of expenses and profitability; the evolution of the markets in which the Company competes; the ability of the Company to execute on its technology roadmap; the ability of the Company to implement its strategic initiatives, expansion plans and continue to innovate its existing services; the impact of the COVID-19 pandemic on the Company’s business; the expected use of proceeds from the Company’s past and future financings or other capital; the sufficiency of the Company’s cash resources; unfavorable conditions in the Company’s industry, the global economy or global supply chain, including financial and credit market fluctuations and uncertainty, rising inflation and interest rates, disruptions in banking systems, increased costs, international trade relations, political turmoil, natural catastrophes, warfare (such as the ongoing military conflict between Russia and Ukraine and related sanctions against Russia), and terrorist attacks; and other risks and uncertainties set forth in the section entitled “Risk Factors” and “Cautionary Note Regarding Forward-Looking Statements” in the Company’s Quarterly Report on Form 10-Q for the three months ended September 30, 2022, the Company’s future filings with the SEC, including its Annual Report on Form 10-K for the year ended December 31, 2022 and other documents filed by the Company from time to time with the SEC. These filings identify and address other important risks and uncertainties that could cause actual events and results to differ materially from those contained in the forward-looking statements. Forward-looking statements speak only as of the date they are made. Readers are cautioned not to put undue reliance on forward-looking statements, and the Company assumes no obligation and does not intend to update or revise these forward-looking statements other than as required by applicable law. The Company does not give any assurance that it will achieve its expectations.


Bibliography

[1] Moore, G. (1983), “What Is a Recession?”, link.


[2] Probit and Logit, Reed College, link.


[3] Probit model, Wikipedia, link.


[4] Real-Time Data Set for Macroeconomists, Federal Bank of Philadelphia, link.


[5] Kidger, P., Bonnier, P., Perez Arribas, I., Salvi, C., & Lyons, T. (2019). “Deep signature transforms”, Advances in Neural Information Processing Systems.


[6] Kidger, P., Morrill, J., Foster, J., & Lyons, T. (2020). “Neural controlled differential equations for irregular time series”, Advances in Neural Information Processing Systems.


[7] Morrill, J., Salvi, C., Kidger, P., & Foster, J. (2021). “Neural rough differential equations for long time series”, International Conference on Machine Learning.


[8] Kalsi, Jasdeep, Terry Lyons, and Imanol Perez Arribas. “Optimal execution with rough path signatures.” SIAM Journal on Financial Mathematics 11.2 (2020): 470–493.


[9] Arribas, Imanol Perez, Cristopher Salvi, and Lukasz Szpruch. “Sig-SDEs model for quantitative finance.” Proceedings of the First ACM International Conference on AI in Finance. 2020.


[10] Salvi, C., Cass, T., Foster, J., Lyons, T., & Yang, W. (2021). “The Signature Kernel is the solution of a Goursat PDE”, SIAM Journal on Mathematics of Data Science.


[11] Lemercier, M., Salvi, C., Damoulas, T., Bonilla, E., & Lyons, T. (2021). “Distribution regression for sequential data”, In International Conference on Artificial Intelligence and Statistics.


[12] Lemercier, M., Salvi, C., Cass, T., Bonilla, E. V., Damoulas, T., & Lyons, T. J. (2021). “SigGPDE: Scaling sparse gaussian processes on sequential data”, International Conference on Machine Learning.


[13] Cochrane, T., Foster, P., Chhabra, V., Lemercier, M., Lyons, T., & Salvi, C. (2021). “SK-Tree: a systematic malware detection algorithm on streaming trees via the signature kernel”, In 2021 IEEE International Conference on Cyber Security and Resilience (CSR).


[14] Maria Schuld, Nathan Killoran, (2018). “Quantum machine learning in feature Hilbert spaces”, link.


[15] Vojtech Havlicek, Antonio D. Córcoles, Kristan Temme, Aram W. Harrow, Abhinav Kandala, Jerry M. Chow, Jay M. Gambetta, (2018). “Supervised learning with quantum enhanced feature spaces”, link.


[16] Maria Schuld, (2021). “Supervised quantum machine learning models are kernel methods”, link.


[17] Hsin-Yuan Huang, Michael Broughton, Masoud Mohseni, Ryan Babbush, Sergio Boixo, Hartmut Neven, Jarrod R. McClean, (2020). “Power of data in quantum machine learning”, link.


[18] Hsin-Yuan Huang, Richard Kueng, John Preskill, (2020). “Predicting Many Properties of a Quantum System from Very Few Measurements”, link.


[19] Marco Paini, Amir Kalev, Dan Padilha, Brendan Ruck, (2020). “Estimating expectation values using approximate quantum states”, link.


[20] Andrew Arrasmith, Andrew Patterson, Alice Boughton, Marco Paini, (2023). “Development and Demonstration of an Efficient Readout Error Mitigation Technique for use in NISQ Algorithms”, link.


[21] Salvi, C., Cass, T., Foster, J., Lyons, T., & Yang, W. (2021), “Sigkernel: Differentiable computations for the signature-PDE-kernel on CPU and GPU”, link.


[22] John Preskill, (2018). “Quantum Computing in the NISQ era and beyond”, link.