The impact of regulation-based constraints on portfolio selection: The Spanish case

Discussion about the effect of constraints in portfolio selection is a popular topic in finance. In this paper, we test the portfolio performance under the existence of regulatory constraints. This paper tries to provide evidence of whether the existence of regulatory constraints translates into a better long-term performance of investment funds, one of the most important investment vehicles for citizens. We show the returns and their relationship with the portfolio’s risk, compared to the same set without the usage of these constraints. The results state that, when using regulation as the constraining factor, we obtain more efficient portfolios.

Introduction P ortfolio selection has been a topic that gained traction since the 1950s with Markowitz's portfolio theory (1952), which provided a foundation for future research. His work was further extended and other theories, such as Sharpe's diagonal model (1963) were huge advancements for the portfolio selection problem, and most importantly, the Capital Asset Pricing Model (CAPM) (Lintner, 1965;Mossin, 1966;Sharpe, 1964) and the Arbitrage Pricing Theory (APT) (Ross, 1976) provided some of the most used models nowadays.
In the last decades, there has been a noticeable increase in the number of research papers where the main focus is constrained portfolio selection (see, for example, Asanga et al., 2014;Clarke et al., 2002;Basak and Croitoru, 2000;Pavlova and Rigobon, 2008;Detemple and Murthy, 1997;Cornet and Gopalan, 2010 among others), in order to obtain either more efficient sets, or portfolios that resemble reality better, but most of the constraints applied are observed in the market and the way it operates.
In this paper, we use an existing regulation regarding Spanish investment funds and use it as the constraining item over a set of simulated portfolios, to comprehend the difference law can make in terms of efficiency. We try to obtain evidence of whether the regulations imposed on investment funds translate into greater protection for investors or if, on the contrary, they are totally inefficient.
One of the motivations to test the Spanish investment funds regulation is the performance of these entities in Spain. Between 2005 and 2020, the returns showcased by the Spanish funds were relatively low, and worse than the IBEX 35 index, as during the mentioned time-lapse the average annual returns were 1.9 percent (Fernandez et al., 2021). This low performance could have its source for multiple reasons, although as it is mentioned in Fernandez et al. (2021), management fees could be shrinking the funds' portfolio returns. However, we cannot rule out the fact that it could be due to an improper regulation in terms of constraints, which instead of protecting the investors, provides them with worse performances than the ones they would get without any regulation.
The main contribution of this work is to study the efficiency of the regulatory constraints imposed on Spanish investment funds, providing results from two different scenarios where the results from a group of constrained portfolios are compared to their non-constrained counterparts. In this way, we propose to advance in the study of the possible causes of the low performance that these investment products had over the last decade in comparison with other investment strategies, revealing whether the core issue is located in the corresponding regulation applied, or whether the results can be attributed to other factors.
The rest of the paper is organized as follows. Section "Constrained portfolio selection: a literature review" includes a literature review of the most popular constraints used by the financial literature. Section "Investment funds and portfolio selection" includes an overview of the Spanish investment funds, and their regulation and performance. Section "Constraints, data, and simulated scenarios" includes the data and constraints we used for the study and the created scenarios. Section "Results" presents the results of our tests, and finally, these results are discussed in section "Conclusions and future research lines".
Constrained portfolio selection: a literature review Over the last decades, there have been some efforts in finding constraints that improve an investor's asset allocation, obtaining in the process more realistic sets. Some of these limitations can be observed directly in the market (e.g. transaction costs) and are not considered in models like the CAPM. Apart from considering the transaction costs, other restrictions can be cardinality constraints, leverage thresholds, or prohibiting short sales.
The classical mean-variance portfolio selection model is given by the following expression: where w i is the weight of asset i in the portfolio, μ is the portfolio mean and σ is the portfolio standard deviation.
Roughly speaking, the model aims at determining the fractions w i of a given capital to be invested in each asset i belonging to a predetermined set or market so as to maximize the expected return of the portfolio, while restricting the standard deviation of the portfolio to attain a specified value. The original model contains two basic restrictions: short sales are not allowed and the total budget has to be invested.
The cardinality constraint. Among the many refinements that have been proposed to make the Markowitz model more realistic, some of them refer to the introduction and the effect of different constraints.
Cardinally constraints are referred to the number of assets to be held in an efficient portfolio, and that also prescribes lower and upper bounds on the fraction of the capital invested in each asset. The underlying logic behind this constraint is the existence of transaction costs, minimum lot sizes, the complexity of management, or the policy of the asset management companies.
The computational complexity for the solution of the LAM model is much greater than the one required by the classical Markowitz model or by several other of its refinements and it is since the classical Markowitz model is a convex quadratic programming problem that has a polynomial worst-case complexity bound, while the LAM model falls into the class of considerably more difficult NP-hard problems.
The LAM model includes in Eq. (1) the constraint that no more than K assets should be held in the portfolio (a cardinality constraint). Thus, we obtain the following Limited Assets Markowitz model:

