Next Article in Journal
Interaction of Variable Fluid Properties with Electrokinetically Modulated Peristaltic Flow of Reactive Nanofluid: A Thermodynamical Analysis
Next Article in Special Issue
Dendrite Net with Acceleration Module for Faster Nonlinear Mapping and System Identification
Previous Article in Journal
Evasion Differential Game of Multiple Pursuers and One Evader for an Infinite System of Binary Differential Equations
Previous Article in Special Issue
Low Dissipative Entropic Lattice Boltzmann Method
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Stock Portfolio Optimization with Competitive Advantages (MOAT): A Machine Learning Approach

by
Ana Lorena Jiménez-Preciado
1,
Francisco Venegas-Martínez
2,* and
Abraham Ramírez-García
3
1
Escuela Superior de Economía, Instituto Politécnico Nacional, Mexico City 11350, Mexico
2
Escuela Superior de Economía, Instituto Politécnico Nacional, Mexico City 11350, Mexico
3
Escuela Superior de Economía, Instituto Politécnico Nacional, Mexico City 11350, Mexico
*
Author to whom correspondence should be addressed.
Mathematics 2022, 10(23), 4449; https://doi.org/10.3390/math10234449
Submission received: 27 October 2022 / Revised: 23 November 2022 / Accepted: 23 November 2022 / Published: 25 November 2022
(This article belongs to the Special Issue Mathematical Modeling, Optimization and Machine Learning)

Abstract

:
This paper aimed to develop a useful Machine Learning (ML) model for detecting companies with lasting competitive advantages (companies’ moats) according to their financial ratios in order to improve the performance of investment portfolios. First, we computed the financial ratios of companies belonging to the S&P 500. Subsequently, we assessed the stocks’ moats according to an evaluation defined between 0 and 5 for each financial ratio. The sum of all the ratios provided a score between 0 and 100 to classify the companies as wide, narrow or null moats. Finally, several ML models were applied for classification to obtain an efficient, faster and less expensive method to select companies with lasting competitive advantages. The main findings are: (1) the model with the highest precision is the Random Forest; and (2) the most important financial ratios for detecting competitive advantages are a long-term debt-to-net income, Depreciation and Amortization (D&A)-to-gross profit, interest expense-to-Earnings Before Interest and Taxes (EBIT), and Earnings Per Share (EPS) trend. This research provides a new combination of ML tools and information that can improve the performance of investment portfolios; to the authors’ knowledge, this has not been done before. The algorithm developed in this paper has a limitation in the calculation of the stocks’ moats since it does not consider its cost, price-to-earnings ratio (PE), or valuation. Due to this limitation, this algorithm does not represent a strategy for short-term or intraday trading.

1. Introduction

A portfolio manager must optimize the performance of his portfolio by comparing different forecasting models. Although financial time series forecasting has been for a long time the basis for the control and management of systems (portfolios), time series data in the real world are usually non-stationary and non-linear, adding to the difficulty of reliable forecasting. An alternative to amend this situation appears to be the use of Machine Learning (ML) models (see [1]).
The application of ML models for stock valuation and corporate finance has been explored with different approaches. For example, in Khan et al. [2], a multi-portfolio selection problem was optimized by using ML with a biological method named Beetle Antennae Search (BAS), ensuring portfolio efficiency. Similarly, Lombardo et al. [3] used ML tools for corporate bankruptcy predictions where the Random Forest model had the best performance and accuracy.
This paper aims to develop an ML model for detecting companies with lasting competitive advantages (companies’ moats) according to their financial ratios to improve the performance in investment portfolios. Based on the methodology implemented by Morningstar [4], the selection of companies focuses on their competitive advantages. First, we will calculate the financial ratios as an input to select a company based on its competitive advantages. Subsequently, we will define an indicator that allows companies listed in the S&P 500 to be labeled as wide, narrow or null moat. Finally, we will apply different ML models for classification to obtain an efficient, faster and less expensive method to select companies with lasting competitive advantages.
The application presented in this paper classifies companies and determines the main financial features that impact the companies’ moats. In this sense, the contribution of this work is suitable both to detect macro trends and to hold long-term positions. This research differs from the existent literature in the following: (1) it develops a helpful ML model for detecting companies with lasting competitive advantages; (2) it provides a new combination of ML models and information that can improve the performance of an investment portfolio; and (3) it expands and promotes research on corporate finance and financial valuation with ML models.
This paper is organized as follows: Section 2 compares the performance of companies with broad competitive advantages vs. the S&P 500; Section 3 provides a brief literature review about the characteristics of a company with competitive advantages; Section 4 describes the financial data and carries out the estimation of companies’ moats; Section 5 applies ML models for classification; Section 6 provides a discussion of the results obtained; finally, Section 6 gives conclusions and acknowledges limitations.

2. A Brief Review of Competitive Advantages and Economic Moat

