Adaptive Portfolio Analysis based on the Trend Decomposition of a Financial Time Series: Case Study of the Moscow Exchange

Testing an adaptive modification of the portfolio analysis model with a two-level mechanism of return generation is used to identify the temporal structure of efficient frontiers. The stock market is volatile and, although it is consolidated, it follows different trends at different times. Therefore, stock market processes are viewed as multitrend in nature. It particularly applies to the process of generating returns. For the convenience of the analysis, a multitrend process can be presented as a finite decomposition using adaptation principles. As we have already said, adaptive mechanisms are an important factor for the effectiveness of the stock market. Considering these requirements, the most suitable method is adaptive trend decomposition. In our study, we used data analysis and machine learning methods. The article presents a method of portfolio analysis based on the decomposition of efficient sets into temporal components. This allows for a comparative analysis of portfolio sets regarding their efficiency over different time intervals and enables a dynamic analysis of the temporal structure of efficient sets in order to determine the optimal time for holding the portfolio or changing its structure. A family of efficient sets provides a better understanding of investment opportunities. Our calculations also demonstrated that the temporal structure of a family of efficient sets is more likely to remain robust during the prediction period.


Introduction
To analyse the processes in social and economic systems, we need to obtain their finite decomposition and ensure a meaningful interpretation of the results. Depending on the timeframe, there are an infinite number of trends determining the stock market processes. V.V. Davnis, V.V. Korotkikh [1] and D.A. Endovitsky et al. [2] point out that stock market processes, namely stock returns, are multitrend. Such multitrend processes can be fully reproduced by means of their infinite decomposition into components. However, it is difficult to analyse and interpret the resulting infinite sets of components.
We believe that this problem can be solved by modelling a multitrend process as a finite decomposition using adaptation principles [3]. Considering these requirements, the most suitable method is adaptive trend decomposition. We believe that the adaptive trend decomposition of a financial time series can expand the possibilities of stock portfolio analysis.
The rest of the article is structured as follows. Section 2 describes the initial data and its sources. It also describes the suggested model for the adaptive decomposition of 1160 Adaptive Portfolio Analysis based on the Trend Decomposition of a Financial Time Series: Case Study of the Moscow Exchange multitrend processes and presents the main assumptions regarding the results of the adaptive stock portfolio analysis based on decomposition of time series into trends. This section also describes the research methodology. Section 3 presents the empirical results. We performed the decomposition of the efficient frontier into three baseline trends corresponding to groups of short-, medium-, and long-term investors. As a result, we obtained a family of efficient sets of portfolios. Using the modified Sharpe ratio, we assessed the temporal structure of the efficient sets comprising the family. Section 3 demonstrates the difference in the temporal structure of efficient sets in normal and crisis (turbulent) situations in the market. In section 4, we compare our approach to adaptive decomposition with the existing methods for the decomposition of time series. Section 5 presents the main conclusions.

Materials and Methods
The adaptive model theory and modern portfolio theory appeared and developed parallel to each other. Adaptive modelling methods were first described in [4][5][6][7] with regard to exponential smoothing. The first studies on the theory of portfolio investment [8,9] were also published at that time. Therefore, for instance, it was not possible for Sharpe to use adaptive methods in his portfolio analysis based on single-index models. Today, we can clearly see that new approaches to the modelling of investment processes can be based on adaptive methods. This primarily applies to the processes in the stock market, which are permanently mutating in a constantly changing environment. Hence, adaptive mechanisms are an intrinsic feature of market processes. Although the main tendencies and factors of the past do not last long, adaptation helps to retain the key properties of the market under changing conditions. When we think of economic systems as inertia, it is hardly possible to find optimal solutions. From the point of view of statistics, the results of most financial models are not reliable. It is therefore obvious that the modelling of market processes should correspond to their nature, i.e. it should be adaptive. At the moment, there are a number of specific approaches based on adaptive modelling, namely [10][11][12][13][14][15][16]. However, their correct application in economics often requires a special mathematical apparatus to be developed. This article studies the possibility of using an adaptive approach to stock portfolio analysis.
Although there are a large number of methods for the decomposition of stochastic processes (e.g., conventional decomposition [17][18][19][20], spectral analysis [21][22][23][24][25][26], and harmonic analysis [27,28]), their applicability to the modelling of stock market processes is highly problematic. These methods are better suited for the analysis of the specifics of the processes occurring in technical, rather than social and economic systems.

