Author
-
Dr. Caroline LoebhardFounder, Goldmarie Finanzen GmbH -
Dr. Jennifer RaschFounder, Goldmarie Finanzen GmbH
In our article Sustainable Portfolio Selection -- Markowitz goes ESG we describe the importance of ecological, social and governance (ESG) aspects of financial services and give a first approach, how ESG measures can be included into portfolio selection strategies. Basically, ESG-ratings of financial instruments, like for instance LSEG's ESG Scores, can be mathematically treated similar to mean historical returns. As a result, one can balance estimates for risk and/or return with ESG-ratings and compute portfolios of financial instruments with high average ESG Score as well as good risk measures.
In this follow-up article we adhere to the fact that high ESG-ratings can have a different impact in different industrial sectors or countries. We will show, how impact data can be integrated into portfolio selection models with ESG-awareness.
Overview
In this tutorial you will learn to get business sector information from LSEG and to plot the sector distribution of a weighted portfolio, how to balance volatility as a risk measure with portfolio returns and ESG-measures in portfolio selection, and learn about the basics of impact modeling, and how sector impact information can be included into portfolio selection.
We build on the steps in Sustainable Portfolio Selection -- Markowitz goes ESG, where basically a classical Markowitz model is employed, but returns are replaced by ESG-ratings. This tutorial is structured as follows:
- Step 1 Get data via Data Library, prepare the basic data structures.
- Step 2 Build the minimum volatility portfolio (MVP) and analyze its business sector distribution.
- Step 3 Build a portfolio, where volatility is balanced with return and also the ESG-score.
- Step 4 Build a model for impact-ESG and utilize it to select a portfolio, where volatility is balanced with return and the impact-ESG-score.
Technical prerequisites
- LSEG Workspace with access to the Data Library (Free Trial Available) or The Data Platform API
- Python 3.x
- Required Python Packages: lseg.data, pandas 0.17.0 or higher, numpy, , random, scipy, matplotlib
Data acquisition and universe selection
Our portfolio will be built from a universe (or a pre-selection) of shares. We will work based on the ETF iShares Core MSCI World UCITS ETF USD which refers to the MSCI World index. In difference to our earlier article, we enforce a lower bound on the ESG rating of financial instruments in the portfolio universe just from the beginning.
Reading the universe from the Data Platform
We use LSEG Data Library to get the constituents of the index. For simplicity we will reduce the list of entries here to 350. Besides the instrument identifer RIC, we load company names, their TR ESG Scores as well as the NACE Classification data which refers to the "Statistical Classification of Economic Activities in the European Community". Lateron, this data will be used to constitute an sector-related ESG impact.
Constructing industrial sector information
There exist different classification systems mapping the economic activities of a company to a business sector. LSEG offers a bunch of these business sector information. One can, amongst others, download the sector with respect to the North American Industry Classification System (NAICS), the The Business Classification (TRBC), or -- as it is done here -- the NACE. The data item TR.NACEClassification is composed as follows,
BUSINESS SECTOR DESCRIPTION (NACE) (XX.YY)
We will utilize the business division encoded in XX and thus extract the string positions [-6:-4]. This data is included to the instruments' pandas dataframe.
Selected 113 out of 350 instruments by filtering ESG Score >= 70
| ric |
name | esg | Business Description | nace | nace_code |
|---|---|---|---|---|---|
| FITB.OQ | Fifth Third Bancorp | 74.45776 | Fifth Third Bancorp is a bank holding company.... | Other monetary intermediation (NACE) (64.19) | 64 |
| HOLX.OQ | Hologic Inc | 77.681436 | Hologic, Inc. is a developer, manufacturer and... | Manufacture of irradiation, electromedical and... | 26 |
| 8630.T | Sompo Holdings Inc | 77.448841 | Sompo Holdings, Inc. is a Japan-based company ... | Non-life insurance (NACE) (65.12) | 65 |
| BAMa.TO | Brookfield Asset Management Inc | 77.97256 | Brookfield Asset Management Inc. is an alterna... | Renting and operating of own or leased real es... | 68 |
| BCE.TO | BCE Inc | 71.008589 | BCE Inc. is a Canada-based communications comp... | Wired telecommunications activities (NACE) (61... | 61 |
| ... | ... | ... | ... | ... | ... |
| LUMI.TA | Bank Leumi Le Israel BM | 76.909491 | Bank Leumi Le Israel BM (the Bank) is an Israe... | Other monetary intermediation (NACE) (64.19) | 64 |
| LOW.N | Lowe's Companies Inc | 85.596615 | Lowe's Companies, Inc. (Lowe's) is a home impr... | Retail sale of hardware, paints and glass in s... | 47 |
| 3382.T | Seven & i Holdings Co Ltd | 86.572966 | Seven & i Holdings Co Ltd is a Japan-based com... | Retail sale in non-specialised stores with foo... | 47 |
| VWS.CO | Vestas Wind Systems A/S | 77.767678 | Vestas Wind Systems A/S is a Denmark-based com... | Manufacture of engines and turbines, except ai... | 28 |
| JNJ.N | Johnson & Johnson | 89.605162 | Johnson & Johnson is a holding company, which ... | Manufacture of pharmaceutical preparations (NA... | 21 |
Loading timeseries data from the data library
| Date | FITB.OQ | HOLX.OQ | 8630.T | BAMa.TO | BCE.TO | WBA.OQ | FTS.TO | HNKG_p.DE | RAND.AS | CONG.DE | ... | CRDA.L | EMR.N | MAP.MC | CATL.SI^I21 | 7974.T | LUMI.TA | LOW.N | 3382.T | VWS.CO | JNJ.N |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2020-01-07 | 29.85 | 52.49 | 4280.0 | 49.729029 | 60.48 | 59.29 | 54.13 | 91.58 | 54.86 | 102.944218 | ... | 5090 | 77.24 | 2.4 | 2.92704 | 42940 | 2491 | 119.63 | 3969 | 127.92 | 144.98 |
| 2020-01-08 | 29.92 | 52.29 | 4188.0 | 49.934193 | 60.64 | 55.83 | 54.34 | 91.74 | 55.32 | 104.929418 | ... | 5090 | 77.51 | 2.4 | 2.934662 | 42640 | 2484 | 121.53 | 3942 | 129.08 | 144.96 |
| 2020-01-09 | 30.25 | 53.275 | 4228.0 | 50.377611 | 60.29 | 54.68 | 54.42 | 93.04 | 55.9 | 107.415388 | ... | 5035 | 77.8 | 2.413 | 2.92704 | 43380 | 2483 | 122.05 | 4022 | 128.32 | 145.39 |
| 2020-01-14 | 29.74 | 53.53 | 4213.0 | 51.972594 | 60.89 | 54.62 | 54.92 | 93.12 | 55.58 | 105.179803 | ... | 5145 | 76.87 | 2.419 | 3.003265 | 43200 | 2472 | 120.07 | 4285 | 126.52 | 146.52 |
| 2020-01-15 | 29.03 | 53.75 | 4215.0 | 52.435866 | 61.11 | 54.43 | 55.24 | 93.18 | 55.42 | 104.839994 | ... | 5030 | 76.66 | 2.384 | 2.980398 | 43070 | 2446 | 119.52 | 4249 | 129.48 | 147.01 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2020-12-21 | 27.165 | 75.23 | 4038.0 | 50.609222 | 54.75 | 40.67 | 52.08 | 89.2 | 53.52 | 104.580666 | ... | 6354 | 80.57 | 1.599 | 2.492557 | 65250 | 1816 | 164.33 | 3528 | 270.0 | 153.02 |
| 2020-12-22 | 26.93 | 74.67 | 4034.0 | 50.738277 | 54.6 | 39.27 | 52.18 | 90.14 | 53.76 | 105.877306 | ... | 6422 | 79.33 | 1.63 | 2.4392 | 64400 | 1827 | 164.61 | 3503 | 280.6 | 152.72 |
| 2020-12-23 | 27.73 | 75.06 | 4068.0 | 51.433186 | 54.66 | 39.87 | 52.24 | 90.48 | 54.32 | 108.783566 | ... | 6416 | 80.02 | 1.632 | 2.462067 | 64480 | 1841 | 162.43 | 3509 | 278.2 | 151.94 |
| 2020-12-29 | 27.28 | 71.74 | 4186.0 | 52.495404 | 54.69 | 39.41 | 52.54 | 92.46 | 54.64 | 109.767224 | ... | 6594 | 79.24 | 1.614 | 2.507802 | 65860 | 1900 | 160.54 | 3710 | 291.8 | 154.14 |
| 2020-12-30 | 27.28 | 71.75 | 4173.0 | 52.336567 | 54.6 | 39.34 | 52.38 | 92.3 | 54.14 | 108.425872 | ... | 6536 | 79.82 | 1.608 | 2.50018 | 65830 | 1904 | 160.56 | 3659 | 287.9 | 156.05 |
Minimum Volatility Portfolio (MVP) on the ESG-constrained universe
We compute the classical MVP in the same way as in our previous article -- please consult that tutorial for details. Given the pre-filter on the constituents' ESG Score, the MVP satisfies a lower bound
ESG(MVP)≥70
MVP in a universe with 113 instruments
Number of selected instruments: 45
Minimum weight: 7.503984557423134e-21
Maximum weight: 0.06185783693486125
Historical risk measure: 0.00015195017397695131
Historical return p.a.: 0.11247632176102468
ESG score: 78.49331458983875
You may use the the code in the previous article to get further insights into the structure of the resulting MVP. We now go further and plot the distribution of the investment on the NACE divisions:
Pie chart of the business sectors distribution of the MVP
Given the weight (portion) of each instrument within the (ESG-constrained) portfolio, the portion of the investment within each business sector is accumulated by the function calcWeightsForPieChart(df). Then, a pie chart illustrates, how the money is allotted to business sectors.
The minimum volatility portfolio is nicely diversified and covers a large number of business sectors. Note that using e.g. address or currency data from LSEG, you can also plot the distribution over countries or currencies.
Balancing volatility with historical return and ESG-score
In addition to a small risk, previously estimated by a small historical volatility, one may aim for a high return and high ESG ratings in addition to the lower bound of 70 that was imposed on the optimization universe. The following code minimizes historical volatility and in addition, minimizes - 0.0002 * historical return and - 0.00002* ESG-rating of a portfolio. There is thus a trade-of between a higher return or higher ESG Score with low volatility. The factors 0.0002 and 0.00002 mirror the importance of each of the criteria. With a higher factor, e.g. with the return term, the portfolio is selected focusing more on the return, and less on the the other measures.
Solution to balanced volatility, return, ESG problem in a universe with 113 instruments
Number of selected instruments: 28
Minimum weight: 3.3825682612790066e-20
Maximum weight: 0.10165960999890983
Historical risk measure: 0.00018671090425783444
Historical return p.a.: 0.17080291589692786
ESG score: 85.61815983112916
We gain some insight into the business sector diversification from the according pie chart: Notice, that we now have a trade-of between volatility and returns as well as ESG-scores. Since the latter terms do not diversify, but rather select high weights for companies with high return and/or ESG-score, the current portfolio is less distributed over the business sectors than the MVP from before.
An approach to impact modeling
The idea behind impact investment is to invest specifically in companies that have a positive impact on social or environmental goals. Depending on the location or on the sector of economic activities, a high ESG Score can have a different impact -- for instance, a company that cares for clean drinking water has more impact in countries where clean water is actually an issue. Or using only renewable energies has much more impact in energy intense business sectors. We leave an evaluation of this kind of impact to experts in the field, and show here, how impact expertise can be included into our portfolio selection model.
Organization of impact information
We assume that wise people provide a score between 0 and 10 for each of the sectors covered by our universe. The score 0 means that an ESG-Rating exceeding the lower bound of 70 has no impact in this sector, whereas the score 10 implies a high impact of extra ESG points. To keep our example simple and illustrative, we just select one sector (construction of buildings, no. 41) which has the impact 10, and assume that all others have the impact 0 (for whatever reason). This impact information is assumed to be given by experts in a dictionary nace_dict with 2 digit NACE codes as keys and the respective impact score as values. You may use the commented line with random numbers for a more realistic setting of nace_dict. The impact scores are included into the instruments dataframe in the last line of the following code block.
Computation of the impact-ESG score of a portfolio
The impact-ESG score of a company now combines the ESG-Score with the sector impact score as follows:
𝑖𝑚𝑝𝑎𝑐𝑡𝐸𝑆𝐺=𝑖𝑚𝑝𝑎𝑐𝑡⋅(𝐸𝑆𝐺−𝑒𝑠𝑔𝐵𝑜𝑢𝑛𝑑)impactESG=impact⋅(ESG−esgBound)
This formula is applied to each company in a dataframe of all companies in the optimization universe in the following line,
and we compute some impact-ESG-scores of weighted portfolios in a scalar product as follows,
ESG of MVP: 78.49331458983875
Impact-ESG of MVP: 2.87839973147472
ESG of balanced: 85.61815983112916
Impact-ESG of balanced: 3.0997556428568394
Remember that the ESG-aware portfolio has a higher ESG-score than the basic MVP. But nevertheless, the impact-ESG score (which, in our example, sais that ESG-ratings higher than 70 make sense only for companies constructing buildings) is even decreased compared to the MVP.
Impact-ESG-aware portfolio selection
In order to build an impact-ESG-aware portfolio, we exchange the simple ESG-term with the impact-ESG term in the minimization problem.
Solution to weighted impact ESG problem in a universe with 113 instruments
Number of selected instruments: 14
Minimum weight: 1.9572764759356897e-21
Maximum weight: 0.433838334307341
Historical risk measure: 0.00020403642361264564
Historical return p.a.: 0.10575171137227271
ESG score: 80.22443849877946
We compare the ESG- and impact-ESG-ratings of the three portfolios:
ESG of MVP: 78.49331458983875
Impact-ESG of MVP: 2.87839973147472
ESG of return and ESG balanced: 85.61815983112916
Impact-ESG of return and ESG balanced: 3.0997556428568394
ESG of return and impact-ESG balanced: 80.22443849877946
Impact-ESG of return and impact-ESG balanced: 56.944799960584405
In fact, the impact-ESG optimization was successful: The respective portfolio achieves a much higher impact-ESG-score than the competing portfolios.
We also plot the business sectors pie chart and of course, the impact-ESG-aware portfolio has a special focus on the construction of buildings:
Summary and outlook
We hope that we could show, how different aspects and criteria can be considered in a portfolio selection strategy. We have constructed 3 portfolios: All of them satisfy a lower bound on the ESG-score in every constituent. By using specific objective functions in the minimization problem, we could steer the distribution of the investment to have low volatility in the first one, and a trade-of between low volatility but also high returns and high ESG-scores in the second one. For the third portfolio, we showed a model for impact-ESG scores and included it into the optimization goal.
This tutorial aims to show some key techniques and thus scratches only the surface of ESG- and risk-aware portfolio selection. One can refine the models in many aspects, and one could go for more details in the analysis of the results. We refer to the literature and to the large pool of LSEG tutorials in the developers' community.
For more information about the authors, check out https://goldmarie-finanzen.de!
Further Resources for the Data Library can be found in its page in the developer portal.
For Content Navigation of the Data Library - please use the Data Item Browser Application: Type 'DIB' into Workspace Search Bar.