# Strategic Portfolio Optimization Using Simulated, Digital, and Quantum Annealing
## 3 Quantitative Investment Strategies
The speed of this moving can mathematically be calculated by the variance  
\[Var(\tau)=\langle|z(t+\tau)-z(t)|^{2}\rangle \tag{5}\]  
in which \(z\) is the log price \((z=log(y))\), \(\tau\) an arbitrary point in time, and \(\langle\ldots\rangle\) the average over all \(t\)s. For a geometric random walk the following is known:  
\[\langle|z(t+\tau)-z(t)|^{2}\rangle\sim\tau \tag{6}\]  
Notation \(\sim\) indicates that the relation for large \(\tau\) becomes equality and for small \(\tau\) the relation deviates from a constant line. If the price series is mean reverting or in a trend, then the formula is the following:  
\[\langle|z(t+\tau)-z(t)|^{2}\rangle\sim\tau^{2H} \tag{7}\]  
Here, \(H\) is the Hurst exponent with a value of \(H=0.5\) for a geometric random walk, \(H<0.5\) for a stationary price series, and \(H>0.5\) for a trend. The trend or stationarity is stronger the larger the difference of \(H\) from 0.5 [24] (p. 51). Since price series are finite sets, the statistical significance of \(H\) must be determined. The hypothesis test for that is the variance ratio test [24] (p. 52), and it tests if  
\[\frac{Var(z(t)-z(t-\tau))}{\tau Var(z(t)-z(t-1))}=1 \tag{8}\]  
The null hypothesis is that the price series is a random walk. If the test equals 1, then a random walk can be rejected; if the test equals 0, then the series may be a random walk. The \(p\)-value of the test gives the probability that the null hypothesis can be accepted [24] (p. 52). Variable \(\lambda\) in the ADF test formula (Equation (4)) is a measure for the time a price series needs to return to its center, also called half-life. For that, the price series must be transformed into its differential form. For this, the Ornstein-Uhlenbeck formula can be used:  
\[dy(t)=(\lambda y(t-1)+\mu)dt+d\epsilon \tag{9}\]  
where \(d\epsilon\) represents Gaussian noise. If \(\lambda\) is positive, then the price series is not stationary, while a \(\lambda\) close to 0 means that it will take a long time until the series returns to its center. Additionally, the measure of half-life provides a guideline for how the period of the moving average and the moving standard deviation for strategies shall be selected. The period is optimal if it is a small portion of \(\lambda\)[24] (p. 53). Most price series are not stationary, however, stationary portfolios can be created out of several distinct price series. This works via the cointegration of price series. Cointegration means that if a linear combination of non-stationary price series can be found, then they are cointegrated with each other. A common combination consists of two price series. Here, one price series is invested in long (an investor bought and owns the asset) and the other is invested with a factor (hedge ratio) in short (an investor lent and sold an asset and returns it later). That is called the pairs-trading strategy. To test the stationarity of the cointegration, the augmented Dickey-Fuller (ADF) test can be used. First, the optimal hedge ratio is calculated by linear regression  
\[S=V_{0}+hV_{1} \tag{10}\]  
where \(S\) is the alleged stationary price series, \(h\) the hedge ratio, and \(V_{0},V_{1}\) are the two distinct series. Using \(S\), a portfolio will be created. On top of the price series of the portfolio, the ADF test is executed to show stationarity. Not all pairs of series are suitable for a pairs-trading strategy. The mathematical techniques presented in this section are crucial for the preprocessing step in our portfolio optimization step. By the use of backtesting strategies on different assets and discarding strategies on assets where the backtest resultsare unsatisfactory, the search set for the portfolio optimization can be reduced. However, the complexity of the optimization problem still remains.