In 2013, VanEck and Morningstar (NY, USA) placed the first Exchange-Traded Funds (ETF) focused on companies with broad competitive advantages, namely the VanEck Morningstar Wide MOAT ETF. According to Morningstar [4], its methodology seeks to invest in economic moats, looking for companies with network-effect characteristics, cost advantages, efficient scale, intangible assets and high substitution costs as shown in Figure 1.
Table 1 shows that MOAT has outperformed the S&P 500 index (including dividends). Indeed, the ETF that tracks the S&P 500 has generated a cumulative total return of 347.6% versus 322.6% for the moat. In relative valuation, MOAT presents a more attractive valuation than the S&P 500. Moreover, MOAT has a superior performance in the stock market. It presents a more attractive relative valuation since it has a Price-to-Earnings (PE) ratio of 17.62; a growth in sales of 3.3% vs. a slightly more expensive valuation of the S&P 500 that is at 20.1 times with an increase in sales of 2.86%; and a higher dividend yield. Likewise, the moat has obtained a Sharpe ratio of 0.84 vs. 0.77 from the benchmark regarding risk.

Economic Moat

Porter’s traditional analysis of competitive forces [5] argues that a substantial set of characteristics determines an industry’s potential profit. These factors refer to the rivalry among existing competitors, market entry barriers, bargaining power of suppliers and demanders, and substitute goods.
The rivalry between companies in an industry refers to the different strategies that competitors can take to increase their income and profits. When an industry grows slowly, many companies of similar size tend to perform highly competitively. Among the most common strategies are: product differentiation, low-cost production, better location or specification, efficient advertising, price discrimination, or any other process that creates consumer loyalty or gives the company market power [6,7,8].
In industries with high capital requirements, it is usual to find market entry barriers. For example, the oil production sector requires intensive capital, making it extremely expensive to start production [9]. Likewise, investment flexibility leads to cost convergence towards economies of scale [10]. The main barriers to participating in Industry 4.0. according to [11] are:
  • Poor value-chain integration;
  • Cyber-security challenges;
  • Uncertainty about economic benefits;
  • Lack of adequate skills in the workforce;
  • High investment requirements;
  • Lack of infrastructure;
  • Work interruptions;
  • Challenges in data management and data quality;
  • Lack of security standards and norms.
The threat of substitute goods limits the sales potential that a company can have because these types of goods can increase the elasticity of demand. An example of this threat is traditional and electronic cigarettes. For instance, a 10% increase in price reduces demand by 5.6% [12]. Another example is how patents can benefit a pharmaceutical company.
The power of buyers refers to negotiating lower prices or demanding higher quality. In contrast, the power of suppliers refers to the ability of certain companies to set prices above marginal cost. This type of characteristic can occur under certain circumstances. For instance, a market-power condition can be observed in the case of Airbnb in France because the seasonality peaks allow it to improve its income [13]. However, it is not a lasting competitive advantage. In this sense, the COVID-19 pandemic generated a demand reduction for Airbnb. On the other hand, a clear example of the power of suppliers is the case of Microsoft. Here, the scarcity in software supply allows pricing above marginal cost.
Over time, the forces of Porter [5] have evolved to incorporate new elements. Nowadays, these elements can be seen in Morningstar [4] to select companies. Specifically, for Morningstar [4], there are five forces of economic moats: network effect, cost advantage, intangible assets, efficient scale, and switching cost. The network effect occurs when service users add value to the extent that more people use the service. This type of effect can be observed in the size of the perceived network, and it is positively correlated with satisfaction, autonomy, and affinity, resulting in user loyalty [14]. Finally, Facebook could be the most straightforward case of this economic moat.
Companies that show competitive advantages also exhibit large operating margins. They are also high-growth companies (more significant than already consolidated companies). In that sense, the time frame used is related to moments of economic fragility where the markets tend to prefer companies that are easier to predict (with no growth but good margins). The S&P 500 can cushion the performance in periods of deceleration and act as a “brake” in times of prosperity since it has the 500 most influential companies.
According to Morningstar [4], the cost advantage is directly related to economies of scale, and the gap between reaching high production volumes and reducing costs. In economic terms, a company presents economies of scale when the marginal cost is less than the average cost. These advantages can be seen directly in the companies’ gross margin. Lower costs are another critical issue in a price competition model since it allows them to be exerted on suppliers and customers [15].
Efficient scale is directly related to market share. New participants may not have incentives to enter limited-size markets as growth prospects are minor since investment capital returns could be below the cost of capital. For instance, efficient scale is a current issue in the ports of South Korea since it can determine the development or expansion of a port and the type of economies of scale that a port offers [16].
On the other hand, intangible assets such as trademarks and patents can play an essential role in developing competitive advantages because they limit competition and transfer pricing power to companies. These investments are difficult to value and usually are above the book value. Identifiable intangible assets can be collateral in financing through debt since they are valuable and essential for cash flows [17].
Finally, substitution costs are crucial when they are high (in money or time) for consumers who want to change a good or service because they become an impediment to entry into the industry. In this sense, a significant negative correlation exists between banking switching costs and competition [18].
The moat investment approach has received several criticisms. One of them is the one pointed out by Liu and Mantecon [19] who argue that investing in stocks with vast competitive advantages does not generate higher returns than a portfolio with high growth characteristics. However, they express that those investments based on moats seem to be protected against a mean reversion process and have a slightly higher Sharpe ratio. This research assumes a more significant risk to obtain better returns. The portfolio choice with the best Sharpe ratio is up to the investor, although Figure 1 suggests that the moat strategy offers better long-term returns and a better Sharpe ratio.
Among the most recent advances in moats research, the incorporation of Environmental, Social and Governance (ESG) criteria should be stated. Azeem, Ahmed, Haider and Sajjad [20] found a comprehensive correlation between organizational culture, knowledge sharing, and organizational innovation with acquisition of advanced manufacturing capabilities. In another study, Wan and Wasiuzzaman [21] determined that ESG disclosure improves company performance even when they already have some competitive advantage. For instance, in the case of Malaysia, an increase in ESG disclosure in a unit enhances the company’s performance by approximately 4%.
The computational advances and the improvement in the efficiency of algorithms are a reality and have reduced both the computational and monetary costs significantly. The analysis of large amounts of data (also known as Big Data) can offer competitive advantages, even for capital-intensive industries such as manufacturing [22]. Incorporating big data contributes positively to moat, providing a green corporate image.
On the other hand, digital data can improve business efficiency. In this sense, Raguseo, Pigni and Vitari [23] showed that companies could achieve operational efficiencies using real-time data. In that sense, investments in information technology positively affect the product’s effectiveness and, therefore, the operating process.
Unsurprisingly, portfolio managers in today’s financial market are faced with a trade-off. On one hand, some investments are in high-growth companies as they assume that ML and big data algorithms, in conjunction with another group of characteristics, can generate competitive advantages. On the other hand, short-sellers argue that these supposed competitive advantages are not reflected anywhere in the financial statements even though these companies are above their intrinsic value.
This research considers that when a company shows some competitive advantage, there is a possibility that it will not be reflected in the balance sheets, especially if these companies are in a growth phase. However, it is assumed that risk management is essential, which is why this research seeks to detect companies with competitive advantages that have managed to maintain them over time. The following section reviews the most important financial ratios in detecting lasting competitive advantages.