ARTICLE
HUMANITIES AND SOCIAL SCIENCES COMMUNICATIONS | https://doi.org/10.1057/s41599-022-01327-w Problem (2) is no longer a convex optimization problem because of the non-convexity of its feasible region. Several different approaches have been proposed to solve LAM. For example, Bienstock (1996) proposed a branch-and-cut algorithm and reported good computational results, Bertsimas and Shioda (2009) extended the algorithm of Bienstock (1996) presenting a tailored procedure, based on Lemke's pivoting algorithm. Li et al. (2006) proposed a convergent Lagrangian method as an exact solution scheme describing some computational results for problems with at most 30 assets. In the same line, Shaw et al. (2008) made an application with up to 500 assets.
Exact methods are able to solve only a fraction of practically useful LAM models. However, a variety of heuristic procedures have been presented in the financial literature. Schaerf (2002) discussed some local search techniques, while Chang (2000) presented three heuristics based upon genetic algorithms, tabu search, and simulated annealing. Frangioni and Gentile (2006) presented two heuristic solution approaches for problems subject to buy-in threshold, cardinality, and round lot constraints. Cesarone et al. (2007) presented a new method for solving the mean-variance portfolio selection model with cardinality and buy-in threshold constraints. Le Thi and Moeni (2014) extended the mean-absolute deviation (MAD) model including threshold and cardinality constraints.
From a different perspective, Duran et al. (2009) tested different algorithms under the cardinality constraint in mutual fund portfolios in order to observe which one of them provides better results. Their tests showed that there are differences between the algorithms depending on the type of mutual fund used for the study, obtaining better results for an algorithm based on the Pareto optimality. Zhang et al. (2019) and Yusuf et al. (2019) also used different approaches to include the cardinality constraint. In Yusuf et al. (2019), a probabilistic model that included multiple restrictions (cardinality, transaction costs) was used, and it provided great overall results, as the model provides higher returns and a better risk-return relationship.
Short sales constraint. The ban on short sales is the most classical portfolio selection constraint. Short sales occur when an investor has pessimistic expectations regarding a certain asset or group of assets. The investor then sells those assets (which are not in their portfolio), buying them in a later period of time, expecting that their price will be lower. This is a risky asset management technique, as it can lead to great losses since the value of an asset can go up unboundedly, and also transaction costs could decrease the earnings obtained, although it can provide great benefits as well. Therefore, shortselling an asset should be considered cautiously. This is undoubtedly one of the most controversial restrictions. The first approach to this problem was done by Pogue (1970) where the author introduced an extended version of Markowitz's portfolio selection model including, among others, short sales. Lately, Green and Hollifield (1992) provided evidence that minimum variance portfolios will contain extreme positive and negative weights. Board and Sutcliffe (1994) tested how the shorting prohibition fares in the UK market, studying the market's performance both when short sales are permitted and prohibited, considering the existence of different investors in terms of risk aversion (this implies the usage of different values of the risk aversion parameter). The results provided show that the portfolios with short sales have greater returns than the constrained sets, in some cases having twice the value, although the associated risk is extremely high. Under a historic approach, the standard deviation from the constrained sets tends to be lower than the unconstrained scenarios, and it is found that, when an investor can withstand higher risk levels, the portfolios that include short sales offer negative returns. Jagannathan and Tongshum (2003) proved that when the no short sale restriction is already in place, minimum variance and minimum tracking error portfolios constructed using the sample covariance matrix perform as well as those constructed using covariance matrices estimated using factor models and shrinkage methods. The authors also showed that in the minimum variance portfolios built with the non-negativity restriction on the weights is that the diversification between the assets decreases considerably.
In a similar line, Fan et al. (2012) introduced the grossexposure constraint, proving that the portfolio optimization problem with this constraint bridges the gap between the optimal no-short-sale portfolio and no constraint on short sales in Markowitz's framework. The authors provided theoretical insights into the observation made by other authors that the optimal no-short-sale portfolio has a smaller actual risk than that of the global minimum portfolio. The authors demonstrated that the optimal no-short-sale portfolio is not diversified enough. Alexander et al. (2009) explored the question of whether a VaR constraint reduces estimation risk when short sales are allowed. Authors found that optimal portfolios in the presence of the constraint are substantially closer to the empirical efficient frontier than those in its absence. Kim et al. (2016) presented a revised mean-variance formulation that allows short-selling to examine the worst case only when short positions are allocated to assets. Results show that the proposed portfolios have characteristics that fall between meanvariance portfolios with and without no-shorting constraints.
Other constraints. Apart from the previous constraints, there are other features inside the financial markets that could be used as restraining items for portfolio selection. For example, we can apply leverage constraints over a set of assets so that part of the portfolio's wealth is dedicated to riskless assets. Bradfield and Raubenheimer (2001) tested the impact of the leverage constraint, finding that when a larger portion of a portfolio's wealth is dedicated to risk-free assets, an investor tends to compensate for such levels of exposure with assets that are prone to a higher standard deviation, and vice versa. This meant that some portfolios that included a larger portion of risky assets had lower levels of volatility than other sets with larger portions of riskless assets.
Another one of the main limitations would be transaction costs, which were used in numerous research papers to restrict the portfolios alongside other constraints. In Chen et al. (2018), a hybrid firefly-genetic algorithm (FA-GA) is proposed for a model that includes multiple restrictions, such as cardinality and transaction costs, while in Chen et al. (2018) features such as expectations or a chance constraint are included. Grauer and Shen (2000) also tested a set of constraints which includes the short sales prohibition and restrictions on lending or borrowing, and budget limitations in order to check if these restraints allow for more efficient portfolios. In their results, the portfolios obtained are less risky, but their returns are also lower, offsetting the decrease in risk. Soleimani et al. (2009) proposed a model that also includes restrictions such as transaction lots or the cardinality constraint, where the results show that the model could be used for portfolio selection. Fama and French (2008) reported the effect that management fees have on mutual fund performance. When these costs are not included, the funds tend to obtain returns similar to an investor's portfolio but, when management fees are included, a large part of the performance is lost, and in some scenarios, the return can be negative. This is one of the main reasons to explore the Spanish investment funds data, in order to check if the same problem occurs, or if they have proper returns. Bellalah et al. (2019) examined the optimal portfolio choice in the presence of risky labor income, retirement horizon, and shadow costs of incomplete information and short sales, whereas in Xue et al. (2019) the authors included a return risk control constraint and a liquidity risk control constraint among others. Finally, Kaucic (2019) proposed an extension of the Markowitz mean-variance asset allocation framework, where cardinality, buy-in thresholds, budget constraints, and risk parity conditions are handled at the same time.
In Xue et al. (2019) the authors included a return risk control constraint and a liquidity risk control constraint among others. Kaucic (2019) proposed an extension of the Markowitz meanvariance asset allocation framework, where cardinality, buy-in thresholds, budget constraints, and risk parity conditions are handled at the same time.
In a completely different line, García-Medina et al. (2021) model asset allocation as a multi-period optimization problem satisfying the regulatory constraints of the Retirement Savings System in Mexico.
These regulatory constraints are typical of pension funds and are based on Merton's life cycle models. In the 1960s, economists developed models which put forward that individuals should optimally maintain constant portfolio weights throughout their lives (Samuelson, 1969;Merton, 1969). However, these models consider that investors have no labor income, which is an unrealistic assumption. Today, it is accepted that young investors should invest a larger fraction of their financial wealth in risky assets than the elderly. Life-cycle funds and target-date funds, which are based on these principles, are popular investment vehicles in many countries (Bikker et al., 2012).
These constraints, which are not the object of this work, are considered when the investor selects the optimal investment fund according to their risk profile and are expressed in the Markets in Financial Instruments Directive (MIFID).

