Open access peer-reviewed chapter - ONLINE FIRST

Portfolio Optimization: A Comparative Study

Written By

Jaydip Sen and Subhasis Dasgupta

Submitted: 12 March 2023 Reviewed: 30 June 2023 Published: 16 November 2023

DOI: 10.5772/intechopen.112407

Deep Learning - Recent Findings and Research IntechOpen
Deep Learning - Recent Findings and Research Edited by Manuel Domínguez-Morales

From the Edited Volume

Deep Learning - Recent Findings and Research [Working Title]

Ph.D. Manuel Jesus Domínguez-Morales, Dr. Javier Civit-Masot, Mr. Luis Muñoz-Saavedra and Dr. Robertas Damaševičius

Chapter metrics overview

39 Chapter Downloads

View Full Metrics

Abstract

Portfolio optimization has been an area that has attracted considerable attention from the financial research community. Designing a profitable portfolio is a challenging task involving precise forecasting of future stock returns and risks. This chapter presents a comparative study of three portfolio design approaches, the mean-variance portfolio (MVP), hierarchical risk parity (HRP)-based portfolio, and autoencoder-based portfolio. These three approaches to portfolio design are applied to the historical prices of stocks chosen from ten thematic sectors listed on the National Stock Exchange (NSE) of India. The portfolios are designed using the stock price data from January 1, 2018, to December 31, 2021, and their performances are tested on the out-of-sample data from January 1, 2022, to December 31, 2022. Extensive results are analyzed on the performance of the portfolios. It is observed that the performance of the MVP portfolio is the best on the out-of-sample data for the risk-adjusted returns. However, the autoencoder portfolios outperformed their counterparts on annual returns.

Keywords

  • portfolio optimization
  • mean-variance portfolio
  • hierarchical risk parity portfolio
  • autoencoder portfolio
  • unsupervised learning
  • deep learning
  • return
  • risk
  • volatility
  • sharpe ratio

1. Introduction

Portfolio Optimization is the task of identifying a set of capital assets and their respective weights of allocation, which optimizes the risk-return pairs. Optimizing a portfolio is a computationally hard problem. The problem gets more complicated if one needs to optimize future return and risk values, as predicting future stock prices is equally challenging. Markowitz proposed the mean-variance optimization approach which is based on the mean and covariance matrix of returns [1]. However, the mean-variance portfolio (MVP) design poses several challenges including the difficulty in estimating future expected returns of the stocks constituting the portfolio.

The hierarchical risk parity (HRP) algorithm proposed by de Prado attempts to address the challenges of the quadratic optimization problem which are relevant to the MVP portfolio design [2]. The HRP approach to portfolio design involves clustering the stocks using an agglomerative clustering method. The weights of the stocks in a cluster are assigned in inverse proportion to the variance of the cluster. The HRP algorithm is built on the concepts of graph theory and machine learning, and unlike the MVP approach to portfolio optimization, it does not require the invertibility of the covariance matrix of the stock returns [2].

Autoencoders are symmetric networks used for unsupervised learning. The output layer of an autoencoder is of the same size as the input layer because its purpose is to reconstruct its own inputs rather than predict a dependent target value. The goal of these networks is to act as a compression filter via an encoding layer that fits the input vector into a smaller latent representation. A decoding layer reconstructs the input while minimizing the error in reconstruction. Autoencoders can be trained on the historical prices of stocks forming a portfolio, in which the salient features of the stocks are represented in a compact manner at the coding layer, while the final output layer represents the reconstructed features of the stocks.

This work presented in this chapter discusses an algorithmic approach to building optimized portfolios by selecting stocks from ten thematic sectors of the National Stock Exchange (NSE) of India. Based on the report of the NSE on December 31, 2021, ten stocks have been identified which have the highest free-float market capitalization as per their listing in the National Stock Exchange (NSE) [3]. The historical prices of these stocks are scraped from the web using their ticker names. MVP, HRP, and autoencoder-based portfolios are designed and trained using the historical prices of the stocks from January 1, 2018, to December 31, 2021. The testing of the portfolios is done on the stock price data from January 1, 2022, to December 31, 2022. Extensive analysis of the performance of the portfolios is made based on their annual returns, annual volatilities, and Sharpe ratios.

The main contribution of the current work is threefold. First, it presents three different methods of optimizing portfolios, MVP, HRP, and autoencoder-based design. These portfolio design approaches are applied to ten thematic sectors of stocks of the NSE. The results can be used as a guide to investors in the stock market for making profitable investments. Second, a method is presented for evaluating the performance of the portfolios based on their annual returns and risks and Sharpe ratios. Since the evaluation is done both on the training and the test data, the work has identified the most efficient portfolio for all ten sectors on both datasets. Hence, a robust framework for evaluating different portfolios is demonstrated. Third, the returns of the portfolios on the thematic sectors on the test data highlight the current profitability and the volatility of these sectors. This information can be useful for investors.

The chapter is organized as follows. Section 2 briefly discusses some related works in the literature. Section 3 provides a brief theoretical foundation of MVP, HRP, and autoencoder-based portfolio design. Section 4 discusses the data used and the methodology followed in the work. Section 5 presents extensive results of the performance of the portfolios and their analysis. A comparative study of the performance of the portfolios is also made. Section 6 concludes the chapter and identifies some future directions of work.

Advertisement

2. Related work

Several approaches have been proposed by researchers for accurate prediction of stock prices and robust portfolio optimization. Time series decomposition and econometric approaches like ARIMA, Granger causality, and VAR are extensively used for stock price prediction and portfolio optimization [4, 5, 6, 7, 8, 9, 10].

The use of machine learning, deep learning, and reinforcement learning models for future stock price prediction has been the most popular approach of late [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]. Hybrid models are also proposed that utilize the algorithms and architectures of machine learning and deep learning and exploit the sentiments in the textual sources on the social web [24, 25, 26, 27, 28, 29].

The use of metaheuristics algorithms in solving multi-objective optimization problems for portfolio management has been proposed in several works [30, 31, 32]. The use of fuzzy logic, genetic algorithms (GAs), and algorithms of swarm intelligence (SI), e.g., particle swarm optimization (PSO), are also quite common in portfolio optimization [33, 34, 35].

The performances of the mean-variance, Eigen, and HRP portfolios have been compared on different stocks from various sectors of the Indian stock market [36, 37, 38, 39, 40, 41, 42]. A pair portfolio design approach using cointegration for the Indian stock market has also been proposed in the literature [43]. The use of generalized autoregressive conditional heteroscedasticity (GARCH) in estimating the future volatility of stocks and portfolios has also been illustrated [44, 45].

Finally, deep reinforcement learning approaches have been extensively used in portfolio optimization [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58].

Advertisement

3. Theoretical background

In this section, some background theories of portfolio design are discussed. The design approaches to MVP, HRP, and autoencoder-based portfolios and their optimization methods are briefly presented in the following.

3.1 Mean-variance portfolio optimization

The mean-variance portfolio (MVP) design involves the following steps: (a) Computation of returns and volatilities of the stocks, (b) Determination of the covariances and correlations among all pairs of stocks in the portfolio, (c) Derivation of the expected returns and risks of several candidate portfolios, (d) Identifying the portfolio with the maximum risk-adjusted return among all candidate portfolios. In the following, we briefly describe these steps. For further details, interested readers may refer to [36].

3.1.1 Computation of stock returns and volatilities

Based on the historical values of the stock prices in the portfolio training dataset, the daily return or the log return values of each stock of that sector are computed. The daily return values are the percentage changes in the successive daily stock prices, while the log return values are the logarithms of the percentage changes in the daily stock prices. Based on the daily return values, the daily volatility, and the annual volatility of every stock in a portfolio are computed. The daily volatility is the standard deviation of the daily return values. The daily volatility, on multiplication by a factor of the square root of 250, yields the value of the annual volatility. Here, there is a standard assumption of 250 working days in a year for a stock market. The annual volatility of a stock reflects the risk associated with stock from an investor’s point of view. For every stock, the daily return values are also aggregated into their annual return values.

3.1.2 Determination of covariances and correlations of stocks

After the volatility and return of the stocks are computed based on the historical prices of the stocks, the covariance and the correlation matrices are derived for a portfolio. These matrices depict the strength of association between all pairs of stocks in a portfolio. A good portfolio aims to minimize the risk while maximizing the return. Risk minimization of a portfolio requires identifying stocks that have low correlation among themselves so that a higher diversity can be achieved.

3.1.3 Derivation of portfolio returns and risks

The expected return E(R) of a portfolio containing n stocks denoted as S1, S2,..….., Sn, and their corresponding associated weights w1, w2,……,wn is given by (1):

ER=w1ERS1+w2ERS2++wnERSnE1

The variance of a portfolio is computed using the variances of the individual stocks constituting the portfolio, and the covariances between every pair of stocks in the portfolio. The variance of a portfolio, Var(P) is computed using (2):

VarP=i=1nwiσi2+2i,jwiwjCovijE2

In (2), wi and σi represent the weight associated with stock i and the standard deviation of the historical prices of stock i. The covariance between the historical prices of stock i and stock j is denoted as Cov(i, j).