3. Methodology, Moat Ratios and Evaluation

Before developing the model, it is necessary to define the ratios determining the competitive advantages or companies’ moats. Table 2 shows the 20 financial ratios used to create the model and their explanation; a 5-year average was taken as a reference for each ratio.

Moat Evaluation

This section establishes the methodology for moat evaluation. First, for the moat evaluation, the percentiles will be determined for each indicator mentioned in Table 2. A range between 0 and 5 is used, where 0 indicates that the company has no economic moat and 5 indicates a comprehensive advantage. For ratios where a higher value has a negative impact (such as debt indicators), its highest percentiles acquire a lower rating; the inverse occurs in ratios where a higher value is better or “good”—the CROIC case, for example. Finally, all the values obtained are added together and delimited by thresholds. If the sum is less than 45, then the asset does not have a moat. If the sum is greater than 45 but less than 65, it has a narrow moat. Finally, if the sum is more than 65, then the company presents broad competitive advantages. That is, it has a wide moat.
Figure 2 shows the distribution of moats of the firms that belong to the S&P 500. The S&P 500 is distributed in 10 sectors according to the Global Industry Classification Standard (GICS). The different levels per sector are shown in Table 3.
Figure 2 shows that most companies that belong to the S&P 500 have narrow competitive advantages (241 firms). Moreover, 171 companies do not have any moat. Finally, the remaining 94 companies have a wide competitive advantage. Figure 3 shows the classification by sector. According to this classification, the sectors with the most significant number of companies with wide moats are information technology, health, and consumer discretionary. In contrast, utilities, energy, and real estate sectors do not have any company in that category; utilities and energy are mainly concentrated in the null moat classification. Another sector to highlight is communication services, which incorporates several stocks with no advantages. The rest of the companies have wide and narrow moats. On the one hand, there are high-growth and recently-created companies, such as Alphabet or Facebook. On the other hand, there are traditional companies in the maturity phase, such as Verizon or TMobile.
According to Table 3, the information technology, industrial, financial, health, discretionary consumption, consumer staples and materials sectors tend to present a greater concentration in narrow-type moats. In contrast, real estate, energy, communication services and utilities do not usually present moats. Of the total companies, 47% have a narrow moat, 33% have some moat, and 18% have a wide competitive advantage. The next section details the methodology for moat detection.

4. Empirical Results from ML Modeling