Investment funds and portfolio selection
Overview. According to Bovenberg et al. (2007), individuals delegate financial decision-making to financial intermediaries for several reasons. First, individuals lack the expertise to implement a financial plan for their lives. Second, financial intermediaries reduce the costs of long-term financial planning by benefiting from the scale economies associated with specialization in acquiring financial expertise and accessing financial markets.
As it would happen with an individual investor, one of the key factors in portfolio selection for investment funds is diversification. In fact, funds operate under certain regulations which ensures that there is a diversified set of assets. Although the returns may be lesser than in a non-diversified portfolio, investing in a larger number of assets greatly decreases the portfolio's risk.
Another important point for investment funds is the management method. A fund can be managed in a passive or active way. The latter option implies that the fund's portfolio structure can be modified in order to obtain higher returns. Although riskier, active management can provide higher returns than passive management, which implies that the portfolio follows the behavior of certain index.
There are other factors that could also have a noticeable impact in an investment fund's portfolio. For example, the short-term past performance can be checked, as some funds that got positive returns may continue this trend in the following months, or years. This is the momentum factor, which was studied by Carhart (1997). The author found out that under the control of this feature, the portfolios would include mostly assets of the same nature (i.e. a portfolio that includes winning assets is composed mainly by other winning assets as well). Carhart (1997) mentioned as well that the persistence in returns explained the returns of the portfolios set up under this criteria, but it was important to notice that there was no evidence of long-term persistence, meaning that after another year of nonnegative returns, this winning pattern is diluted in the following periods.
Furthermore, other market features could have an impact over investment funds and their portfolios. One of these items would be the market timing ability. This means that the fund's manager has a set of skills that allow him to anticipate the market's behavior and thus, altering the fund's portfolio structure in order to obtain higher returns. Henriksson (1984) tested the market timing phenomena to verify if fund managers can predict the market and look ahead, resulting in higher returns, although no market timing ability could be observed in his sample. This could be due to the data frequency of his sample, since he used monthly data. Bollen and Busse (2001) tested the timing factor under a sample that provided data in a daily basis. In their results, it is shown that managers do have market timing abilities, but these results depend on the way the data is displayed, since the key aspect here was using daily values.
Finally, transaction costs are an important factor as well for investment funds, as they decrease the returns of the portfolios, meaning that sometimes a fund with positive returns may end up with negative performance. Fama and French (2008) tested a group of investment funds' portfolios under different scenarios which would include or not transaction costs, as well as checking the momentum factor. Their tests offer similar results to those obtained by Carhart (1997) in terms of persistence, as their data displayed that the funds with positive returns over the last 6-12 months continued this trend during the following year, after which the performance seemed to decrease.
The other portion of the research by Fama and French (2008) provided the results of simulations over different scenarios for investment funds, where management fees can be considered or not. The results show that some investment funds could not obtain returns as high as their management fees and that the existence of high-quality information is not an important factor for the better-performing funds.
Investment funds in Spain. Given the fact that transaction costs and other fees may have a huge impact on the fund's portfolio returns, it is important to check as well the performance of Spanish investment funds, having another framework to work with. Fernandez et al. (2021) present annual data concerning the Spanish funds, including information such as the number of existing funds, their worth, and their performance (see Table 1). The data shows that the funds with over 15 years of existence provided an average annual return of 1.9 percent between 2005 and 2020. For the same time series, the IBEX 35 average returns were 2.7 percent, while 15-year bonds provided almost twice the performance of the Spanish investment funds (3.4 percent). The data show as well information about each year's returns, and other details, such as the number of funds. During the years between 1990 and 2005, the number of funds and their worth increased drastically, while providing relatively high returns (when they were positive, they tend to be higher than 5 percent). As it could be seen, Spanish investment funds obtained low average returns in the last years, which leads to finding the source of this performance. Fernandez et al. (2021) stand by the argument that management fees play a huge role in a fund's performance, explaining that there are few managers that deserve to be paid fees that go up to 2 percent. This also showcases another issue with the Spanish funds, since they have taxation benefits regarding reinvested earnings, but this would require that the investment funds' returns were meaningful.
Another key factor that may cause this poor performance from the Spanish funds could be its regulation. Funds are regulated under law, and thus, their portfolios are constrained by default in order to ensure diversification. In Spain, the Royal Decree 1082/ 2012, of July 13, "by which the Development Regulation is approved of Law 35/2003, of November 4, on collective investment institutions" (Real Decreto 1082/2012, de 13 de julio, "por el que se aprueba el Reglamento de desarrollo de la Ley 35/ 2003, de 4 de noviembre, de instituciones de inversión colectiva") is the regulation that specifies every aspect of investment funds and applies restraints to a fund's portfolio.
It would be interesting thus, to check how the regulation and its constraints would fare in simulated data with random portfolios. This is, creating portfolios that resemble the investment funds' sets without including management fees, and comparing them to a scenario where no restrictions are used. This way, we could figure out if the regulation has either a positive or negative impact when it comes to limiting asset allocation, leading to more or less efficient portfolios.