Data
The data analysed in this paper come from the Moscow Exchange [29] (MOEX) and cover a time period from January 2015 to December 2020. Our sample included all common equity traded on MOEX. The data included values of the following sectoral indices: Transport index (RTSTN), Financials index (RTSFN), Chemicals index (RTSCH), Oil and Gas index (RTSOG), Electric Utilities (RTSEU), Metals and Mining index (RTSMM), Telecommunication index (RTSTL), Consumer index (RTSCR), IT index (RTSIT), and Real Estate index (RTSRE).
The observed time period included both normal (January 2015 -December 2019) and turbulent (2020) periods. In order to assess the effectiveness of the adaptive trend decomposition, we analysed the said periods separately.

A Model for the Adaptive Decomposition of Multitrend Processes
A model with a multilevel structure of the adaptive mechanism used for the identification of tendencies occurring in multitrend processes can be presented as follows: (1) where is an augmented matrix of the values of independent variables smoothed with a window of ; is the vector of values of the dependent variable smoothed with the window; is the initial guess vector of the estimates of the parameters of the k-th baseline trend; is the initial guess of the matrix of the k-th basic trend inverse to the matrix of the system of normal equations for the OLS.  is the initial guess vector of the estimates of the parameters of the k-th baseline trend; ( ) 1 k t ϕ − is the estimate of the current value of the k-th baseline trend, which is determined using the parameters of the k-th baseline trend of the previous period; is the current value of the dependent variable smoothed using the window k p ; is an invert matrix adjusted considering recent observations. Then, we obtain where is the augmented matrix of independent variables smoothed with the window ; is the vector of current values of the k-th baseline trend calculated using the parameters of the k-1-th baseline trend; is the vector of the current values of the dependent variable smoothed with the window ; I is the identity matrix; ρ is the exponential smoothing parameter (adjustable) which ensures the domination of a certain number of recent observations when identifying the parameters of the baseline trend; λ is the smoothing parameter for the current correction vector (adjustable); γ is the reaction time of the adaptive mechanism (adjustable); is the number of observations processed during one stage of the multistep adaptive process (adjustable).
For k K = we obtain (10) (11) ( ) ( ) The model includes blocks. Each block represents the calculations necessary for the identification of the k-th baseline trend. To use the suggested calculation scheme, we need the initial values of , , which are determined using the ordinary least squares method (1)-(3). The initial data are derivative time series , corresponding to each baseline trend .
The first block includes formulas (4)-(6) that perform recurrent OLS. Using recurrent OLS for the current assessment of the parameters of the first baseline trend is equivalent to using OLS for the whole data set.
blocks represent a specific procedure for the assessment of the current parameters of the corresponding baseline trend (7)- (9). The specific feature is that the structure of the adaptive mechanism can be tuned and performs interrelated assessment of the parameters of the baseline trend. The estimates of the baseline trend are adjusted to the changes in the derivative time series and to the error of approximation of the analysed time series to the previous baseline trend. Unlike in the first block, the feedback loop involves data weighting in favour of the new data. This block uses a multistep mechanism which helps to update the baseline trend so that its dominant tendency would be the one present in several recent observations used for the adjustment. This makes the identified baseline trend robust to random outliers.
When implementing the last K-th block, a single-step recurrent OLS method is used (11)- (12). It performs the adjustment using a single latest observation. The purpose of the K-th block is to identify new tendencies at the formation stage and filter random fluctuations using the adjustable structure of the adaptive mechanism.
To determine the optimal values of the adjustment parameters , , , we used the criterion of the minimum of the sum of the maximum absolute prediction errors calculated using the training set with a floating window. This criterion yields the best possible homogeneously low approximation error for the whole prediction period.