The database consists of 20 financial ratios computed from 506 firms in 10 industries. The data will increase considerably since we will use the Synthetic Minority Over-sampling Technique (SMOTE) developed by Chawla, Bowyer, Hall and Kegelmeyer [25]. This procedure selects nearby examples in the variable space, estimates a line between the variables, and generates a new sample to improve the classifier performance.
First, a random class sample with less data is chosen, and the k-nearest neighbors are calculated (3, in this case). A neighbor is selected randomly, and a new synthetic data series is created among the selected data, generating a convex join between the selected points. In this way, the database is balanced, showing 723 data points (241 for each class).
Once the moat classes are balanced, the database is randomly divided into a training set and a validation set; 70% of the sample was reserved for the training base and the remaining 30% for the training set.
Five ML classification models are run to determine the best results for companies with competitive advantages. The selection model is based on k-fold cross-validation, which segments the training base into K groups. The first group is treated as a validation set, and group k 1 is used to train the model. For this research, stratified cross-validation is specified, meaning that each fold has the same proportion of observations with a given absolute value. Table 4 shows the average accuracies under stratified k-fold cross-validation and their standard deviation.
Table 4 shows that the best model to classify the moat of the S&P 500 companies is the random forest, which presented the best level of accuracy with the lowest standard deviation, followed by gradient boosting.
Random forest is an ML model developed by Breiman [26] that applies a technique known as bagging or bootstrap aggregation to reduce the variance of an estimation function. For classification, a kind of evaluation “committee” is generated where each tree casts its vote, choosing the class that has received the highest votes.
Hastie, Tibshirani and Friedman [27] suggest that the idea behind bagging is to average many noisy but unbiased models to reduce variance. This is achieved through decision trees with a low bias if they are deep enough. Each tree is identically distributed (i.d.), meaning that the average of B trees tends to present the same expectation. In other words, the bias of the “committee” is the same as individual trees. Hence, the only expectation of improvement is the reduction of variance. The average, H, of B variables identically distributed, but not necessarily independent, that has a positive correlation ρ and an average variance σ 2 is given by:
H = ρ σ 2 + 1 ρ B σ 2
As B increases, the second argument of the above equation decreases, and the tree correlation size limits the averaging benefits. In other words, the estimation is improved by the random selection of input variables since this selection increases the trees. Random Forest reduces the correlation between them without increasing the variance too much. The classification function is summarized in the following expression:
C ^ r f B ( x ) = Majority   Voting   { C ^ b ( x ) } 1 b B
where C ^ b ( x ) is the result of the trees assembled. Figure 4 shows the confusion matrix on the validation data set. At this point, the model does not know the data and only acts as an evaluator outside the sample. The confusion matrix tends to be black when the model predicts the correct class and becomes white when it predicts incorrectly.
It is observed that the model presents some weaknesses in the prediction of narrow advantages since it could predict most of them with null moat but only a few with wide moat. Here, the importance of the variables of the random forest model is presented where a higher value implies that this feature is more critical for the total (normalized) reduction of the criterion, named Gini importance.
In addition, Table 5 shows a classification report suggesting that 93% of the companies were correctly, on average, classified outside the sample based on the F1 score. Note also that accuracy stands out for precision, indicating that the random forest model is efficient in a class-balanced classification; in this case, 92% of the classes of moat have been predicted correctly.
Finally, residual normality tests are implemented for the random forest model. As expected, it breaks with normality as shown in Table 6. However, the random forest algorithm relies on partitioning the data to make predictions (it does not require normality). Unlike traditional parametric models, random forest (and any ML specification) does not aim to generate the same distribution but to minimize prediction error (increasing the prediction accuracy). In this sense, random forests are robust when dealing with data that is not normally distributed.

5. Discussion of Results

The results are based on Shapley Additive exPlanations (SHAP) [28]. This methodology reduces the trade-off between accuracy and interpretability by computing the contribution of each feature to the prediction. In this sense, SHAP values allow comparison of the most important variables for every class of moat in Figure 5 and Figure 6.
Figure 5 exhibits the importance of every feature with their effect on the output. The x-axis shows SHAP values for every element and is ordered according to their importance. Colors represent if the value of an attribute has low or high priority. Overlapping points are jittered in the y-axis direction, which gives an idea of the distribution of the Shapley values per feature.
Figure 5 is separated into 3 subplots representing feature importance for each class of moat. Each point on the chart is one SHAP value for a prediction and feature. Red color means that an element has a higher value, while blue represents a lower feature value.
For example, firms with non-moat have a long-term debt-to-net income as a principal feature. However, the points that persist are the blue ones, meaning that this ratio has a low negative contribution at low values. However, when the dots turn red, the long-term debt means a high negative impact on the prediction. In other words, blue dots “push” the model towards a lower moat. For instance, the high-interest expense-to-EBIT has a negative contribution to the moat, while low values (blue) have a positive contribution. Pre-tax ROA predicts a negative moat, meaning that firms with non-competitive advantages tend to create nil or insufficient profit with their assets. Higher values of the current ratio exhibit a heightened and adverse relationship to the moat, indicating that when companies cannot pay their obligations in the short term, it affects their competitiveness, but when it turns to blue dots, companies have a low positive impact. The last elements of the plot, which are more centered, indicate that the ratios have less influence on the moat.
For a narrow moat, pre-tax ROA is the most crucial element; similar to non-moat, a high value of this ratio is linked to negative competitive advantages. Conversely, high and favorable interest rates and long-term debt-to-net income ratios are associated with a higher prediction of a narrow moat. Both high and negative values of net income and EPS trend ratios drive the model to a narrow moat. Likewise, the results coincide with [20,21] since the EPS Trend is one of the main elements that add a better value to the company. Consequently, it has a substantial impact on companies with narrow competitive advantages.
In the case of a wide moat, it should be pointed out that long-term debt-to-net income is also the most relevant feature, as is pre-tax ROA. Like non-moat, the first ratio presents a low negative contribution at low values. Still, pre-tax ROA is different since high and positive values are related to a wide moat and have a higher weight for prediction. Unlike null or narrow moat, pre-tax ROA incorporates earnings power value (EPV) and gross profit to the asset, meaning that both ratios are essential to a wide moat prediction. Likewise, both ratios have a high impact; this makes sense since a firm with lower capital costs (less WACC or more earnings) and the efficient allocation to use the company’s assets to generate gross profits is translated into a wide competitive advantage.
Color in SHAP values indicates the relationship of the variable with the closest feature and its interaction with the output. For instance, companies with a higher pre-tax ROA and lower long-term debt-to-net income are more likely to have a wide moat or competitive advantages. Appendix A shows complementary dependence plots of companies with null, narrow and wide moats as an alternative visualization to interpret the importance of the features by mapping each element in a subplot with its SHAP values on the y-axis. Finally, Figure 6 exhibits their overall importance (from least important to most significant). In that sense, long-term debt-to-net income, D&A to gross profit, interest expense-to-EBIT, and EPS trend are essential features for a company with competitive advantages.
The results obtained suggest that the most important features to determine a wide level of the moat of a company are:
  • Long-Term Debt-to-Net Income close to zero and high pre-tax ROA.
  • High EPV-to-reproduction value with a low Long-Term Debt-to-Net Income.
  • High Gross Profit-to-Assets with a high EPS trend.
  • High Gross Profit Margin with a high EPS Trend.
  • Interest Expense-to-EBIT is closer to zero and has a high EPS trend.