Constraints, data, and simulated scenarios
The reasons showcased previously lead us to study the behavior of the Spanish investment funds regulation, in order to provide an insight on this topic and to check if the law provides the funds with more efficient portfolios by using constraints in the asset allocation process, or if restraining the funds' portfolios has a negative impact on their performance.
Constraints. In this study, the Real Decreto 1082/2012 was used to constrain the simulated portfolios, as it could provide valuable information about the performance of this regulation. In particular, we used the basic restrictions from article 50, which would apply to any asset, and they specify that: • As a general rule, a single asset can represent up to 5 percent of the fund's portfolio wealth. This implies that a portfolio must have at least 20 assets.

•
The previous percentage can be surpassed and extended up to 10 percent, but the sum of the weights of the assets that represent more than 5 percent of the portfolio cannot be higher than 40 percent. This reduces the amount of needed assets to 16 (there would be at least 12 assets with a maximum weight of 5 percent, and four assets with a maximum weight of 10 percent).
These constraints ensure that diversification is met, in order to get less risky portfolios, but apart from these limits, we consider the existence of transaction costs, which account for a percentage of 0.5 percent of the operation fare. This way, the portfolios should be closer to reality.
Data sampling. The next part should be specifying the sample for the simulations. For this study, we use data from the current stocks in the S&P 500 index, which includes companies both from the NASDAQ and NYSE. This is an interesting choice since these stocks provide enough liquidity even for the greatest funds.
Considering the prior information, we used a time-lapse of 25 years, starting in 1995, and ending in 2020, therefore being a lengthy sample, and two different time series are studied. First, there are data from 5-year tests (e.g. from 1995 to 2000), and also 10-year periods are tested. This way we can also check if a larger time frame provides different results as well.
The simulated scenarios. In order to test the regulation and its performance, two different scenarios are considered. The starting point is the regulation itself and its constraints, meaning that right at the start, each simulated portfolio complies with the limitations, regardless of the scenario. The starting portfolio is the same for both scenarios and then it evolves as follows: • The first scenario corresponds to a buy-and-hold strategy, where after the starting point there is no need to comply with the regulation, and the limits can be exceeded. After 5 or 10 years, the portfolio is sold. This is the unconstrained case.
• The second scenario corresponds to the regulationconstrained setting. In this case, the portfolios are monitored month by month, ensuring that the thresholds have not trespassed. If any of the limits could not be compiled, the following operations occur: -If any asset surpasses the 10 percent threshold, such asset will be sold until its weight drops down to 9 percent. The result of this sale will be redistributed among the remaining assets inside the portfolio, respecting the regulation-based limits.
-If the sum of the weights from the assets that surpass the 5 percent limit is above 40 percent, one of these assets is sold until its percentage drops down to 4.5 percent (in order to have no influence on the 40 percent limit). If the sum is still above 40 percent, more assets will be sold until they drop out of the above 5 percent category.
Fund managers, after careful analysis, make a selection of stocks and weights to build their portfolios. In this study, the main goal is to compare that ideal portfolio (assuming that it satisfies the previous restrictions at the beginning of the investment period) performance with the performance of the same starting portfolio that has to be monthly adjusted to meet the constraints, as described previously. Thus, we simulate both scenarios for one thousand random portfolios (satisfying the constraints at the beginning of the investment period) and review the results for both scenarios: • The first graph shows the end value of each dollar inverted for both constrained and unconstrained portfolios. In these, the X-axis provides the data for the restricted sets, while the Y-axis shows the results for the non-constrained case.
• The second type of graph is similar to the previous one, but the results displayed show the Sharpe ratio of monthly return for both scenarios. With the same format, the X-axis refers to the constrained sets, and the Y-axis reports the unconstrained portfolios' Sharpe ratio.