Assumption 1. Market processes are determined by the interactions of investors who can be divided into groups according to their investment horizon.
Let there be groups including investors in the market. The investors are divided into groups according to their investment horizon. Investors distribute their capitals depending on their utility functions  Considering this assumption, in order to model the market processes we need to perform an adaptive decomposition of time series into investment horizons we are interested in. This allows the identification of specific groups of investors depending on their investment horizon. The adaptive mechanism of the stock market does not in fact always guarantee its effectiveness. At the same time, it is the adaptive mechanism that undoubtedly ensures the maximum possible effectiveness of the market. Using adaptation principles when modelling market processes helps to solve two important problems: the interconnection between the tendencies at different time intervals and the changes in the parameters of the market process over time.

Research Methodology
Let the utility function dominating in the k-th group of investors be presented as . Let an investor aim at maximising the utility function when placing free capital in a portfolio of risky assets . Then the space of investment opportunities can be considered as a space of portfolio decisions. The efficient frontier for the k-th group of investors is then identified using Sharpe's single index model augmented by a two-level mechanism of return generation. Each group acts independently of the others and solves the problem of building a w portfolio at minimum risk per return unit, which, considering the specifics of Sharpe's model modified with a two-level mechanism of return generation, is presented as is the modified Sharpe ratio; Sh is the Sharpe ratio; As is the portfolio skewness; Ek is the portfolio kurtosis.
The efficient sets inside the family are placed in descending order. We assume that the order of the efficient sets, i.e. its temporal structure, is stable for the adaptive trend decomposition used in the study.
The two-level mechanism of return generation implies that the parameters of this modification of the single index model are assessed in several steps.
The first level of the suggested mechanism determines the connection between the returns of the analysed portfolio group and the market profitability. This level is based on the idea that the market is effective because it is an adaptive dynamic system. It does not mean that individual investors and financial tools (parts of the whole) have the same degree of adaptability. Therefore, it is only the behaviour of the whole group (not a single investor or financial tool) that is similar to the behaviour of the market.
When modelling this level of the mechanism for generating return, we follow the principles of adaptation. Here we identify the tendencies characteristic for a group of assets as a whole. It is also reasonable to consider the results of the adaptive trend decomposition in relation to the investment horizons, as well as the existing reproduction of the effective market process. The adequacy of the calculation is to a large extend ensured by the alternative and proportional expectations hypotheses detailed in [3].
The second level identifies the tendencies for each particular asset within the analysed portfolio group. These tendencies should also be evaluated separately for each investment horizon.
Parameters of the single index model (13) are calculated using the results obtained by the models of the first and second level. This principle is implemented by the proposed method of portfolio analysis based on adaptive trend decomposition. The method involves the following stages.
1. Adaptive trend decomposition of the return series of the portfolio group.  Training the adaptive mechanism of the adjustable structure.  Creating discrete dependent and instrumental independent variables of the logit models for each of the analysed investment horizons.  Building logit models for each investment horizon which, according to the proportional expectations hypothesis, demonstrate the power of unsystematic external factors.
2. Identification of the family of efficient sets using the in-sample data:  Building the regression models of the returns on assets in the analysed group on the profitability of the portfolio group (second-level model) and calculating the residual variances for each of the analysed investment horizons.  Calculating the estimates of the parameters of the single index model with a two-level return generating mechanism.  Determining the optimal structure of the portfolio for each of the analysed investment horizons.  Identifying efficient sets for the analysed groups of investors.  Calculating the maximum modified Sharpe ratio for each group of investors.  Identifying the temporal structure of the efficient sets.
3. Out-of-sample portfolio analysis:  Calculating the actual mean return of the efficient sets for the analysed investment horizons.  Calculating the actual risks of the efficient sets for the analysed investment horizons.  Identifying the out-of-sample family of efficient sets and its temporal structure.

Empirical Results
The composition of the studied portfolio groups corresponds to the composition of sector stock portfolios used for the calculation of sector indices in section 2.1. The return of a portfolio group is determined as a value-weighted return of stocks included in the considered sector index. When calculating the return of a portfolio group, we also consider the free float ratio reflecting the quantity of shares available for public trading.
Let us analyse the specifics of adaptive decomposition using three baseline trends. The derivative time series of returns are formed by smoothing the time series of daily returns using windows 60, 30, and 3 respectively. The obtained time series are characterised by the growth in variation following an increase in the order of the baseline trend. It reflects the idea that longer investment horizons correspond to lower fluctuation rates. On one hand, the number of trends is enough to cover all the blocks of the model of a multitrend process with a multilevel structure of the adaptive mechanism. On the other hand, regarding the investment horizons for the considered groups of investors, we can interpret baseline trends as being long-, medium-, and short-termed (L, M, and S). Table 1 presents optimal values of the adjustable parameters of the adaptive mechanisms used in adaptive trend decomposition.  The smoothing parameter ρ in the model reflecting long-term tendencies is assumed to be 1. The medium-term trend is characterised by a longer reaction time of the adaptive mechanism ( ) and the batch processing of new observations. For the short-term trends model the reaction time is maximum, which is demonstrated by the value of γ being close to 1. Otherwise the adaptive mechanism will be excessively sensitive to short-term shocks, thus making the model not optimal.
For each baseline trend (13), the problem is solved and a portfolio with the maximum modified Sharpe ratio on an annual basis is determined. Then for the obtained portfolios, we calculate the actual value of the modified Sharpe ratio using the out-of-sample data. The number of observations used in the calculation varies depending on the baseline trend and corresponds to the size of the smoothing window used to obtain the derivative series, i.e. 60, 30, and 3 respectively. This represents the idea that the time of holding the portfolio is determined by the investment horizon.
Based on the results obtained for a nonturbulent period from 2015 to 2019, we can make the following conclusions. The effectiveness of portfolio investments grows with an increase in the investment horizon ( Figure 1  This is demonstrated by a higher mean Sharpe ratio and a smaller spread in values around the mean. The Sharpe ratio for short-term investors was 0.23, for medium-term investors it was 0.82, and for long-term investors it was 1.08. This tendency was observed both in-sample and out-of-sample. The Sharpe ratio for short-term investors was much lower (0.04), while for medium-and long-term investors it remained practically the same (0.86 and 1.07).
The Tukey's multiple comparison test demonstrated significant difference in the efficiency of portfolio strategies evaluated using the modified Sharpe ratio for the full sample (Table 2), for the in-sample data (Table 3) and for the out-of-sample data (Table 4).   Significant differences in the in-sample and out-of-sample results were observed only for the third baseline trend (p-value 0.007) corresponding to the short-term investment horizon ( Table 5).
The obtained results demonstrated the existence of a robust temporal structure of the efficient sets in the family identified using the adaptive decomposition of efficient sets into baseline trends.
Let us now consider the results of the identification of the temporal structure of efficient sets during the recession in 2020 caused by the COVID-19 pandemic. The temporal structure of the efficient sets changed in the turbulent period. In the analysed period, the efficiency of portfolio strategies decreased with the growth of the investment horizon ( Figure 2), both in-sample and out-of-sample.
The Sharpe ratio for short-term investors almost doubled, while for long-term investors it decreased by 10 times in-sample, and fell below zero out-of-sample.
A significant difference between in-sample and out-of-sample was observed only in the Sharpe ratios for long-term portfolio strategies (Tables 6-8). They were the worst for all the considered baseline trends. This is explained by the fact that derivative time series used to evaluate the parameters of the L baseline trend corresponding to long-term investors significantly smooth the initial series lowering their sensitivity to the formation and development of new tendencies. Higher efficiency of medium-and short-term investors allows us to conclude that adaptive mechanisms used to the evaluate M and S baseline trends are sensitive enough to the changes occurring in the market.
There was no significant difference between in-sample and out-of-sample for each baseline trend ( Table 9).
The temporal structure of the efficient sets in the turbulent period was also robust, although it was completely different from that observed in 2015-2019.
The observed inversion of the temporal structure of the family demonstrates that the adaptive trend decomposition used in portfolio analysis of a turbulent period helps to identify profitable portfolio strategies for short-term trends, while long-term trends result in significant loss.

Discussions
The suggested method implements the idea of decomposition of efficient sets into temporal components, which allows for a comparative analysis of portfolio sets according to the degree of their efficiency in different time periods. It also can be used for the dynamic generalisation of Sharpe's single index model. We believe that the results of the empirical study are to a large extent determined by the selected risk measure, since the variance estimate of a stochastic process obviously decreases with larger smoothing windows.
Studying the connection between the inhomogeneity of the market dynamics observed in different timeframes and the market's reaction time is a problem largely discussed in the academic community. When developing the model for forecasting stock market returns, Z. Dai and H. Zhu [31] elaborated the sum-of-the-parts method by using ensemble empirical mode decomposition. The prediction model proposed in [31] demonstrated high prediction ability, both from the statistical and economical points of view. Y. Yi et al. [32] also demonstrate that the prediction ability of the stock returns can be enhanced by decomposing the factors into short-and long-term components.
J. Baruník and T. Křehlík [33] used spectral decomposition of the returns variance and demonstrated that in high frequency periods the stock market processes the incoming information immediately, while shocks caused by one or several assets affect only the short-term dynamics. In our study, we observed the same dependence for the 2015-2019 period when long-term investments were the most effective. J. Baruník and T. Křehlík [33] also note that strong shocks during low-frequency periods can lead to significant loss within the considered timeframe. We observed this when analysing the data for 2020.
Y. Jiang et al. [34] analysed the connection between the sentiment of investors and stock returns in the USA for different investment horizons using bivariate empirical mode decomposition. The study demonstrated that the Granger causality between the investor sentiment index and stock returns is only observed for long-term investment horizons.
J. Nakayama and D. Yokouchi [35] used time series decomposition to construct index-tracking portfolios mimicking that of the Dow-Jones Industrial Average. The similarity of the portfolio and the index is assessed using the difference in the returns of the portfolio and the index returns on derivative time series corresponding to different investment horizons.
Unlike the principal components method and Karhunen-Loève decomposition, adaptive trend decomposition is not an orthogonal decomposition. Thanks to the feedback loops in the adaptive mechanisms, we can study and assess the parameters of the connected baseline trends and update them with new data. In our study, the method was used to decompose a stochastic process generating return on the stock market. As a result of decomposition, the initial process is presented as a sum of baseline trends that demonstrate the tendencies identified in set time periods.

Conclusions
Believing adaptation to be crucial for the effectiveness of the market, we incorporated the adaptive mechanism of an adjustable structure in the first level of the suggested mechanism of returns generation. We did this because it is a group of assets rather than each asset on its own that demonstrates adaptive behaviour. Using adaptive decomposition allowed us to perform a dynamic portfolio analysis of several time periods and decompose efficient sets into investment horizons. We suggested our own modification of the single index model to dynamically generalise the single-step problem of capital placement posed by modern portfolio theory. A family of efficient sets provides a better understanding of investment opportunities. Our calculations also demonstrated that a family of efficient sets is more likely to retain its properties during the prediction period. We believe that the adaptive approach can be used to enhance the existing models as well as to augment and summarise the theoretical results.