Moreover, the variables that reduce the possibility of being a company with a wide moat are:
  • High SG&A expenses with a weak EPS trend.
  • High D&A expenses with a high LT Debt.
  • Low Current Ratio with a low pre-tax ROA.
  • Lower ROIC-to-WACC with a lower Gross Profit-to-Assets.
  • Low Net Margin.
The main determinants of these features can be attributed to companies with lower levels of debt that can obtain a better performance in their margins. Likewise, the EPS trend is reflected in profitable growth and share repurchases. Finally, given the characteristics of ROA and gross profit-to-assets, companies with low investment in assets comparable to income and profits tend to have greater competitive advantages. All calculations in this research were performed with Python 3.9 [29].

6. Conclusions

A portfolio can be integrated with assets and investment capital through several criteria and methodologies. However, fundamental analysis is about examining financial ratios and performing an efficient valuation for the investor to select the asset. Among the different ways to choose an asset with a valuation method, the preference based on competitive advantages (i.e., moats), can represent a robust tool for investors, from the retail ones to the so-called whales. It is worth mentioning that this research proposes an alternative methodology to that of Morningstar [4] to select assets in terms of the companies’ moats based on financial ratios and ML.
After comparing several ML algorithms, the model with the highest precision is the Random Forest. Moreover, the most important financial ratios for detecting competitive advantages are a long-term debt-to-net income, D&A-to-gross profit, interest expense-to-EBIT, and EPS trend. These ratios are essential features for a company to have competitive advantages. Of the total companies, 47% have a narrow moat, 33% have some moat, and 18% have a wide competitive advantage.
Our analysis provides an optimal combination of tools and information that can improve the performance of an investment portfolio, with the highest moat being the optimization criterion. However, this paper has limitations in the calculation of the stocks’ moats since it does not consider its cost, price-to-earnings ratio (PE), or valuation. For this reason, this algorithm does not represent a strategy for short-term or intraday trading.
The contribution of this study can be divided into two parts. First, this algorithm can be used to invest in macro trends for speculative investments. Secondly, it can be used as a filter to discard companies with no value and keep only those with financial strength for a long-term investment.
We visualize two possible lines of future research: moat-duration analysis and moat valuation to optimize stock selection. The fact that a firm has wide competitive advantages does not necessarily imply that it must be selected at any time. Acquiring a discount share will always be the primary determinant of investment success.

Author Contributions

Conceptualization, data gathering, simulations, numerical tests, methodology, formal analysis, investigation, writing—original draft preparation and writing, review and editing, A.L.J.-P., F.V.-M. and A.R.-G. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by the Instituto Politécnico Nacional.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The simulation and test results data presented in this study are available on request from the corresponding author.

Acknowledgments

All the authors are very grateful to the reviewers for carefully reading the document and for the many valuable and pertinent comments and suggestions that improved the final version of this work.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A. Dependence Plots

Dependence plots suggest another visualization to interpret the importance of the features since it maps each element in a subplot with its SHAP values on the y-axis.
Figure A1. Dependence plot of companies with a wide moat.
Figure A1. Dependence plot of companies with a wide moat.
Mathematics 10 04449 g0a1
Figure A2. Dependence plot of companies with a narrow moat.
Figure A2. Dependence plot of companies with a narrow moat.
Mathematics 10 04449 g0a2
Figure A3. Dependence plot of companies with no moat.
Figure A3. Dependence plot of companies with no moat.
Mathematics 10 04449 g0a3

