{'fraction_non_alphanumeric': 0.0313976622730664, 'fraction_numerical': 0.010134294951504601, 'mean_word_length': 4.645840645840646, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Multivariate Pair Trading by Volatility&Model Adaption Trade-off

Pair trading is one of the most discussed topics among financial researches. Despite a growing base of work, portfolio management for multivariate time series is rarely discussed. On the other hand, most researches focus on refining strategy rules instead of finding the optimal portfolio weight. In this paper, we brought up a simple yet profitable strategy called Volatility&Model Adaption Trade-off (VMAT) to leverage the issues. Experiment studies show its superior profit performance over baselines.


Introduction
Trading across equities is a long lasting research hotspot over time. The classical approach of using a simple two step method to determine the relationship between two time series (Gatev et al., 2006) has been well established both theoretically and empirically (Do and Faff, 2010). Later, more refined correlation methods have been introduced (Perlin, 2007;Chen et al., 2019). Beside the simple algorithmic approaches, methods that assess the comovement between pairs by cointegration testing have come into spotlight (Vidyamurthy, 2004). For multivariate time series, generalized cointegration approaches have been introduced (Galenko et al., 2007;Dunis and Ho, 2016). In the domain of utilizing time series forecasting techniques, there is also the classical method that model the simple spread between the pairs of equities (Elliott et al., 2005) as well as more complex framework based on modern machine learning methods (Huck, 2010).
Despite the growing base of work, there is only a relatively small amount of strategies designed for multivariate scenarios. On the other hand, while most methods concentrate on refining the strategy rules (i.e. when to participate and when to bail out), they put less discussion in determining the portfolio weight allocation. However, optimizing the portfolio weight is crucial for profiting.
To leverage the issues, we introduce our strategy framework called Volatility & Model Adaption Trade-off (VMAT) in this paper. The framework first finds optimal portfolio weight for multivariate time series by solving a tradeoff between AR model predictability and volatility of the portfolio process. Then, it determines participation by controlling the profiting probability in the trading period. Experiment studies show that VMAT has superior profit performance over the baselines including the traditional cointegration method especially when the length of trading period is limited.
The paper is organized as the following: in section 2, we unify the problem formulation for the pair trading research, and then develop our framework by generalizing traditional baselines; in section 3, we study multiple empirical issues of VMAT based on real data experiments; in section 4, we summarize VMAT's advantages and further consideration.

Problem Formulation
Formulate equities as a multivariate time series X t ∈ R p + . A trading strategy of a limited trading period d at time t is characterized by three elements: The strategy aims to maximize the log return of the portfolio.
For the simplicity of discussion, we employ a greedy approach for time to bail function l t :l It means that the strategy finishes the arbitrage as long as profit emerges. For the rest of the discussion in this paper, we focus on developing w t , δ t .

What's Beyond Baselines?
Classical statistical arbitrage methods aim to form a long term equilibrium relationship between multivariate series (Galenko et al., 2007). The strategy tends to find abnormal portfolio value and then perform the arbitrage over a future time point where the value will revert to the equilibrium (a.k.a mean reverting). The strategy is formally called cointegration approach (Krauss, 2015).
Empirically, the strategy first finds a weight vector w t such that y t = w T t logX t is stationary. Then the strategy selects a δ t such that the profiting probability will be controlled in the following trading period. Due to the stationarity of the process, the probability of profiting in the trading period can be approximated by the profiting probability on the stationary distribution when d → ∞. Additionally, by assuming the stationary distribution is asymptotically normal and we can approximate the joint profiting probability by the product of the single variate profiting probability, we can derive a δ t that control the profiting probability over level α: In practice, the mean and variance of asymptotic normal distribution is then estimated by the limited sample of formation period.
The method heavily relies on the assumption of the trading period d approaches infinity, which is not the case in real life due to the customer demand or the risk of low liquidity. When d is limited, the exact profiting probability can not be approximated.
A naturally question will be followed: what if we can employ time series techniques to model the stationary univariate time series, so that we can know better of the exact profiting probability? It's easy to see the plausibility. For example, if we assume the stationary univariate time series truly follows an AR process. Additionally, we can consistently estimate the coefficients of the correct AR structure. Then, by employing this additional modeling knowledge, we can formulate the exact profiting probability by comparing to the forecast intervals of AR model.
One step further, if we have a strong forecasting model that not only can fit stationary univariate time series, but also a larger class of series, do we still have to form a stationary process from the multivariate series? This question leads us to probe into the essence of profitability of statistical arbitrage strategies.
In our understanding, the profitability of statistical arbitrage strategies can be separated into two parts: predictability and volatility. While the volatility describes the scale of potential profit, the predictability represents the likelihood of profiting.
The traditional cointegration approach focus on raising predictability of the portfolio series by deriving stationarity, but ignored profitability conveyed through the volatility of the series, thus traditional cointegration approach is sub-optimal.
On the other hand, one can raise the volatility of a formed series to obtain larger scale of profiting margin, but the series may become highly unpredictable. Therefore, increasing in the overall profit will not be ensured.
In the next section, we will introduce a framework called Volatility & Model Adaption Trade-off (VMAT) to entackle the above issue. The VMAT framework employs AR model for univariate time series and adopts the concept of profiting probability control from the traditional cointegration approach. It extends the profitability from predictability only to an optimal trade-off between volatility and predictability.

VMAT: Volatility & Model Adaption Trade-off
At each trading time t, VMAT finds w t to optimize the trade-off between predictability and volatility.
Note that λ is a tuning parameter that controls the relative importance between volatility and predictability. While the volatility of an univariate time series is easy to estimate, it's hard to measure the predictability of the series on a given model framework. For simplicity of optimization, we utilize a simple AR model and measure the predictability by its squared error loss.
Then we rewrite the optimization as the following and solve w t independently at each trading time t: In the above optimization, we take the last L + 1 data in the history of time t to train w t , β t where β t is the coefficient vector for AR(p) model; [logX (t −p):(t −1) ] is the k × p design matrix for AR(p) model where k is the dimension for multivariate series; L as a parameter is the length of the formation period; logX is the sample mean of logX t over the formation period. Also note that the constraint is changed from L1 to L2 for easiness of the optimization.
The optimization conveys the idea of trade-off through the parameter λ. When λ approaches infinity, the optimal w t becomes the weight vector w M axV ar t that tries to maximize univariate series volatility. When λ = 1, the objective becomes the likelihood ratio statistic of the AR(p) model over a null model (i.e. sample mean). Therefore, the tuned λ should be between 1 and infinity.
For solving the optimization, we can see that the partial optimal estimator β t (w t ) is simply the OLS estimator for AR(p) model on the univariate time series {w t logX t }. For the partial optimal estimator forŵ t (β t ), we are solving a quadratic programming problem where w t is constrained on a unit sphere.
K(β t ) is a k×k matrix defined by β t and the data {X t } from the optimization. Solving the above quadratic programming problem yield the partial optimal estimatorŵ t (β t ) which is the eigenvector for K(β t ) that correspond to the largest eigenvalue.
After defining the partial optimal estimatorsβ t (w t ),ŵ t (β t ), we use the following n-step coordinate descent algorithm to estimate the global optimal w t : Algorithm 1: VMAT(AR) n-step coordinate descent w M axV ar t denote the w t initiated by the cointegration vector or the vector that tries to maximize univariate series volatility. In practice, we usually only allow 1 iteration of the algorithm due to the fast convergence speed.
After we have determined the optimal w t , we can develop δ t by the same concept in the cointegration framework : cover the profiting probability. Recall that we define y t = w T t logX t .
ŷ t+i denotes the i-step ahead forecast from y t by the fitted AR(p) model; Err(ŷ t+i ) denotes the forecast error ofŷ t+l . Φ is the CDF function of the standard normal distribution.
As we mentioned in the last section, we use greedy approach for the bailing timel t .

Select optimal λ
We develop two methods for the λ selection: one is by the cross validation and the other is by the backward selection with goodness-of-fit tests.
For CV selection, we evaluate the VMAT strategy performance over several trading time before the current time with different choices of λ. Then we select the optimal λ that has the highest averaged profit.
For the backward selection (later we name it VMAT Tame), we start the VMAT optimization with a large λ. We decrease the λ until the residual of the AR(p) model doesn't reject the null hypothesis of the Ljung-Box tests.
The computational complexity of both methods are linear to the size of the search space in the worst case scenario. However, in practice, the second method is usually faster. Furthermore, it's easier to specify the search space of λ in the second method.

Experiment
In this section, we experiment our methods on two data sets and discuss multiple issues on them.

Dataset
We collect two data set for model evaluation: • Data 1: 5 years daily adjusted close price for Coca-Cola Co (KO) and PepsiCo Inc (PEP) from April 8th 2016 to April 9th 2021. The data is therefore a (252 * 5) × 2 matrix. For either of the two dataset, we create three different data scenarios by specifying d = 3, 7, 14, which represent strategies are allowed in short trading period, medium trading period and long trading period respectively. Intuitively, the shorter of the trading period is, the harder of profiting will be.

Arbitrage Performance
In this subsection, we study the arbitrage performance of different methods across different data scenarios.
• Cointegration approach. It controls profiting probability based on the stationary distribution.
• Cointegration AR. It controls profiting probability based on fitting the AR model on the stationary process.
• MaxVar AR. It controls profiting probability by forming a maximized volatility univariate series, and fitting the AR model on it.
• VMAT CV. Our method with λ selected by cross validation.
• VMAT Tame. Our method with λ selected by backward goodness-of-fit testing.
For all the methods above, we fix their parameters p = 10, L = 60, α = 0.999. The parameter values might not be the optimal in terms of empirical profiting performance. In later section, we also show that it's necessary for advanced fine tuning in order to achieve optimal profit. But for the simplicity of model comparison, we fixed them the same across different data scenarios.
The strategy of each method will be executed independently on each time point over the evaluation period. In the end, we collect profit and loss on each time point and compute the following performance metrics: • PL average. Sample mean and standard error will be reported.
• Signal rate. The rate of strategy participation (i.e. position not equals to zero).
• Control rate. The rate of strategy finishes arbitrage before reach the time limit d.
• Profit rate. The ratio of profiting days over all days. Non-participation days will count as non-profit days.
• Max draw. The maximum drawback (a.k.a the largest loss).
The results of scenarios "data 1, d = 7" and "data 2, d = 7" are shown below. The rest of tables are in Appendix A.  From the tables we can observe that in all data scenarios, VMAT with optimized λ achieves the highest overall profit; On the other hand, VMAT exhibit higher profit when the dimension of multivariate series increases. This is an interesting phenomenon since traditional strategy usually fails at high dimension situation; Beside the profit, VMAT also achieves comparable signal ratio, control ratio and profiting ratio to the baseline methods. However, VMAT as a profiting strategy usually has higher max drawback comparing to the traditional cointegration approaches.

Profit as a long-term strategy
We plot the cumulative profit of VMAT over 5 years when d = 7. As it shows in Appendix B Figure B.1, VMAT gains profit at most time points regardless of the fluctuation of the spread, especially when no systematic risks occurs; When systematic risks occurs, VMAT has the capability of turning it into profit. This can be observed by the surged profit around Jan 2020 when the recession in the stock market emerged.

Sensitivity to parameters
We test VMAT's performance over different values of the parameters. The experiments are performed on both data sets with fixed d = 3. The results are shown in Appendix C Figure C.2.
First of all, we test the impact of λ on the list [1,3,5,7,10,13,20,30]. To our surprise, VMAT is resilient to different λ. For data 1, the profit is mostly unchanged; For data 2, no statistical difference in profit is found across different λ.
Then, we test the impact of different α on the list [0.4, 0.65, 0.8, 0.9, 0.95, 0.99]. The profit doesn't change much until alpha reaches a very large value.
We move on to test different p with a list [5,7,10,13,17,21,25,30]. The lag order p is influential to the profit as its presenting a upside down U-shape curve. Fine tuning is needed for p in order to optimize the strategy profit.
At last, we test different L in [30, 40, 50, 60, 70 ,80]. The pattern of profit over different L seems different between the two data set: for data 2, the curve has U-shape while for data 1 it's the opposite. Since L is also influential to the profit, fine tuning is needed in order to optimize the strategy profit.

Computation
We study the behavior of the coordinate descent algorithm. We build VMAT strategy on the last possible trading time of two data sets with d = 3, L = 60, p = 10, λ = 1. w 1 as the first element of w is presented along iterations of the algorithm.
As shown from Appendix D Figure D.3 D.4, the algorithm is robust in initial method and converges by only one step.

Conclusion
In this paper, we introduce an innovative statistical arbitrage framework for multivariate time series. It finds optimal portfolio weight by solving volatility & model adaption trade-off, and determine participation by controlling the profiting probability in the trading period. Experiments have shown that VMAT has superior profit performance over the baselines including the traditional cointegration method especially when the length of trading period is limited.