Once the return and the volatility (i.e., risk) for a portfolio are computed using the stock price data of all its constituent stocks, the portfolio is optimized so that its risk-adjusted return is the maximum. This optimization is carried out in the next step.

3.1.4 Portfolio with maximum risk-adjusted return

To understand how the portfolio with the maximum-risk-adjusted return (i.e., the optimum portfolio) is identified, two concepts are important to know, (i) Sharpe ratio and (ii) efficient frontier of portfolios. In the following, these two terms are explained first.

The Sharpe ratio (SR) of a portfolio is given by (3)

SR=RcRfσcE3

In (3), Rc, Rf, and σc denote the return of the current portfolio, the risk-free portfolio, and the standard deviation of the current portfolio, respectively. Here, the risk-free portfolio is a portfolio with a volatility value of 1%. The optimum portfolio is the one that maximizes the Sharpe Ratio for a set of stocks.

The question that remains to be addressed is how to identify the portfolio with the maximum Sharpe ratio. To answer this question, the term efficient frontier needs to be introduced.

For a given portfolio of stocks, the efficient frontier is the contour with the returns plotted along the y-axis and the volatility (i.e., risk) on the x-axis. The points of an efficient frontier indicate the portfolios with the maximum return for a given value of volatility, or those with the minimum value of volatility for a given value of the return. Since, for an efficient frontier, the volatility is plotted along the x-axis, the minimum risk portfolio is identified by the leftmost point on the efficient frontier. Since the optimum portfolio is the one that maximizes the Sharpe ratio, this portfolio is identified by the point on the efficient frontier, that yields that maximum value of the return/risk ratio. Figure 1 depicts the efficient frontier for many candidate portfolios, wherein the portfolio with the minimum risk and the one with the maximum Sharpe ratio are identified.

Figure 1.

The efficient frontier illustrated with 10,000 candidate portfolios. The portfolio with the minimum risk is represented by the red star, while the green star identifies the portfolio with the maximum Sharpe ratio (i.e., it is the optimum portfolio).

3.2 Hierarchical risk parity-based portfolio optimization

The execution of the hierarchical risk parity (HRP) approach to portfolio optimization involves three steps: (a) Formation of clusters, (b) Quasi-diagonalization, and (c) Recursive Bisection. These steps are briefly described below. For more details, the readers may refer to [2, 59].

3.2.1 Formation of clusters

The tree clustering used in the HRP algorithm is an agglomerative clustering algorithm. A hierarchy class is first created in Python to design the agglomerative clustering algorithm. The hierarchy class contains a dendrogram method that receives the value returned by a method called linkage defined in the same class. The linkage method receives the dataset after pre-processing and transformation and computes the minimum distances between stocks based on their return values. There are several options for computing distance. However, the ward distance is a good choice since it minimizes the variances in the distance between two clusters in the presence of high volatility in the stock return values. In this work, the ward distance has been used as a method to compute the distance between two clusters. The linkage method performs the clustering and returns a list of the clusters formed. The computation of linkages is followed by the visualization of the clusters through a dendrogram. In the dendrogram, the leaves represent the individual stocks, while the root depicts the cluster containing all the stocks. The distance between each cluster formed is represented along the y-axis, longer arms indicate less correlated clusters and vice versa. The details of the clustering process are described in [2]. Figure 2 exhibits a typical dendrogram of the agglomerative clustering used in HRP portfolio optimization.

Figure 2.

The dendrogram produced by the agglomerative clustering done by the hierarchical risk parity-based approach to portfolio optimization. The x-axis shows the ten stocks that participated in the clustering process, while the y-axis depicts the ward distance used as the metric in computing the inter-cluster distance.

3.2.2 Quasi-diagonalization

In this step, the rows and the columns of the covariance matrix of the return values of the stocks are reorganized in such a way that the largest values lie along the diagonal. Without requiring a change in the basis of the covariance matrix, quasi-diagonalization yields a very important property of the matrix – the assets (i.e., stocks) with similar return values are placed closer to each other, while disparate assets are put at a far distance. The working principles of the algorithm are as follows. Since each row of the linkage matrix merges two branches into one, the clusters (CN-1, 1) and (CN-2, 2) are replaced with their constituents recursively, until there are no more clusters to merge. This recursive merging of clusters preserves the original order of the clusters [59]. The output of the algorithm is a sorted list of the original stocks (as they were before the clustering).

3.2.3 Recursive bijection

The quasi-diagonalization step transforms the covariance matrix into a quasi-diagonal form. It is proven mathematically that the allocation of weights to the assets in an inverse ratio to their variance is an optimal allocation for a quasi-diagonal matrix [59]. This allocation may be done in two different ways. In the bottom-up approach, the variance of a contiguous subset of stocks is computed as the variance of an inverse-variance allocation of the composite cluster. In the alternative top-down approach, the allocation among two adjacent subsets of stocks is done in inverse proportion to their aggregated variances. In the current implementation, the top-down approach is followed. A Python function computeIVP computes the inverse-variance portfolio based on the computed variances of two clusters as its given input. The variance of a cluster is computed using another Python function called clusterVar. The output of the clusterVar function is used as the input to another Python function called recBisect which computes the final weights allocated to the individual stocks based on the recursive bisection algorithm.

3.3 Autoencoder-based portfolio optimization

Autoencoders are symmetric networks used for unsupervised learning. The output layer is the same size as the input layer because it aims to reconstruct its own inputs rather than predict a dependent target value. The goal of these networks is to act as a compression filter via an encoding layer, Φ that fits the input vector X into a smaller latent representation (the code) c, and then a decoding layer, φ tries to reconstruct it back to X’ such that (4) holds good:

ϕ:Xc,φ:cXE4

Any reconstruction error is evaluated based on the computation of a loss function. Minimization of the loss function will force the network to find the most efficient compact representation of the training data with minimum information loss. For numerical input, the loss function (LMSE) is the mean squared error computed in (5):

LMSE=XX2E5

As depicted in Figure 3, central layer (the code) of the network is the compressed representation of the data. We are effectively translating an n-dimensional array into a smaller m-dimensional array, where m ≤ n. Since autoencoders can learn new latent representations, combining the previously learned ones so that each hidden level can be seen as some compressed hierarchical representation of the original data, the coding layer or any other intermediate hidden layer in the encoder part of the network can be taken as valid features describing the input vector.

Figure 3.

The schematic representation of an autoencoder with its input layer, encoder network, coding layer, decoding network, and output layer indicated.

Autoencoders can be trained on the historical prices of stocks forming a portfolio, in which the salient features of the stocks can be represented in a most compact manner at the coding layer, while the final output layer represents the reconstructed features of the stocks. Since for portfolio optimization, we need weights to be allocated to each stock based on the importance of the features, the extracted normalized feature values at the output layer are taken as the weights for the corresponding stocks in the portfolio [60].

Advertisement

4. Data and methodology

4.1 Choosing the sectors

The stocks under ten thematic sectors of NSE, India are chosen for the portfolio design. These sectors are: (i) NIFTY commodities, (ii) NIFTY energy, (iii) NIFTY manufacturing, (iv) NIFTY services, (v) NIFTY MNC, (vi) NIFTY transportation & logistics, (vii) NIFTY infrastructure, (viii) NIFTY housing, (ix) NIFTY consumption, and (x) NIFTY 100 ESG (environmental, social and governance). The NIFTY thematic sector indices reflect the performance of stocks that belong to specific investment themes such as manufacturing, services, social, infrastructure, etc. For each sector, ten stocks are identified which have the maximum free-float market capitalization based on the NSE’s report of February 29, 2022 [3].

4.2 Acquiring the data

The DataReader function defined in the pandas library of Python is used for scraping the historical prices of the stocks of the ten thematic sectors from the Yahoo Finance website. The stock price records for the period January 1, 2018, to December 31, 2021, are used to build the portfolios for the sectors, while the portfolios are tested on the stock records for the period January 1, 2022, to December 31, 2022. Since the current work is based on a univariate analysis, only the close prices of the stocks are used for computing the portfolio return and risk.

4.3 Designing the MVP portfolios

For designing the MVP portfolio for each sector, the daily returns of the stocks are computed using the pct_change function in Python. The annual return of each stock is then computed from the daily return values. The daily volatility of the stocks is computed using the std function in Python. The annual volatility is derived by multiplying the daily volatility by a factor of the square root of 250 assuming that there are 250 working days in a calendar year. Python functions cov and corr are used for computing the covariance and correlation matrices, respectively for each portfolio. Based on the return and the volatility of individual stocks, the annual return and risk for the portfolios are computed. Finally, For plotting the contour of the efficient frontier, the weights are assigned randomly to the ten stocks in a portfolio in a loop and iterate the loop 10,000 times in a Python program. The iteration produces 10,000 points, each point representing a portfolio. The optimum portfolio is identified as the portfolio yielding the highest value of the Sharpe ratio on the efficient frontier.

4.4 Designing the HRP portfolios

For the ten sectors, the HRP portfolios are designed following the three steps, agglomerative clustering, quasi-diagonalization, and recursive bijection. The procedural and implementation details of HRP portfolios have been discussed in Section 3.2.

4.5 Designing the autoencoder portfolios