References

  1. Liu, W.-J.; Bai, Y.-T.; Jin, X.-B.; Su, T.-L.; Kong, J.-L. Adaptive Broad Echo State Network for Nonstationary Time Series Forecasting. Mathematics 2022, 10, 3188. [Google Scholar] [CrossRef]
  2. Khan, A.T.; Cao, X.; Liao, B.; Francis, A. Bio-Inspired Machine Learning for Distributed Confidential Multi-Portfolio Selection Problem. Biomimetics 2022, 7, 124. [Google Scholar] [CrossRef] [PubMed]
  3. Lombardo, G.; Pellegrino, M.; Adosoglou, G.; Cagnoni, S.; Pardalos, P.M.; Poggi, A. Machine Learning for Bankruptcy Prediction in the American Stock Market: Dataset and Benchmarks. Future Internet 2022, 14, 244. [Google Scholar] [CrossRef]
  4. Morningstar Wide Moat Focus. Available online: https://indexes.morningstar.com/our-indexes/equity/FOUSA06B9O (accessed on 14 December 2021).
  5. Porter, M.E. How competitive forces shape strategy. Harv. Bus. Rev. 1979, 57, 137–145. [Google Scholar]
  6. Ruiz-Moreno, F.; Mas-Ruiz, F.J.; Sancho-Esper, F.M. Strategic groups, and product differentiation: Evidence from the Spanish airline market deregulation. Res. Transp. Econ. 2021, 90, 101030. [Google Scholar] [CrossRef]
  7. Bet, G. Product specification under a threat of entry: Evidence from Airlines’ departure times. Int. J. Ind. Organ. 2021, 75, 102705. [Google Scholar] [CrossRef]
  8. Berendt, J.; Uhrich, S.; Thompson, S.A. Marketing, get ready to rumble—How rivalry promotes distinctiveness for brands and consumers. J. Bus. Res. 2018, 88, 161–172. [Google Scholar] [CrossRef]
  9. Covarrubias, M.; Gutiérrez, G.; Philippon, T. From Good to Bad Concentration? US Industries over the Past 30 Years. NBER Macroecon. Annu. 2020, 34, 1–46. [Google Scholar] [CrossRef]
  10. Guthrie, G. Investment flexibility as a barrier to entry. J. Econ. Dyn. Control 2020, 116, 103928. [Google Scholar] [CrossRef]
  11. Kumar, P.; Bhamu, J.; Singh Sangwan, K. Analysis of Barriers to Industry 4.0 adoption in Manufacturing Organizations: An ISM Approach. Procedia CIRP 2021, 98, 85–90. [Google Scholar] [CrossRef]
  12. Corrigan, J.R.; O’Connor, R.J.; Rousu, M.C. Which smokers adopt e-cigarettes and at what price? An experimental estimation of price elasticity of demand and factors. Addict. Behav. 2020, 105, 106324. [Google Scholar] [CrossRef] [PubMed]
  13. Casamatta, G.; Giannoni, S.; Brunstein, D.; Jouve, J. Host type and pricing on Airbnb: Seasonality and perceived market power. Tour. Manag. 2022, 88, 104433. [Google Scholar] [CrossRef]
  14. Tseng, F.-C.; Linh Pham, T.T.; Cheng, T.; Teng, C.-I. Enhancing customer loyalty to mobile instant messaging: Perspectives of network effect and self-determination theories. Telemat. Inform. 2018, 35, 1133–1143. [Google Scholar] [CrossRef]
  15. Alibeiki, H.; Li, S.; Vaidy, R. Market dominance or product cost advantage: Retail power impacts on assortment decisions. Int. J. Prod. Econ. 2020, 222, 107505. [Google Scholar] [CrossRef]
  16. Seo, Y.-J.; Park, J.S. The estimation of minimum efficient scale of the port industry. Transp. Policy 2016, 49, 168–175. [Google Scholar] [CrossRef] [Green Version]
  17. Lim, S.C.; Macias, A.J.; Moel, T. Intangible assets and capital structure. J. Bank. Finance 2020, 118, 105873. [Google Scholar] [CrossRef]
  18. Rizkiah, S.K.; Disli, M.; Salim, K.; Razak, L.A. Switching costs and bank competition: Evidence from dual banking economies. J. Int. Financ. Mark. Inst. Money 2021, 75, 101445. [Google Scholar] [CrossRef]
  19. Liu, Y.; Mantecon, T. Is sustainable competitive advantage an advantage for stock investors? Q. Rev. Econ. Financ. 2017, 63, 299–314. [Google Scholar] [CrossRef]
  20. Azeem, M.; Ahmed, M.; Haider, S.; Sajjad, M. Expanding competitive advantage through organizational culture, knowledge sharing and organizational innovation. Technol. Soc. 2021, 66, 101635. [Google Scholar] [CrossRef]
  21. Wan, M.; Wasiuzzaman, S. Environmental, Social and Governance (ESG) disclosure, competitive advantage and performance of firms in Malaysia. Clean. Environ. Syst. 2021, 2, 100015. [Google Scholar] [CrossRef]
  22. Waqas, M.; Honggang, X.; Ahmad, N.; Rehman Khan, S.A.; Iqbal, M. Big data analytics as a roadmap towards green innovation, competitive advantage and environmental performance. J. Clean. Prod. 2021, 323, 128998. [Google Scholar] [CrossRef]
  23. Raguseo, E.; Pigni, F.; Vitari, C. Streams of digital data and competitive advantage: The mediation effects of process efficiency and product effectiveness. Inf. Manag. J. 2021, 58, 103451. [Google Scholar] [CrossRef]
  24. Damodaran, A. Investment Valuation: Tools and Techniques for Determining the Value of Any Asset; Wiley Finance Series; Wiley: Hoboken, NJ, USA, 2012. [Google Scholar]
  25. Chawla, N.V.; Bowyer, K.W.; Hall, L.O.; Kegelmeyer, P.W. SMOTE: Synthetic Minority Over-sampling Technique. J. Artif. Intell. Res. 2002, 16, 321–357. [Google Scholar] [CrossRef]
  26. Breiman, L. Random Forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef]
  27. Hastie, T.; Tibshirani, R.; Friedman, J. Random Forests. In The Elements of Statistical Learning, 2nd ed.; Hastie, T., Tibshirani, R., Friedman, J., Eds.; Springer: New York, USA, 2009; pp. 587–604. [Google Scholar]
  28. Lundberg, S.; Lee, S.-I. A Unified Approach to Interpreting Model Predictions. In Advances in Neural Information Processing Systems, 1st ed.; Guyon, I., Von Luxburg, U., Bengio, Wallach, S., Fergus, R., Vishwanathan, S., Garnett, R., Eds.; Curran Associates, Inc: Long Beach, CA, USA, 2017; pp. 4768–4777. [Google Scholar]
  29. Python Software Foundation. Python Language Reference, version 3.9; Available online: http://www.python.org (accessed on 14 December 2021).