•
The last kind of chart is the histogram for the Sharpe ratio in both scenarios. The X-axis provides the difference between the Sharpe ratio of the unconstrained portfolios relative to the constrained ones, but the Y-axis reports the number of points inside one region of the X-axis. This way we can see where the majority of points will be located, and therefore provide a better insight into the results.

Results
Five-year intervals. First off, we proceed to show the data regarding the 5-year intervals, displaying the results from the six different samples, covering the following years: 1995-2000, 2000-2005, 2002-2007, 2007-2012, 2009-2014, and 2015-2019. Initially, the end value of the portfolios is shown, followed by comparison in the portfolios' Sharpe ratio, which will be represented in a histogram as well. Figure 1 reports the end value of one dollar after a 5-year period, for both scenarios. While the X-axis provides the restricted portfolios' value, the Y-axis shows the nonconstrained counterpart performance. For example, a point located in the section "The simulated scenarios" would mean that after 5 years, the portfolio obtained a higher value under the use of constraints. The key factor on these charts is the orange line, as it is used as the performance frontier. Any point located under the line is a portfolio where the end value was higher when constraints were applied, while any point above the frontier equals higher performance for the unrestricted set.
For each of the six periods, it can be seen with ease that the majority of portfolios are concentrated under the orange line, showing that overall a set obtains a higher value under the use of constraints. The better performing unconstrained portfolios meanwhile are scattered across the charts for most of the samples, but to a lesser extent in Fig. 1e. In the remaining graphs, we see that either the dots over the orange line are located on the left side of the data, or to the right side, showing that when the restricted portfolios obtain low results, or very high ones, the non-constrained sets achieve higher performance, although the amount of data over the orange line accounts for a minor amount of the results.
Another interesting fact is that during the first two decades, a huge decrease in the end value can be seen in both scenarios. The transition from 1995-2000 to the 2000-2005 results is the most extreme one, as some portfolios achieved values up to 8 or 17.5 dollars for the restricted and non-restricted scenarios, respectively.
For the next two time periods, the value decreases even further, and for the unrestricted scenario, there are portfolios with a value lower than 1 in the 2007-2012 sample. This decrease is mitigated in the following sample, regarding the years from 2009 to 2014, where the regulation-based portfolios achieved mostly values between three and five dollars, which is a great increase compared to the previous results, although the value goes down again in the latest sample.
Next up, Fig. 2 provides the risk-return relationship data, measured with the Sharpe ratio for the six samples we simulated on a 5-year lapse. These charts share the same format as the end value ones, and thus, the X-axis displays the Sharpe ratio of the regulation-constrained portfolios, while the Y-axis does the same with the non-restricted case, meaning that any dot under the orange line is a portfolio where the link between the returns and risk was better when we use the legislation restraints.
We can observe the same trend as we did in Fig. 1, and the majority of data tend to be under the orange line, meaning that in a greater amount of the simulated results, the portfolios obtained a higher Sharpe ratio when the regulation limits are used.
We find that for the first three samples, the dots under the line tend to be concentrated, while the points where the unrestricted scenario performed better are scattered across the graph on the left side. This shows that, during those periods, the non-restricted portfolio had better results only in the more unconventional results for the restricted scenario.
It is worth mentioning that the results from Fig. 2 are slightly better than the ones from the end value, as more points tend to be under the orange line on the risk-return relationship graphs, especially in the 1995-2000 and 2009-2014 periods. This means that, even if a non-restricted portfolio obtained more value after 5 years, there is a chance that the risk associated with that portfolio was noticeably higher when compared to the regulation-restricted scenario's portfolio. This may be due to the fact that the constrained portfolios need to be properly diversified, as a minimum of sixteen assets need to be managed, while in a nonrestrained alternative there's no need to diversify, and therefore a higher risk may be achieved.
Finally, we see the same trend in the Sharpe ratio data as in the end value results in terms of overall portfolio performance. For the first sample we studied, the constrained portfolios achieve a Sharpe ratio between 0.9 and 1.75, whereas, in the following periods, this number drops to a region between 0.75 and 1.5, and again experiencing the highest drop-off in the 2007-2012 sample, where no portfolio was able to achieve a Sharpe ratio value higher than 1. Finally, for the 2009-2014 period we find a huge increase in the performance, which is slightly decreased in the final timelapse.
Lastly, we present the Sharpe ratio difference between the two scenarios for each time-lapse in Fig. 3 using histograms for this task. These show the performance difference in the X-axis, between the unconstrained and the constrained scenarios. Therefore, any column located to the left side of zero equals a region of portfolios with better results when the constraints are applied.
As is displayed in Fig. 3, all of the histograms show that the majority of results are located on the left-hand side of zero on the X-axis. The peak with the highest amount of portfolios is mostly achieved at a Sharpe ratio difference between 0.15 and 0.20 in favor of the restricted portfolios, with the exception of the 1995-2000 and 2007-2012 samples, as in the first one the difference scales up to a value near 0.4, and in the later period, the number is decreased.
Another important thing to mention is the low concentration of the data where the unconstrained scenario performed better than the constrained alternative. It is observed from all the graphs that the right-hand side columns are very low, and the amount of data they display does not achieve numbers higher than 30 observations in one column.
Overall, the results from the 5-year lapses are very promising. We provided results that display better performance with the usage of a set of constraints from the Spanish investment funds regulation, and this increase in performance is also consistent for all the years we have studied, as not only do we get more valuable portfolios, but they also have a better risk-return relationship.
Ten-year intervals. As happened with the 5-year time series, we show the 10-year interval data with the same graphs, providing the results from multiple samples, containing the following periods: 1995-2005, 2002-2012, and 2009-2020. As it happened with the 5-year intervals, we start the comparison with the end value measurement for both scenarios. Again, the restricted portfolios' results are located on the X-axis, while the unconstrained alternative is displayed on the Y-axis, meaning that any point under the orange line is a portfolio that performed better in terms of value when the constraints are used (Fig. 4).
Again, we find that a greater amount of data is located under the frontier line, providing evidence that the constrained sets obtain a higher value in dollars than their non-restricted counterparts. And again we find that the data where the unconstrained portfolios got more value are scattered across the graphs.
It should be mentioned that there is a higher number of nonconstrained portfolios with higher values than the unconstrained sets in these simulations when compared to the data from the 5-year intervals. Even so, those points above the orange line are usually close to the frontier, meaning that the difference between both scenarios for a given set may not be high, especially in the 2009-2020 sample. Finally, the same trend as in the 5-year intervals can be observed, where the value drops off massively for the sample that contains the years up to 2012, as the highest constrained value decreases from 16 dollars to six, and then again experiences an increase to the original results in the latter years.
The Sharpe ratio results from Fig. 5 offer some mixed data for the 10-year intervals, although they still favor the constrained scenario in all periods. The format is again the same as the one used for the end value, and also the data in the 5-year intervals.
If we observe Fig. 5a, we find that almost all of the points from this chart are located under the orange line, providing thus the best results from the sample. The only dots that can be easily observed above the frontier are those where the constrained portfolios' ratio was extremely low, and the other few portfolios where the unconstrained case was better to have almost no difference when compared to the restricted alternative, whereas the constrained portfolios are scattered between a Sharpe ratio value of 0.6-1.2, displaying a noticeable difference in their results when compared to the unrestrained sets.
The two other charts also provide positive results, as it can be seen that more points are located under the orange line, although it should be mentioned that the latest sample, regarding the 2009-2020 period displays the worst results. This is the only simulated data where the number of unconstrained sets with a higher Sharpe ratio was closer to the number of points where the opposite happens. Even so, the performance difference tends to be low, and as we will see in the histogram, a larger portion of the points is located on the left-hand side of zero on the X-axis.
This time we do not find the exact same trend in the Sharpe ratio as with the end value or the 5-year samples. As we see from the different figures, the Sharpe ratio drops off with every sample we study, as in the first chart the constrained portfolios could achieve values above 1.2, while in the 2002-2012 and 2009-2020 samples, their best results would be above 1, and 0.8, respectively.
Finally, the Sharpe ratio histograms are presented. As it happened with the 5-year intervals, the X-axis provides the performance difference between the unrestricted and constrained portfolios, meaning that any point to the left-hand side of zero in the mentioned axis would mean that a portfolio obtained better results when the restrictions complied.
The first histogram from Fig. 6 offers no doubt about the results, as almost all of the points are located to the left side of zero, and the points on the right side are minimal (in fact, there are only eleven portfolios with a higher Sharpe ratio performance, while the peak of this graph is built by five columns with 60 portfolios each), and the difference in the performance is quite substantial, peaking at a value next to 0.25, while a big portion of portfolios could achieve a difference of 0.4, favoring the constrained scenario.
The 2002-2012 histogram offers similar results to an extent, although the performance difference is lower, as the peak is located between 0 and −0.2, formed by five columns. Despite that, it is easily seen that most of the points are located on the left-hand side of zero. We observe this time that a column with more than 40 observations is located just to the right side of zero, meaning that more data is favorable to the non-restricted portfolios when compared to the previous histogram, but the difference is still very low. Finally, the third histogram shows again the same pattern as the Sharpe ratio graph from Fig. 5c, as the largest amount of points that benefit the unconstrained scenario can be observed. This time, the performance difference peak is lower, and in fact, some columns are located to the right side of zero, but the highest ones are inside the left side region. This is the only time-lapse that may offer doubts about the constrained portfolios' performance when compared to a non-restricted scenario, and thus, these results should be studied further, although some causes of this data could be that this period corresponds to a long bull market, where some particular stocks had a huge performance, and hence it was better to hold those stocks without rebalancing their weight.
In summary, we can say that the constrained portfolios perform better than the unconstrained ones. In fact, in Table 2 it can be seen that the total return of the constrained portfolios is better than the unconstrained ones in a great percentage of the cases and the same is true for the Sharpe ratio, as shown in Table 3.

Conclusions and future research lines
This paper provides evidence that the existence of regulatory constraints improves the long-term performance of investment funds in Spain. We test if the basic restrictions set by default for these entities contribute to obtaining more efficient portfolios, or if they provide worse results. The reasoning behind choosing this regulation is the low performance that investment funds in Spain reached in the latest years.
To do this, two different scenarios were simulated in time series of 5 and 10 years, for a horizon of 25 years (from 1995 to 2020): one where there is strict control over the portfolios, in order to ensure that the regulation limits are respected; while the other one implies no restrictions and the portfolio can hold assets with a weight over the specified thresholds.
The results obtained are very promising. Firstly, the 5-year data displays that the constraints from the Spanish investment funds regulation create portfolios with higher returns and a better value of the Sharpe ratio than a non-restricted buy-and-hold strategy in a large portion of the data we simulated. This is consistent for all six tested periods over a 5-year time-lapse, and also within the global financial crisis between 2007 and 2008 (although worse end values and Sharpe ratios can be found, the overall results are far superior if we create portfolios according to the regulation's constraints).
For the 10-year samples, we find a similar pattern, as the restricted portfolios tend to be better from a performance standpoint. It should be noticed though, that for the first of these 10-year simulations, the Sharpe ratio results are even better than the ones from the 5-year data, where almost 99 percent of the data is favorable for the constrained scenario.
There is only one sample from all the simulations where the constraints do not fare as well as in the other data, corresponding to the 2009-2020 period. And even then, we find that the results are positive, as there are more constrained portfolios that operate better than their non-limited counterpart than unrestricted sets that fare better than the restricted ones, although this outcome should be studied to see what caused the change in the trend (as an example, that the period corresponds with a long bull market).
It should be mentioned as well that in some cases, the Sharpe ratio difference between the two scenarios can be large, going up to values in favor of the regulation-based portfolios of 0.6, or 0.8 depending on the sample. This means that, while the restricted sets get a value that could be considered to be good, the non-restricted ones may have a poor Sharpe ratio, meaning that they tend to be more volatile given the level of returns for both scenarios.
Another aspect to be mentioned is that the 10-year samples show lower Sharpe ratios than the 5-year data, which could be due to uncertainty, and the effect of risk over a large time frame. Finally, the data provided also displays that even if the unconstrained portfolio had better log returns than the restricted one, its Sharpe ratio tends to be lower than the constrained portfolio. This shows the effect of diversification in portfolio selection, as the risk is greatly reduced when comparing two scenarios that imply or not this technique.   Our results provide new evidence that the low performance of the Spanish investment funds is not due to the regulatory constraints, so it can be due to the different management fees and other costs as other previous works found (Fama and French, 2008;Fernandez et al., 2021).
Based on our simulations, an individual investor could use the constraints from the regulation to apply limits over his own portfolio, and thus get better results, since it is displayed that the regulatory framework has a positive impact on portfolio selection. The legislation-based restrictions could be proposed as a strategy to follow when we manage a set of assets, in order to ensure higher efficiency, since the risk on this kind of portfolio tends to be lower than the volatility from non-constrained sets due to the impact of diversification while holding a similar or even higher value. The limits regarding different regions' regulations should create efficient portfolios as well, and it would be interesting to see which set of laws fits better within the portfolio selection topic.
The main limitation of this research work is that only stocks from the S&P500 index have been used, since these stocks are the more liquid for funds to invest, especially for greater funds, which cannot invest in smaller companies due to liquidity problems, so the work on this paper can be further extended to those companies. First, we could test the same regulation over its own region, or on a larger scale, in Europe as the constraints are applied as well as in the whole European Community. The data could be expanded to other regions such as the Asia Pacific or Japan, and other regulations, such as US' Investment Company Act, and compare how it performs, compared to other regulations. Furthermore, we could change the thresholds on these regulations, in order to create more or less diversified portfolios, and test the performance difference when the regulations are modified.

Data availability
The datasets generated during and/or analyzed during the current study are available from the corresponding author on reasonable request.