The fundamentals of autoencoder portfolios have been presented in Section 3.3. Here, we discuss some implementation details of the autoencoder portfolios. The model architecture of the autoencoder portfolio as produced by the plot_model function in the keras library is exhibited in Figure 4. The model has one coding layer that extracts 5 features from the 10 features supplied in the input layer. The data shape (None, 10) at the input layer represents the close prices of the ten stocks of the portfolio. The data shape (None, 10) at the output of the final layer corresponds to the weights assigned by the portfolio to the ten stocks. While the ReLU activation has been used at the coding layer, at the output layer, linear activation is used. Adam optimizer is used in model training to ensure faster convergence. The model is trained over 500 epochs using a batch size of 10. The number of layers in the autoencoder model is determined using the grid search method.

Figure 4.

Architecture of the autoencoder model for portfolio optimization.

4.6 Evaluating the portfolio performance

Finally, the performances of the three portfolios for each of the ten sectors are evaluated on the training and test data. The metrics used for evaluation are the annual return, annual volatility, and the Sharpe ratio. For each sector, the portfolio yielding the best results on the training and test data are identified. From the point of view of the investors, the portfolio performing the best on the test data is the one that should be followed.

Advertisement

5. Performance results

This section presents the performance results of the portfolios. The portfolios are implemented using the Python language and its libraries. All experiments are carried out on a system with an Intel i7 CPU with a clock frequency in the range of 2.60–2.56 GHz and 16GB RAM. There are 1236 records in total, out of which 988 records are in the training dataset. The remaining 248 records are used as the test samples.

5.1 NIFTY commodities sector

The ten stocks from the auto sector with the maximum free-float market capitalization and their respective contributions to the computation of the NIFTY commodities sector index according to the report published by the NSE on Dec 31, 2021, are as follows: Reliance Industries (RELIANCE): 10.13, UltraTech Cement (ULTRACEMCO): 7.52, Tata Steel (TATASTEEL): 7.52, NTPC (NTPC): 7.26, JSW Steel (JSWSTEEL): 5.64, Oil & Natural Gas Corporation (ONGC): 5.32, Grasim Industries (GRASIM): 5.31, Hindalco Industries (HINDALCO): 5.23, Coal India (COALINDIA): 4.05, and UPL (UPL): 3.32 [3]. The figures mentioned along with the names of the stocks represent the respective weights (in percent) of the stocks used in computing the sectoral index of the commodities sector. The ticker names of the stocks are mentioned within parentheses in upper case.

The weights assigned by the MVP, HRP, and the autoencoder (ENC) portfolio based on the training data (January 1, 2018–December 31, 2021) are presented in Table 1. Figure 5 depicts the portfolio weights allocated by the portfolios in the form of pie charts. NTPC received the maximum weights from the MVP and the HRP portfolios. The ENC portfolio assigned the maximum weight to JSWSTEEL.

StockPortfolio weights
MVPHRPENC
RELIANCE0.21440.14640.0807
ULTRACEMCO0.21400.15240.1079
TATASTEEL0.00640.04280.1038
NTPC0.32860.18030.1037
JSWSTEEL0.00710.04590.1381
ONGC0.00440.06140.0780
GRASIM0.02340.11270.0997
HINDALCO0.00250.06670.1194
COALINDIA0.14080.08890.0590
UPL0.05840.10250.1098

Table 1.

NIFTY commodities sector portfolio weights allocation.

Figure 5.

Weight allocation to the stocks of the NIFTY commodity sector by the MVP, HRP and autoencoder (ENC) portfolios.

Figures 6 and 7 show the cumulative daily returns of the portfolios over the training and the test periods, respectively. These plots depict the cumulative daily returns of the portfolios. The portfolio yielding a higher cumulative return is more profitable for the investors. However, the returns need to be adjusted by their associated risks. Hence, the portfolio risks and the values of their Sharpe ratios are computed so that the performances of the portfolios can be compared based on their respective Sharpe ratios.

Figure 6.

Cumulative daily returns yielded by the NIFTY commodities sector portfolios for the training period from January 1, 2018, to December 31, 2021.

Figure 7.

Cumulative daily returns yielded by the NIFTY commodities sector portfolios for the test period from January 1, 2022, to December 31, 2022.

In Table 2, the summary of the performances of the two portfolios of the au-to sector is presented for the training and the test periods. For both training and test periods, the annual returns, annual volatilities (i.e., standard deviations), and the max Sharpe ratio are tabulated in Table 2. The RL portfolio has yielded the highest Sharpe ratios for both training and test data for the auto sector.

PortfolioTraining performanceTest performance
Annual returnAnnual volatilitySharpe ratioAnnual returnAnnual volatilitySharpe ratio
MVP10.8921.870.497817.5119.490.8982
HRP13.8223.490.588313.0120.480.6354
ENC16.5926.010.637511.7423.320.5034

Table 2.

Portfolio performance on the NIFTY commodities sector.

5.2 NIFTY energy sector

The ten stocks from the NIFTY Energy sector with the maximum free-float market capitalization and their respective contributions to the computation of the NIFTY commodities sector index according to the report published by the NSE on Dec 31, 2021, are as follows: Reliance Industries (RELIANCE): 35.92, NTPC (NTPC): 13.92, Power Grid Corporation of India (POWERGRID): 13.05, Oil & Natural Gas Corporation (ONGC): 10.19, Tata Power Company (TATAPOWER): 5.89, Bharat Petroleum Corporation (BPCL): 5.32, Indian Oil Corporation (IOC): 4.98, GAIL India (GAIL): 4.75, Adani Transmission (ADANITRANS): 3.08, and Adani Green Energy (ADANIGREEN): 2.90 [3]. The figures mentioned along with the names of the stocks represent the respective weights (in percent) of the stocks used in computing the sectoral index of the commodities sector. The ticker names of the stocks are mentioned within parentheses in upper case.

The weights assigned by the MVP, HRP, and the autoencoder (ENC) portfolio based on the training data (January 1, 2018–December 31, 2021) are presented in Table 3. Figure 8 depicts the portfolio weights allocated by the portfolios in the form of pie charts. POWERGRID received the maximum weights from all three portfolios, MVP, HRP, and ENC.

StockPortfolio Weights
MVPHRPENC
RELIANCE0.20900.13410.1221
NTPC0.20690.16830.0903
POWERGRID0.31700.21840.1324
ONGC0.00650.05080.0863
TATAPOWER0.01700.08270.0902
BPCL0.01060.04620.1159
IOC0.06430.11760.0983
GAIL0.05710.08900.0624
ADANITRANS0.04710.04830.0624
ADANIGREEN0.04710.04830.0843

Table 3.

NIFTY energy sector portfolio weights allocation.

Figure 8.

Weight allocation to the stocks of the NIFTY energy sector by the MVP, HRP and autoencoder (ENC) portfolios.

Figures 9 and 10 show the cumulative returns of the portfolios over the training and the test periods, respectively. In Table 4, the summary of the performances of the three portfolios of the NIFTY energy sector is presented for the training and the test periods, in which the annual returns, annual volatilities (i.e., standard deviations), and the max Sharpe ratio are tabulated.

Figure 9.

Cumulative daily returns yielded by the NIFTY energy sector portfolios for the training period from January 1, 2018, to December 31, 2021.

Figure 10.

Cumulative daily returns yielded by the NIFTY energy sector portfolios for the test period from January 1, 2022, to December 31, 2022.

PortfolioTraining performanceTest performance
Annual returnAnnual volatilitySharpe ratioAnnual returnAnnual volatilitySharpe r
MVP19.83%20.980.945117.83%19.620.9086
HRP15.81%21.920.721214.82%19.540.7583
ENC20.15%23.310.864414.17%20.150.7033

Table 4.

Portfolio performance in the NIFTY energy sector.

5.3 NIFTY manufacturing sector

The ten stocks from the NIFTY manufacturing sector with the maximum free-float market capitalization and their respective contributions to the computation of the overall sectoral index according to the report published by the NSE on Dec 31, 2021, are as follows: Sun Pharmaceuticals Industries (SUNPHARMA): 4.96, Reliance Industries (RELIANCE): 4.73, Mahindra & Mahindra (M&M): 4.59, Tata Steel (TATASTEEL): 4.55, Maruti Suzuki (MARUTI): 4.33, JSW Steel (JSWSTEEL): 3.41, Hindalco Industries (HINDALCO): 3.16, Tata Motors (TATAMOTORS): 2.85, Dr. Reddy’s Laboratories (DRREDDY): 2.85, and Cipla (CIPLA): 2.66 [3]. The figures mentioned along with the names of the stocks represent the respective weights (in percent) of the stocks used in computing the sectoral index of the manufacturing sector. The ticker names of the stocks are mentioned within parentheses in upper case.

The weights assigned by the MVP, HRP, and autoencoder (ENC) portfolio based on the training data (January 1, 2018 – December 31, 2021) are presented in Table 5. Figure 11 depicts the portfolio weights allocated by the portfolios in the form of pie charts. DRREDDY, CIPLA, and SUNPHARMA received the highest allocation by the MVP, HRP, and ENC portfolios.

StockPortfolio weights
MVPHRPENC
SUNPHARMA0.06000.12570.1422
RELIANCE0.17900.10770.0885
M&M0.07380.07410.1007
TATASTEEL0.01820.06900.0981
MARUTI0.14370.08380.0651
JSWSTEEL0.01300.07420.1299
HINDALCO0.00710.06270.1044
TATAMOTORS0.00690.05250.1167
DRREDDY0.26290.16610.0813
CIPLA0.23540.18400.0732

Table 5.

NIFTY manufacturing sector portfolio weights allocation.

Figure 11.

Weight allocation to the stocks of the NIFTY manufacturing sector by the MVP, HRP, and autoencoder (ENC) portfolios.

Figures 12 and 13 show the cumulative returns of the portfolios over the training and the test periods, respectively. In Table 6, the summary of the performances of the three portfolios of the NIFTY manufacturing sector is presented for the training and the test periods, in which the annual returns, annual volatilities (i.e., standard deviations), and the max Sharpe ratio are tabulated.

Figure 12.

Cumulative daily returns yielded by the NIFT manufacturing sector portfolios for the training period from January 1, 2018, to December 31, 2021.

Figure 13.

Cumulative daily returns yielded by the NIFTY manufacturing sector portfolios for the test period from January 1, 2022, to December 31, 2022.

PortfolioTraining performanceTest performance
Annual returnAnnual volatilitySharpe ratioAnnual returnAnnual volatilitySharpe ratio
MVP17.40%20.760.83829.93%16.270.6102
HRP18.40%22.280.825910.99%17.610.6242
ENC19.12%25.580.747411.54%20.790.5549

Table 6.

Portfolio performance in the NIFTY manufacturing sector.

5.4 NIFTY services sector

The ten stocks from the NIFTY services sector with the maximum free-float market capitalization and their respective contributions to the computation of the overall sectoral index according to the report published by the NSE on Dec 31, 2021, are as follows: HDFC Bank (HDFCBANK): 15.11, ICICI Bank (ICICIBANK): 12.78, Infosys (INFY): 4.59, Housing Development Finance Corporation (HDFC): 10.09, Tata Consultancy Services (TCS): 7.28, Kotak Mahindra Bank (KOTAKBANK): 5.37, Axis Bank (AXISBANK): 4.90, State Bank of India (SBIN): 4.30, Bharti Airtel (BHARTIARTL): 3.98, and Bajaj Finance (BAJFINANCE): 3.49 [3]. The figures mentioned along with the names of the stocks represent the respective weights (in percent) of the stocks used in computing the sectoral index of the NIFTY services sector.

The weights assigned by the MVP, HRP, and the autoencoder (ENC) portfolio based on the training data (January 1, 2018 – December 31, 2021) are presented in Table 7. Figure 14 depicts the portfolio weights allocated by the portfolios in the form of pie charts. TCS received the maximum weights from the MVP and HRP portfolios. The ENC portfolio assigned the highest weight to KOTAKBANK.

StockPortfolio weights
MVPHRPENC
HDFCBANK0.25930.08730.0788
ICICIBANK0.00200.07270.0924
INFY0.14450.16220.1194
HDFC0.00300.06050.1194
TCS0.32530.19330.0963
KOTAKBANK0.08320.10960.1598
AXISBANK0.00130.06270.0901
SBIN0.03490.07250.0901
BHARTIARTL0.14530.12250.0499
BAJFINANCE0.00110.05660.0974

Table 7.

NIFTY services sector portfolio weights allocation.

Figure 14.

Weight allocation to the stocks of the NIFTY services sector by the MVP, HRP and autoencoder (ENC) portfolios.

Figures 15 and 16 show the cumulative returns of the portfolios over the training and the test periods, respectively. In Table 8, the summary of the performances of the three portfolios of the NIFTY services sector is presented for the training and the test periods, in which the annual returns, annual volatilities (i.e., standard deviations), and the max Sharpe ratio are tabulated.

Figure 15.

Cumulative daily returns yielded by the NIFTY services sector portfolios for the training period from January 1, 2018, to December 31, 2021.

Figure 16.

Cumulative daily returns yielded by the NIFTY services sector portfolios for the test period from January 1, 2022, to December 31, 2022.

PortfolioTraining pTest performance
Annual returnAnnual volatilitySharpe ratioAnnual returnAnnual volatilitySharpe ratio
MVP23.89%19.811.2059−0.45%18.68−0.0240
HRP25.03%21.421.16843.40%18.530.1834
ENC23.65%24.310.97277.92%19.570.4047

Table 8.

Portfolio performance in the NIFTY services sector.

5.5 NIFTY MNC sector

The ten stocks from the NIFTY MNC sector with the maximum free-float market capitalization and their respective contributions to the computation of the overall sectoral index according to the report published by the NSE on Dec 31, 2021, are as follows: Maruti Suzuki (MARUTI): 10.82, Hindustan Unilever (HINDUNILVR): 9.88, Nestle India (NESTLEIND): 9.83, Britannia Industries (BRITANNIA): 9.12, Vedanta (VEDL): 5.18, Siemens (SIEMNS): 5.00, Ambuja Cements (AMBUJACEM): 4.35, United Spirits (MCDOWELL-N): 3.82, Cummins India (CUMMINSIND): 3.69, and Ashok Leyland (ASHOKLEY): 3.62 [3]. The figures mentioned along with the names of the stocks represent the respective weights (in percent) of the stocks used in computing the sectoral index of the NIFTY MNC sector.

The weights assigned by the MVP, HRP, and the autoencoder (ENC) portfolio based on the training data (January 1, 2018 – December 31, 2021) are presented in Table 9. Figure 17 depicts the portfolio weights allocated by the portfolios in the form of pie charts. HINDUNILVR, NESTLEIND, and VEDL received the maximum weights from the MVP, HRP, and ENC portfolios, respectively.

StockPortfolio weights
MVPHRPENC
MARUTI0.01920.08360.0726
HINDUNILVR0.25350.13950.0680
NESTLEIND0.20540.18540.0715
BRITANNIA0.11740.12190.0723
VEDL0.01220.06050.1879
SIEMENS0.08740.06780.1375
AMBUJACEM0.06880.06290.0855
MCDOWELL-N0.07690.11580.0879
CUMMINSIND0.15410.11140.1063
ASHOKLEY0.00500.05120.1105

Table 9.

NIFTY MNC sector portfolio weights allocation.

Figure 17.

Weight allocation to the stocks of the NIFTY MNC sector by the MVP, HRP and autoencoder (ENC) portfolios.

Figures 18 and 19 show the cumulative returns of the portfolios over the training and the test periods, respectively. In Table 10, the summary of the performances of the three portfolios of the NIFTY MNC sector is presented for the training and the test periods, in which the annual returns, annual volatilities (i.e., standard deviations), and the max Sharpe ratio are tabulated.

Figure 18.

Cumulative daily returns yielded by the NIFTY MNC sector portfolios for the training period from January 1, 2018, to December 31, 2021.

Figure 19.

Cumulative daily returns yielded by the NIFTY MNC sector portfolios for the test period from January 1, 2022, to December 31, 2022.

PortfolioTraining performanceTest performance
Annual returnAnnual volatilitySharpe ratioAnnual returnAnnual volatilitySharpe ratio
MVP16.42%18.590.883317.18%17.240.9963
HRP14.73%19.490.755715.18%17.330.8754
ENC13.55%22.880.592215.70%20.040.7835

Table 10.

Portfolio performance on the NIFTY MNC sector.

5.6 NIFTY transportation and logistics sector

The ten stocks from the NIFTY transportation and logistics sector with the maximum free-float market capitalization and their respective contributions to the computation of the overall sectoral index according to the report published by the NSE on Dec 31, 2021, are as follows: Mahindra & Mahindra (M&M): 14.73, Maruti Suzuki (MARUTI): 13.89, Tata Motors (TATAMOTORS): 9.14, Adani Ports and Special Economic Zone (ADANI PORTS): 5.43, Eicher Motors (EICHERMOT): 5.25, Bajaj Auto (BAJAJ-AUTO): 5.02, Hero MotoCorp (HEROMOTOCO): 3.81, Tube Investments of India (TIINDIA): 3.50, TVS Motor Company (TVSMOTOR): 3.05, and Ashok Leyland (ASHOKLEY): 2.54 [3]. The figures mentioned along with the names of the stocks represent the respective weights (in percent) of the stocks used in computing the sectoral index of the NIFTY transportation and logistics sector.

The weights assigned by the MVP, HRP, and the autoencoder (ENC) portfolio based on the training data (January 1, 2018–December 31, 2021) are presented in Table 11. Figure 20 depicts the portfolio weights allocated by the portfolios in the form of pie charts. BAJAJ-AUTO received the maximum weights from all three portfolios, MVP, HRP, and ENC.

StockPortfolio weights
MVPHRPENC
M&M0.07420.12070.0988
MARUTI0.04250.11390.1028
TATAMOTORS0.00250.03150.1081
ADANIPORTS0.13980.13400.1020
EICHERMOT0.08390.08000.1071
BAJAJ-AUTO0.33440.16000.1235
HEROMOTOCO0.08470.12370.1136
TIINDIA0.20340.12150.0377
TVSMOTOR0.03050.07770.1060
ASHOKLEY0.00410.03700.1003

Table 11.

NIFTY transport & logistics sector portfolio weights allocation.

Figure 20.

Weight allocation to the stocks of the NIFTY transportation and logistics sector by the MVP, HRP, and autoencoder (ENC) portfolios.

Figures 21 and 22 show the cumulative returns of the portfolios over the training and the test periods, respectively. In Table 12, the summary of the performances of the three portfolios of the NIFTY transportation and logistics sector is presented for the training and the test periods, in which the annual returns, annual volatilities (i.e., standard deviations), and the max Sharpe ratio are tabulated.

Figure 21.

Cumulative daily returns yielded by the NIFTY transportation & logistics sector portfolios for the training period from January 1, 2018, to December 31, 2021.

Figure 22.

Cumulative daily returns yielded by the NIFTY transportation & logistics sector portfolios for the test period from January 1, 2022, to December 31, 2022.

PortfolioTraining performanceTest performance
Annual returnAnnual volatilitySharpe ratioAnnual returnAnnual volatilitySharpe ratio
MVP16.26%22.750.715025.49%21.101.2081
HRP12.02%23.790.505325.73%21.511.1962
ENC8.55%26.030.328621.30%22.620.9413

Table 12.

Portfolio performance on the NIFTY transport & logistics sector.

5.7 NIFTY infrastructure sector

The ten stocks from the NIFTY infrastructure sector with the maximum free-float market capitalization and their respective contributions to the computation of the overall sectoral index according to the report published by the NSE on Dec 31, 2021, are as follows: Reliance Industries (RELIANCE): 19.25, Larsen & Toubro (LT): 15.47, Bharti Airtel (BHARTIARTL): 11.28, UltraTech Cement (ULTRACEMCO): 11.28, NTPC (NTPC): 4.92, Power Grid Corporation of India (POWERGRID): 4.61, Oil & Natural Corporation (ONGC): 3.60, Grasim Industries (GRASIM): 3.59, Apollo Hospitals Enterprise (APOLLOHOSP): 2.73, and Adani Ports and Special Economic Zone (ADANIPORTS): 2.72 [3]. The figures mentioned along with the names of the stocks represent the respective weights (in percent) of the stocks used in computing the sectoral index of the NIFTY infrastructure sector.

The weights assigned by the MVP, HRP, and the autoencoder (ENC) portfolio based on the training data (January 1, 2018 – December 31, 2021) are presented in Table 13. Figure 23 depicts the portfolio weights allocated by the portfolios in the form of pie charts. POWERGRID received the maximum weights from all three portfolios, MVP, HRP, and ENC.

StockPortfolio weights
MVPHRPENC
RELIANCE0.11520.12820.1136
LT0.08760.10620.1274
BHARTIARTL0.07550.11370.1088
ULTRACEMCO0.05910.06070.0953
NTPC0.17710.12580.1169
POWERGRID0.31600.14800.1284
ONGC0.00460.04340.0837
GRASIM0.00460.04340.0837
APOLLOHOSP0.11640.10920.0467
ADANIPORTS0.04050.08980.0940

Table 13.

NIFTY infrastructure sector portfolio weights allocation.

Figure 23.

Weight allocation to the stocks of the NIFTY infrastructure sector by the MVP, HRP and autoencoder (ENC) portfolios.

Figures 24 and 25 show the cumulative returns of the portfolios over the training and the test periods, respectively. In Table 14, the summary of the performances of the three portfolios of the NIFTY infrastructure sector is presented for the training and the test periods, in which the annual returns, annual volatilities (i.e., standard deviations), and the max Sharpe ratio are tabulated.

Figure 24.

Cumulative daily returns yielded by the NIFTY infrastructure sector portfolios for the training period from January 1, 2018, to December 31, 2021.

Figure 25.

Cumulative daily returns yielded by the NIFTY infrastructure sector portfolios for the test period from January 1, 2022, to December 31, 2022.

PortfolioTraining performanceTest performance
Annual returnAnnual volatilitySharpe ratioAnnual returnAnnual volatilitySharpe ratio
MVP17.41%19.780.880110.85%17.510.6200
HRP17.42%20.990.83009.70%17.570.5523
ENC15.70%21.110.743811.38%17.830.6384

Table 14.

Portfolio performance on the NIFTY infrastructure sector.

5.8 NIFTY housing sector

The ten stocks from the NIFTY housing sector with the maximum free-float market capitalization and their respective contributions to the computation of the overall sectoral index according to the report published by the NSE on Dec 31, 2021, are as follows: Larsen & Toubro (LT): 11.25, Asian Paints (ASIANPAINT): 8.59, HDFC Bank (HDFCBANK): 6.99, ICICI Bank (ICICIBANK): 5.92, UltraTech Cement (ULTRACEMCO): 5.65, Tata Steel (TATASTEEL): 5.65, NTPC (NTPC): 5.46, Housing Development Finance Corporation (HDFC): 4.67, JSW Steel (JSWSTEEL): 4.24, and Grasim Industries (GRASIM): 3.99 [3]. The figures mentioned along with the names of the stocks represent the respective weights (in percent) of the stocks used in computing the sectoral index of the NIFTY infrastructure sector.

The weights assigned by the MVP, HRP, and the autoencoder (ENC) portfolio based on the training data (January 1, 2018 – December 31, 2021) are presented in Table 15. Figure 26 depicts the portfolio weights allocated by the portfolios in the form of pie charts. ASIANPAINT received the maximum weights from the MVP and HRP portfolios. The ENC portfolio assigned the highest weight to NTPC.

StockPortfolio weights
MVPHRPENC
LT0.06910.12870.1181
ASIANPAINT0.30990.18830.1149
HDFCBANK0.25840.08820.0884
ICICIBANK0.00050.07860.0829
ULTRACEMCO0.05940.07850.0818
TATASTEEL0.00350.06470.0709
NTPC0.29510.17540.1391
HDFC0.00090.06120.1218
JSWSTEEL0.00100.04650.0906
GRASIM0.00230.08990.0915

Table 15.

NIFTY housing sector portfolio weights allocation.

Figure 26.

Weight allocation to the stocks of the NIFTY housing sector by the MVP, HRP and autoencoder (ENC) portfolios.

Figures 27 and 28 show the cumulative returns of the portfolios over the training and the test periods, respectively. In Table 16, the summary of the performances of the three portfolios of the NIFTY housing sector is presented for the training and the test periods, in which the annual returns, annual volatilities (i.e., standard deviations), and the max Sharpe ratio are tabulated.

Figure 27.

Cumulative daily returns yielded by the NIFTY housing sector portfolios for the training period from January 1, 2018, to December 31, 2021.

Figure 28.

Cumulative daily returns yielded by the NIFTY housing sector portfolios for the test period from January 1, 2022, to December 31, 2022.

PortfolioTraining performanceTest performance
Annual returnAnnual volatilitySharpe ratioAnnual returnAnnual volatilitySharpe ratio
MVP16.03%19.850.807910.38%17.610.5897
HRP18.09%21.740.83249.92%18.590.5337
ENC18.33%22.830.803010.43%19.280.5411

Table 16.

Portfolio performance on the NIFTY housing sector.

5.9 NIFTY consumption sector

The ten stocks from the NIFTY consumption sector with the maximum free-float market capitalization and their respective contributions to the computation of the overall sectoral index according to the report published by the NSE on Dec 31, 2021, are as follows: ITC (ITC): 11.25, Hindustan Unilever (HINDUNILVR): 10.08, Bharti Airtel (BHARTIARTL): 9.69, Asian Paints (ASIANPAINT): 7.35, Mahindra & Mahindra (M&M): 7.01, Maruti Suzuki (MARUTI): 6.61, Titan Company (TITAN): 5.71, Nestle India (NESTLEIND): 3.84, Britannia Industries (BRITANNIA): 3.04, and Avenue Supermarts (DMART): 2.81 [3]. The figures mentioned along with the names of the stocks represent the respective weights (in percent) of the stocks used in computing the sectoral index of the NIFTY consumption sector.

The weights assigned by the MVP, HRP, and the autoencoder (ENC) portfolio based on the training data (January 1, 2018 – December 31, 2021) are presented in Table 17. Figure 29 depicts the portfolio weights allocated by the portfolios in the form of pie charts. ITC received the maximum weight from the MVP and HRP portfolios. The ENC portfolio assigned the highest weight to TITAN.

StockPortfolio weights
MVPHRPENC
ITC0.24120.15980.1232
HINDUNILVR0.16410.12320.1021
BHARTIARTL0.07140.09010.0958
ASIANPAINT0.10270.11470.1286
M&M0.02990.04120.0973
MARUTI0.00580.04460.0503
TITAN0.04770.08880.1374
NESTLEIND0.16650.10930.0904
BRITANNIA0.06730.12230.0870
DMART0.10350.10610.0878

Table 17.

NIFTY consumption sector portfolio weights allocation.

Figure 29.

Weight allocation to the stocks of the NIFTY consumption sector by the MVP, HRP, and autoencoder (ENC) portfolios.

Figures 30 and 31 show the cumulative returns of the portfolios over the training and the test periods, respectively. In Table 18, the summary of the performances of the three portfolios of the NIFTY consumption sector is presented for the training and the test periods, in which the annual returns, annual volatilities (i.e., standard deviations), and the max Sharpe ratio are tabulated.

Figure 30.

Cumulative daily returns yielded by the NIFTY consumption sector portfolios for the training period from January 1, 2018, to December 31, 2021.

Figure 31.

Cumulative daily returns yielded by the NIFTY consumption sector portfolios for the test period from January 1, 2022, to December 31, 2022.

PortfolioTraining performanceTest performance
Annual returnAnnual volatilitySharpe ratioAnnual returnAnnual volatilitySharpe ratio
MVP18.19%17.881.017815.68%15.571.0074
HRP17.91%18.500.968015.18%16.130.9416
ENC19.81%18.741.056814.79%16.620.8896

Table 18.

Portfolio performance on the NIFTY consumption sector.

5.10 NIFTY 100 ESG sector

The ten stocks from the NIFTY 100 ESG sector with the maximum free-float market capitalization and their respective contributions to the computation of the overall sectoral index according to the report published by the NSE on Dec 31, 2021, are as follows: Infosys (INFY): 6.36, Tata Consultancy Services (TCS): 5.99, Housing Development Finance Corporation (HDFC): 4.82, HCL Technologies (HCLTECH): 3.30, ICICI Bank (ICICIBANK): 2.92, Bharti Airtel (BHARTIARTL): 2.81, Tech Mahindra (TECHM): 2.76, Kotak Mahindra Bank (KOTAKBANK): 2.69, Bajaj Finance (BAJFINANCE): 2.69, and Titan Company (TITAN): 2.69 [3]. The figures mentioned along with the names of the stocks represent the respective weights (in percent) of the stocks used in computing the sectoral index of the NIFTY 100 ESG sector.

The weights assigned by the MVP, HRP, and the autoencoder (ENC) portfolio based on the training data (January 1, 2018 – December 31, 2021) are presented in Table 19. Figure 32 depicts the portfolio weights allocated by the portfolios in the form of pie charts. TCS received the maximum weight from the MVP and HRP portfolios. The ENC portfolio assigned the highest weight to BHARTIARTL.

StockPortfolio weights
MVPHRPENC
INFY0.08950.13280.0750
TCS0.25710.16060.0810
HDFC0.04400.06440.1180
HCLTECH0.09520.10670.0862
ICICIBANK0.01470.04850.1208
BHARTIARTL0.14120.07370.1209
TECHM0.05620.11310.1029
KOTAKBANK0.14250.12290.1175
BAJFINANCE0.00440.06020.0607
TITAN0.15520.11700.1169

Table 19.

NIFTY 100 ESG sector portfolio weights allocation.

Figure 32.

Weight allocation to the stocks of the NIFTY 100 ESG sector by the MVP, HRP and autoencoder (ENC) portfolios.

Figures 33 and 34 show the cumulative returns of the portfolios over the training and the test periods, respectively. In Table 20, the summary of the performances of the three portfolios of the NIFTY 100 ESG sector is presented for the training and the test periods, in which the annual returns, annual volatilities (i.e., standard deviations), and the max Sharpe ratio are tabulated.

Figure 33.

Cumulative daily returns yielded by the NIFTY 100 ESG sector portfolios for the training period from January 1, 2018, to December 31, 2021.

Figure 34.

Cumulative daily returns yielded by the NIFTY 100 ESG sector portfolios for the test period from January 1, 2022, to December 31, 2022.

PortfolioTraining performanceTest performance
Annual returnAnnual volatilitySharpe ratioAnnual returnAnnual volatilitySharpe ratio
MVP27.73%19.681.4088−5.66%18.51−0.3058
HRP30.12%20.301.4833−9.56%19.44−0.4921
ENC28.12%21.121.3292−4.00%18.84−0.2124

Table 20.

Portfolio performance on the NIFTY 100 ESG sector.

A summary of the results of the performance of the portfolios on the training data for the ten sectors is exhibited in Table 21. In Table 21, for each sector, the maximum return and Sharpe ratio, and minimum volatility values are presented in bold case. It is observed that the ENC portfolio produced the highest returns for five sectors, while the highest values of the Sharpe ratio were yielded by the MVP portfolio for six sectors. However, the MVP portfolio produced the minimum values of volatility for all ten sectors. Hence, it is concluded that on the training data, the ENC portfolio has exhibited the best performance on the metric annual return, while on the metrics Sharpe ratio and volatility, the MVP portfolio has performed the best among the three portfolios.

SectorMVPHRPENC
Annual returnAnnual volSharpe ratioAnnual returnAnnual volSharpe ratioAnnual returnAnnual volSharpe ratio
Commodities10.89%21.870.497813.82%23.490.588316.59%26.010.6375
Energy19.83%20.980.945115.81%21.920.721220.15%23.310.8644
Manufacturing17.40%20.760.838218.40%22.280.825919.12%25.580.7474
Services23.89%19.811.205925.03%21.421.168423.65%24.310.9727
MNC16.42%18.590.883314.73%19.490.755713.55%22.880.5922
Transportation16.26%22.750.715012.02%23.790.50538.55%26.030.3286
Infrastructure17.41%19.780.880117.42%20.990.830015.70%21.110.7438
Housing16.03%19.850.807918.09%21.740.832418.33%22.830.8030
Consumption18.19%17.881.017817.91%18.500.968019.81%18.741.0568
ESG27.73%19.681.408830.12%20.301.483328.12%21.121.3292

Table 21.

Summary of portfolio performance on the training data.

The summary of the results of the performance of the portfolios on the test data is exhibited in Table 22, in which, for each sector, the maximum return and Sharpe ratio, and minimum volatility values are presented in bold case. It is observed that the ENC portfolio produced the highest returns for five sectors, while the highest values of the Sharpe ratio were yielded by the MVP portfolio for six sectors. However, the MVP portfolio produced the minimum values of volatility for all eight sectors. Hence, it is concluded that on the test data, the ENC portfolio has exhibited the best performance on the metric annual return, while on the metrics Sharpe ratio and volatility, the MVP portfolio has performed the best among the three portfolios.

SectorMVPHRPENC
Annual returnAnnual volSharpe ratioAnnual returnAnnual volSharpe ratioAnnual returnAnnual volSharpe ratio
Commodities17.51%19.490.898213.01%20.480.635411.74%23.320.5034
Energy17.83%19.620.908614.82%19.540.758314.71%20.150.7033
Manufacturing9.93%16.270.610210.99%17.610.624211.54%20.790.5549
Services−0.45%18.68−0.02403.40%18.530.18347.92%19.570.4047
MNC17.18%17.240.996315.18%17.330.875415.70%20.040.7835
Transportation25.49%21.101.208125.73%21.511.196221.30%22.620.9413
Infrastructure10.85%17.510.62009.70%17.570.552311.38%17.830.6384
Housing10.38%17.610.58979.92%18.590.533710.43%19.280.5411
Consumption15.68%15.571.007415.18%16.130.941614.79%16.620.8896
ESG−5.66%18.51−0.3058−9.56%19.44−0.4921−4.00%18.84−0.2124

Table 22.

Summary of portfolio performance on the test data.

It is interesting to note that the ENC portfolio has yielded the maximum return for the majority of the sectors both on the training and the test data. Hence, for investors looking for higher returns, the best option is to follow the autoencoder-based (ENC) portfolio. However, for those investors who also take into account the risk associated with investments, the MVP portfolio is the best option as this portfolio has yielded the highest risk-adjusted returns for most of the sectors.

It also noted that the transportation sector has produced the highest annual return of 25.73% (which is yielded by the HRP portfolio) among the ten sectors on the test data. The transportation sector has also produced the highest Sharpe ratio (and hence, the highest risk-adjusted return) of 1.2081 (which is yielded by the MVP portfolio) on the test data. The consumption sector exhibited the lowest annual volatility value of 15.57 (which is yielded by the MVP portfolio) among the ten sectors.

Advertisement

6. Conclusion

This chapter has presented three portfolio design approaches on ten thematic sectors listed on the NSE of India. The three approaches to portfolio design are the mean-variance portfolio (MVP), hierarchical risk parity (HRP)-based portfolio, and autoencoder-based portfolio. The portfolios are designed based on the historical prices of the ten stocks from the ten sectors which have the maximum free-float market capitalization. The stock prices from January 1, 2018, to December 31, 2021, are used for designing the portfolios. The portfolios are tested on the out-of-sample data of stock prices from January 1, 2022, to December 31, 2022. Three metrics are used in the performance evaluation, annual return, annual risk (i.e., annual volatility), and Sharpe ratios. It is observed that the MVP portfolios have yielded the highest risk-adjusted returns and Sharpe ratios for the majority of the sectors on the out-of-sample data. However, autoencoder-based portfolios are found to have yielded the maximum annual returns for most of the sectors studied in this work. The results indicate that while the autoencoder models are accurate in estimating the future returns of portfolios, these models are inefficient in estimating the future volatilities of the stock prices. In future work, the performance of these portfolios will be studied on stocks listed on the major global stock exchanges.

References

  1. 1. Markowitz H. Portfolio selection. Journal of Finance. 1952;7(1):77-91. DOI: 10.2307/2975974
  2. 2. De Prado ML. Building diversified portfolios that outperform out of sample. Journal of Portfolio Management. 2016;42(4):59-69. DOI: 10.3905/jpm.2016.42.4.059
  3. 3. NSE Sectoral Index: https://www.nseindia.com/products-services/indices-sectoral (Accessed on July 25, 2023)
  4. 4. Sen J, Datta Chaudhuri T. An alternative framework for time series decomposition and forecasting and its relevance for portfolio choice – A comparative study of the Indian consumer durable and small cap sectors. Journal of Economics Library. 2016;3(2):303-326. DOI: 10.1453/jel.v3i2.787
  5. 5. Sen J, Datta Chaudhuri T. An investigation of the structural characteristics of the Indian IT sector and the capital goods sector: An application of the R programming language in time series decomposition and forecasting. Journal of Insurance and Financial Management. 2016;1(4):68-132. DOI: 10.36227/techrxiv.16640227.v1
  6. 6. Sen J, Datta Chaudhuri T. Understanding the sectors of the Indian economy for portfolio choice. International Journal of Business Forecasting and Marketing Intelligence (IJBFMI). 2018;4(2):178-222. DOI: 10.1504/IJBFMI.2018.090914
  7. 7. Sen J. A forecasting framework for the Indian healthcare sector index. International Journal of Business Forecasting and Marketing Intelligence (IJBFMI). 2021;7(4):311-350. DOI: 10.1504/IJBFMI.2022.10047095
  8. 8. Yang X, Mao S, Gao H, Duan Y, Zou Q. Novel financial capital flow forecast framework using time series theory and deep learning: A case study analysis of Yu’e Bao transaction data. IEEE Access. 2019;7:70662-70672. DOI: 10.1109/ACCESS.2019.2919189
  9. 9. Sen J. Stock composition of mutual funds and fund style: A time series decomposition approach towards testing for consistency. International Journal of Business Forecasting and Marketing Intelligence. 2018;4(3):235-292. DOI: 10.1504/IJBFMI.2018.092781
  10. 10. Bisht K, Kumar A. A portfolio construction model based on sector analysis using Dempster-Shafer evidence theory and Granger causal network: An application to national stock exchange of India. Expert Systems with Applications. Elsevier. 2023;215. DOI: 10.1016/j.eswa.2022.119434
  11. 11. Mehtab S, Sen J, Dutta A. Stock price prediction using machine learning and LSTM-based deep learning model. In: Thampi SM, Piramuthu S, Li KC, Berretti S, Wozniak M, Singh D, editors. Machine Learning and Metaheuristics Algorithms, and Applications. SoMMA 2020. Communications in Computer and Information Science. Vol. 1366. Singapore: Springer; 2021. pp. 88-106. DOI: 10.1007/978-981-16-0419-5_8
  12. 12. Mehtab S, Sen J. Stock price prediction using convolutional neural networks on a multivariate time series. In: Proceedings of the 2nd National Conference on Machine Learning and Artificial Intelligence (NCMLAI’20). New Delhi, India; 2020. DOI: 10.36227/techrxiv.15088734.v1
  13. 13. Sen J. Stock price prediction using machine learning and deep learning frameworks. In: Proceedings of the 6th International Conference on Business Analytics and Intelligence (ICBAI’18), December 20–22. Bangalore, India; 2018
  14. 14. Mehtab S, Sen J. Analysis and forecasting of financial time series using CNN and LSTM-based deep learning models. In: Sahoo JP, Tripathy AK, Mohanty M, Li KC, Nayak AK, editors. Advances in Distributed Computing and Machine Learning. Lecture Notes in Networks and Systems. Vol. 302. Singapore: Springer; 2022. pp. 405-423. DOI: 10.1007/978-981-16-4807-6_39
  15. 15. Sen J, Mondal S, Nath G. Robust portfolio design and stock price prediction using an optimized LSTM model. In: Proceedings of the IEEE 18th India Council International Conference (INDICON’21), December 19–21. Guwahati, India; 2021. pp. 1-6. DOI: 10.1109/INDICON52576.2021.9691583
  16. 16. Sen J, Mehtab S. Accurate stock price forecasting using robust and optimized deep learning models. In: Proceedings of the IEEE International Conference on Intelligent Technologies (CONIT’21), June 25–27. Hubballi, India; 2021. pp. 1-9. DOI: 10.1109/CONIT51480.2021.9498565
  17. 17. Sen J, Dutta A, Mehtab S. Profitability analysis in stock investment using an LSTM-based deep learning model. In: Proceedings of the IEEE 2nd International Conference for Emerging Technology (INCET’21), May 21–23. Belagavi, India; 2021. pp. 1-9. DOI: 10.1109/INCET51464.2021.9456385
  18. 18. Mehtab S, Sen J. Stock price prediction using CNN and LSTM-based deep learning models. In: Proceedings of the IEEE International Conference on Decision Aid Science and Applications (DASA’20), November 8–9. Sakheer, Bahrain; 2020. pp. 447-453. DOI: 10.1109/DASA51403.2020.9317207
  19. 19. Mehtab S, Sen J, Dasgupta S. Robust analysis of stock price time series using CNN and LSTM-based deep learning. In: Proceedings of the IEEE 4th International Conference on Electronics Communications and Aerospace Technology (ICECA), November 5–7. Coimbatore, India; 2020. pp. 1481-1486. DOI: 10.1109/ICECA49313.2020.9297652
  20. 20. Mehtab S, Sen J. A time series analysis-based stock price prediction using machine learning and deep learning models. International Journal of Business Forecasting and Marketing Intelligence (IJBFMI). 2020;6(4):272-335. DOI: 10.1504/IJBFMI.2020.115691
  21. 21. Sen J, Mehtab S. Long-and-short-term memory (LSTM) networks- architectures and applications in stock price prediction. In: Singh U, Murugesan S, Seth A, editors. Emerging Computing Paradigms: Principles, Advances, and Applications. USA: Wiley; 2022. pp. 143-160. DOI: 10.1002/9781119813439.ch8
  22. 22. Chandola D, Mehta A, Singh S, Tikkiwal VA, Agrawal H. Forecasting directional movement of stock prices using deep learning. Annals of Data Science. Springer Nature. 2022;2022. DOI: 10.1007/s40745-022-00432-6
  23. 23. Qiu J, Wang B. Forecasting stock prices with long-short term memory neural network based on attention mechanism. PLoS One. 2020;15(1):e0227222. DOI: 10.1371/journal.pone.0227222
  24. 24. Mehtab S, Sen J. A robust predictive model for stock price prediction using deep learning and natural language processing. In: Proceedings of the 7th International Conference on Business Analytics and Intelligence (BAICONF’19), December 5–7. Bangalore, India; 2019. DOI: 10.36227/techrxiv.15023361.v1
  25. 25. Sharaf M, Hemdan EE-D, El-Sayed A, El-Bahnasawy A. An efficient hybrid stock trend prediction system during COVID-19 pandemic based on stacked-LSTM and news sentiment analysis. Multimedia Tools and Applications. July 2023;82:(16):23945-23977
  26. 26. Nousi C, Tjortjis C. A methodology for stock movement prediction using sentiment analysis on Twitter and stock twits data. In: Proceedings of the 6th South-East Europe Design, Automation, Computer Engineering, Computer Networks and Social Media Conference (SEEDA-CECNSM’21), September 24–26. Preveza, Greece; 2021. pp. 1-7. DOI: 10.1109/SEEDA-CECNSM53056.2021.9566242
  27. 27. Bollen J, Mao H, Zeng X. Twitter mood predicts the stock market. Journal of Computational Science. 2011;2(1):1-8. DOI: 10.1016/j.jocs.2010.12.007
  28. 28. Audrino F, Sigrist F, Ballinari D. The impact of sentiment and attention measures on stock market volatility. International Journal of Forecasting. 2020;36(2):334-357. DOI: 10.1016/j.ijforecast.2019.05.010
  29. 29. Carta SM, Consoli S, Piras L, Podda AS, Recupero DR. Explainable machine learning exploiting news and domain-specific lexicon for stock market forecasting. IEEE Access. 2021;9:30193-30205. DOI: 10.1109/ACCESS.2021.3059960
  30. 30. Corazza M, Di Tollo G, Fasano G, Pesenti R. A novel hybrid PSO-based metaheuristic for costly portfolio selection problem. Annals of Operations Research. 2021;304:109-137. DOI: 10.1007/s10479-021-04075-3
  31. 31. Zhao P, Gao S, Yang N. Solving multi-objective portfolio optimization problem based on MOEA/D. In: Proceedings of the 12th International Conference on Advanced Computational Intelligence (ICACI’20), August 14–16. Dali, China; 2020. pp. 30-37. DOI: 10.1109/ICACI49185.2020.9177505
  32. 32. Chen C, Zhou Y. Robust multi-objective portfolio with higher moments. Expert System with Application. 2018;100:165-181. DOI: 10.1016/j.eswa.2018.02.004
  33. 33. Wang Z, Zhang X, Zhang Z, Sheng D. Credit portfolio optimization: A multi-objective genetic algorithm approach. Borsa Istanbul Review. 2022;22(1):69-76. DOI: 10.1016/j.bir.2021.01.004
  34. 34. Erwin K, Engelbrecht A. Improved set-based particle swarm optimization for portfolio optimization. In: Proceedings of 2020 IEEE Symposium Series on Computational Intelligence (SSCI’20). Canberra, Australia; 2020. pp. 1573-1580. DOI: 10.1109/SSCI47803.2020.9308579
  35. 35. Garcia F, Gujjaro F, Oliver J. Index tracking optimization with cardinality constraint: A performance comparison of genetic algorithms and tabu search heuristic. Neural Computing & Applications. 2018;30(8):2625-2641. DOI: 10.1007/s00521-017-2882-2
  36. 36. Sen J, Mehtab S. A comparative study of optimum risk portfolio and Eigen portfolio on the Indian stock market. International Journal of Business Forecasting and Marketing Intelligence. 2021;7(2):143-193. DOI: 10.1504/IJBFMI.2021.10043037
  37. 37. Sen J, Dutta A, Mehtab S. Stock portfolio optimization using a deep learning LSTM model. In: Proceedings of 2021 IEEE Mysore Sub Section International Conference (MysuruCon’21), October 24–25. Hassan, India; 2021. pp. 263-271. DOI: 10.1109/MysuruCon52639.2021.9641662
  38. 38. Sen J, Mondal S, Mehtab S. Portfolio optimization on NIFTY thematic sector stocks using an LSTM model. In: Proceedings of the IEEE International Conference on Data Analytics for Business and Industry (ICDABI’21), October 25–26. Sakheer, Bahrain; 2021. pp. 364-369. DOI: 10.1109/ICDABI53623.2021.9655886
  39. 39. Sen J, Dutta A. Design and analysis of optimized portfolios for selected sectors of the Indian stock market. In: Proceedings of the 2022 International Conference on Decision Aid Sciences and Applications (DASA’22), March 23–25. Chiangrai, Thailand; 2022. pp. 567-573. DOI: 10.1109/DASA54658.2022.9765289
  40. 40. Sen J, Dutta A. A comparative study of hierarchical risk parity portfolio and eigen portfolio on the NIFTY 50 stocks. In: Buyya R, Hernandez SM, Kovvur RMR, Sarma TH, editors. Computational Intelligence and Data Analytics. Lecture Notes on Data Engineering and Communications Technologies. Vol. 142. Singapore: Springer; 2022. pp. 443-460. DOI: 10.1007/978-981-19-3391-2_34
  41. 41. Sen J, Mehtab S, Dutta A, Mondal S. Precise stock price prediction for optimized portfolio design using an LSTM model. In: Proceedings of the IEEE 19th OITS International Conference on Information Technology (OCIT’21), December 16–18. Bhubaneswar, India; 2021. pp. 210-215. DOI: 10.1109/OCIT53463.2021.00050
  42. 42. Sen J, Mehtab S, Dutta A, Mondal S. Hierarchical risk parity and minimum variance portfolio design on NIFTY 50 stocks. In: Proceedings of the IEEE International Conference on Decision Aid Science and Applications (DASA’21), December 7–8. Sakheer, Bahrain; 2021. pp. 668-675. DOI: 10.1109/DASA53625.2021.9681925
  43. 43. Sen J. Designing efficient pair-trading strategies using cointegration for the Indian stock market. In: Proceedings of the IEEE 2nd Asian Conference on In-novation in Technology (ASIANCON’22), August 26–28. Pune, India; 2022. pp. 1-9. DOI: 10.1109/ASIANCON55314.2022.9909455
  44. 44. Sen J, Mehtab S, Dutta A. Volatility modeling of stocks from selected sectors of the Indian economy using GARCH. In: Proceedings of the IEEE Asian Conference on Innovation in Technology (ASIANCON’21), August 28–29. Pune, India; 2021. pp. 1-9. DOI: 10.1109/ASIANCON51346.2021.9544977
  45. 45. Chatterjee A, Bhowmick H, Sen J. Stock volatility prediction using time series and deep learning approach. In: Proceedings of the 2022 IEEE 2nd Mysore Sub Section International Conference (MysuruCon’22), October 16–17. Mysuru, India; 2022. pp. 1-6. DOI: 10.1109/MysuruCon55714.2022.9972559
  46. 46. Sinha M. Portfolio optimization using reinforcement learning: A study of implementation of learning to optimize. In: Choudrie J, Mahalle P, Perumal T, Joshi A, editors. ICT with Intelligent Applications. Smart Innovation, Systems and Technologies. Vol. 311. Singapore: Springer; 2023. pp. 719-728. DOI: 10.1007/978-981-19-3571-8_65
  47. 47. Sen J. Portfolio optimization using reinforcement learning and hierarchical risk parity approach. In: Rivera G, Cruz-Reyes D, Dorronsoro LB, Rosete-Suarez A, editors. Data Analytics and Computational Intelligence: Novel Models, Algorithms and Applications. Switzerland: Springer Nature; 2023
  48. 48. Lim QYE, Cao Q, Quek C. Dynamic portfolio rebalancing through reinforcement learning. Neural Computing and Applications. 2022;34:7125-7139. DOI: 10.1007/s00521-021-06853-3
  49. 49. Hu Y-J, Lin S-J. Deep reinforcement learning for optimizing finance portfolio management. In: Proceedings of 2019 Amity International Conference on Artificial Intelligence (AICAI’19), February 4–6. Dubai, UAE; 2019. pp. 14-20. DOI: 10.1109/AICAI.2019.8701368
  50. 50. Zha L, Dai L, Xu T, Wu D. A hierarchical reinforcement learning framework for stock selection and portfolio. In: Proceedings of the 2022 International Joint Conference on Neural Networks (IJCNN’22), July 18-23. Padua, Italy; 2022. pp. 1-7. DOI: 10.1109/IJCNN55064.2022.9892378
  51. 51. Wei L, Weiwei Z. Research on portfolio optimization models using deep deterministic policy gradient. In: Proceedings of 2020 International Conference on Robots & Intelligent System (ICRIS’20), November 7–8. Sanya, China; 2022. pp. 698-701. DOI: 10.1109/ICRIS52159.2020.00174
  52. 52. Huang S-H, Miao Y-H, Hsiao Y-T. Novel deep reinforcement algorithm with adaptive sampling strategy for continuous portfolio optimization. IEEE Access. 2021;9:77371-77385. DOI: 10.1109/ACCESS.2021.3082186
  53. 53. Wang H, Yu S. Robo-Advising: Enhancing investment with inverse optimization and deep reinforcement learning. In: Proceedings of the 20th IEEE International Conference on Machine Learning and Applications (ICMLA’21), December 13-16. Pasadena, CA, USA; 2021. pp. 365-372. DOI: 10.1109/ICMLA52953.2021.00063
  54. 54. Maree C, Omlin CW. Balancing profit, risk, and sustainability for portfolio management. In: Proceedings of the 2022 IEEE Symposium on Computational Intelligence for Financial Engineering and Economics (CIFEr’22), May 4–5. Helsinki, Finland; 2022. pp. 1-8. DOI: 10.1109/CIFEr52523.2022.9776048
  55. 55. Gasperov B, Saric F, Begusic S, Kostanjcar Z. Adaptive rolling window selection for minimum variance portfolio estimation based on reinforcement learning. In: Proceedings of the 43rd International Convention on Information, Communication and Electronic Technology (MIPRO’20), September 28–October 2. Opatija, Croatia; 2020. pp. 1098-1102. DOI: 10.23919/MIPRO48935.2020.9245435
  56. 56. Ha MH, Chi S-G, Lee S, Cha Y, Ro MB. Evolutionary meta reinforcement learning for portfolio optimization. In: Proceedings of 2021 Genetic and Evolutionary Computation Conference (GECCO’21), July 10–14. Opatija, Croatia; 2021. pp. 964-972. DOI: 10.1145/3449639.3459386
  57. 57. Gu F, Jiang Z, Su J. Application of features and neural network to enhance the performance of deep reinforcement learning in portfolio management. In: Proceedings of the 2021 IEEE 6th International Conference on Big Data Analytics (ICBDA’21), March 5–8. Xiamen, China; 2021. pp. 92-97. DOI: 10.1109/ICBDA51983.2021.9403044
  58. 58. Soleymani F, Paquet E. Financial portfolio optimization with online deep reinforcement learning and restricted stacked autoencoder – DeepBreath. Expert Systems with Applications. 2020;156:113456. DOI: 10.1016/j.eswa.2020.113456
  59. 59. Baily D, de Prado ML. Balanced baskets: A new approach to trading and hedging risks. Journal of Investment Strategies. 2012;1(4):21-62. DOI: 10.21314/JOIS.2012.010
  60. 60. Zhang C, Liang S, Lyu F, Fang L. Stock-index tracking optimization using auto-encoders. Frontiers in Physics. Open-access. 2020;8. DOI: 10.3389/fphy.2020.00388

Written By

Jaydip Sen and Subhasis Dasgupta

Submitted: 12 March 2023 Reviewed: 30 June 2023 Published: 16 November 2023