Figure 1. MOAT vs. S&P 500 performance.
Figure 1. MOAT vs. S&P 500 performance.
Mathematics 10 04449 g001
Figure 2. MOAT distribution.
Figure 2. MOAT distribution.
Mathematics 10 04449 g002
Figure 3. Moat per sector.
Figure 3. Moat per sector.
Mathematics 10 04449 g003
Figure 4. Confusion matrix (black—predicts the correct class; white—predicts incorrectly; grey—the chance of incorrectly predicting is small).
Figure 4. Confusion matrix (black—predicts the correct class; white—predicts incorrectly; grey—the chance of incorrectly predicting is small).
Mathematics 10 04449 g004
Figure 5. Importance of the features of each moat.
Figure 5. Importance of the features of each moat.
Mathematics 10 04449 g005
Figure 6. General feature importance. SHAP feature importance measured as the mean absolute Shapley values. Long term debt-to-net income was the most important feature, changing the predicted absolute moat probability on average by 14 percentage points (0.14 on x-axis).
Figure 6. General feature importance. SHAP feature importance measured as the mean absolute Shapley values. Long term debt-to-net income was the most important feature, changing the predicted absolute moat probability on average by 14 percentage points (0.14 on x-axis).
Mathematics 10 04449 g006
Table 1. Fundamentals of MOAT and S&P 500.
Table 1. Fundamentals of MOAT and S&P 500.
AssetPrice-to-Earnings (PE)Price to Book (PB)PB Growth (%)Dividend Yield (%)Sales Growth (%)Long-Term
Earnings Growth (%)
Sharpe
Ratio
MOAT17.623.773.771.793.310.360.84
SPY20.193.864.831.482.86140.77
Table 2. Ratios to select competitive advantages (moats).
Table 2. Ratios to select competitive advantages (moats).
RatioInterpretation
Gross   Margin = Revenue COGS Economies of scale emerge when the marginal cost is lower than the average cost. Companies with large production volumes are related to their moat, where higher revenues and lower costs positively impact the gross margin.
SG & A   E x p e n s e s Gross   profit Sales and administration expenses directly impact sales since advertising expenses, commissions and administrative wages are part of this ratio. Low operating costs imply that the good or service has high substitution costs or shows consumer loyalty.
D & A   Gross   profit Depreciation represents the wear and tear on the company’s assets. When this cash outflow is low, it implies operating efficiency. Those industries that do not require reinvesting large capital can redistribute more significant quantities in dividends, acquire new businesses, or repurchase shares.
Interest   coverage = Operating   Profit Interest   Expenses   Interest expense reflects an outflow of cash. Companies with low or no costs could have achieved good margins with low debt thanks to some competitive advantage and better margins. In this sense, they can provide a better return to the investor.
Net   margin = Net   income Revenue Companies with economies of scale, operational efficiency and low cost of debt have better profit margins. In this sense, the net margin becomes a significant indicator representing the business’s operational efficiency.
Earnings   per   share   trend  
  ( EPS   trend )
Companies with enduring competitive advantages overlook a consistent EPS trend. Earnings per share may improve for two reasons: first, improvement in business performance; and second, for-share repurchases that increase the value of the shareholders’ investment.
Inventory   trend   vs .
  Earnings   trend
For companies that use stocks, when inventories and profits trend strongly, it indicates that the company’s organic growth is in order; otherwise, both decrease strongly.
Net   accounts   receivable Revenue Companies with low net accounts compared to their income indicate good sales management. Likewise, it could be an indication of negotiating power.
ROA = Net   Income Total   assets Firms with high Return on Assets (ROA) regularly have little competition. Another interpretation is that companies that want to participate in a specific industry require concessions or biddings versus those with high ROAs, becoming a barrier to entry.
Short term   debt   Cash   and   equivalents   Companies that present more cash than short-term debt reflect good financial management and the ability to use resources differently.
Current   assets   Current   liabilities Firms with a high level of liquidity indicate the company’s ability to meet their short-term obligations by improving their leeway. Removing inventories, cash, short-term investments and short-term debt, and holding a negative working capital could indicate trading power.
Long term   debt   Net   income Holding profit levels over time with low debt levels implies more efficient companies. This reduces the default probability. In this sense, companies with a better debt-to-utility ratio can express the presence of economic moats.
Debt Capital   High debt levels relative to equity can erode any moat since a debt-predominant capital structure increases the cost of financing, decreasing the company’s valuation.
Retained   earnings   trend Companies with a positive trend in retained earnings imply good business performance and reasonable expectations for the future since these are used for reinvestment. On the other hand, firms with a negative or null trend could imply that the business is in a maturity phase or, in the worst case, declining.
ROE   vs .
  Adjusted   ROE = Net   Income Equity   adjusted   by   Treasury   stock
A high ROE indicates that a company has competitive advantages. For instance, share repurchase improves ROE. A vast difference between ROE and adjusted ROE suggests the presence of financial engineering, which needs to be accurate to be a competitive advantage.
CAPEX Revenue Companies with a network effect require smaller amounts of investment since the marginal cost of adding new users tends to be zero. In addition, firms that do not require high amounts of reinvestment to maintain the flow of income can distribute benefits in the repurchase of shares or distribution of dividends.
CROIC   = FCF Invested   capital On average, companies with a high CROIC can show several competitive advantages due to the company’s high Free Cash Flow (FCF) compared to the capital invested.
Expected   growth   on   EBIT   = Reinvestment   rate     ROIC = Reinvestment   rate × ROIC = CAPEX D & A + Δ W C EBIT ( 1 Taxes ) × EBIT ( 1 Taxes ) Capital + debt   This rate is used to estimate the expected growth in operating income. A company’s growth is determined by capital, which is reinvested, and the return on that investment. The expected operating income growth rate is based on the total reinvestment and invested capital return [24].
Gross   profit Total   assets This indicator measures the efficiency of organic growth. In this ratio, revenue stability is prioritized over new business acquisitions. The company experiences economies of scale when gross profit is high relative to assets.
ROIC     WACC Any company that obtains a return-on-capital more remarkable than its cost of capital is acquiring an excess return. It is the result of the competitive advantages of a company or the barriers to entering the industry. High returns over long periods imply that this company has a permanent competitive advantage [24].
Note: EBIT: Earnings Before Interest and Taxes. EPS: Earnings Per Share. COGS: Cost of Goods Sold. SG&A: Selling, General & Administrative Expenses. D&A: Depreciation & Amortization. CROIC: Cash Return on Invested Capital. WC: Working Capital. ROIC: Return on Invested Capital. WACC : Weighted Average Capital Cost.
Table 3. Stocks with moat per sector.
Table 3. Stocks with moat per sector.
Sector TotalNoneNarrowWideNone (%) TotalNarrow (%) TotalWide (%) Total
Information Technology768412710.553.935.5
Industrials7323401031.554.813.7
Financials65549117.775.416.9
Health Care6412312118.848.432.8
Consumer Discretionary6320281531.744.423.8
Consumer Staples321316340.650.09.4
Real Estate291811062.137.90
Utilities28262092.97.10
Materials281314146.450.03.6
Communication Services27147651.925.922.2
Energy21192090.59.50
Total5061712419433.847.618.6
Table 4. Model efficiency.
Table 4. Model efficiency.
ModelAccuracy (%)Standard Deviation
Logistic regression80.80.047
Support Vector Machine (SVM)88.00.033
Random forest91.20.022
Gradient boosting89.20.032
Artificial Neural Networks86.00.026
Table 5. Classification report (random forest).
Table 5. Classification report (random forest).
LabelPrecisionRecallF1-ScoreSupport
010.80.895
10.810.894
21113
Accuracy 0.9212
Macro Avg0.930.930.9312
Weighted avg0.930.920.9212
Table 6. Normality test.
Table 6. Normality test.
TestStatisticp-ValueResult
Anderson–Darling Test44.0140.0000Data do not follow the normal distribution
D’Agostino’s K2 Test111.5120.0000Data do not follow the normal distribution
Shapiro–Wilk Test0.4050.0000Data do not follow the normal distribution
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Jiménez-Preciado, A.L.; Venegas-Martínez, F.; Ramírez-García, A. Stock Portfolio Optimization with Competitive Advantages (MOAT): A Machine Learning Approach. Mathematics 2022, 10, 4449. https://doi.org/10.3390/math10234449

AMA Style

Jiménez-Preciado AL, Venegas-Martínez F, Ramírez-García A. Stock Portfolio Optimization with Competitive Advantages (MOAT): A Machine Learning Approach. Mathematics. 2022; 10(23):4449. https://doi.org/10.3390/math10234449

Chicago/Turabian Style

Jiménez-Preciado, Ana Lorena, Francisco Venegas-Martínez, and Abraham Ramírez-García. 2022. "Stock Portfolio Optimization with Competitive Advantages (MOAT): A Machine Learning Approach" Mathematics 10, no. 23: 4449. https://doi.org/10.3390/math10234449

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop