Update!! 1 July 2023, All functions are already now.
Update!! 27 June 2023, Yahoo Finance has modified the API., A new version of tool is curently being prepared. At present Beta 0.1.0 of Divfolio will still work, but the ESG feature will be unavailible until next release of Beta 0.1.1 of Divfolio. Release date 1 July 2023
Update!! 7 May 2023, we updated a new version Beta 0.1.0 of Divfolio to reflect the change of Yahoo Finance API. All functions unchanged from the previous version
- Divfolio
- How to Access Divfolio
- Original Research Papers related to Divfolio
- Where to find the ticker?
- Workflow
- Functions in Divolio
- Examples 1: Generate Portfolio on Application using Online Data
- Examples 2: Uploading CSV files
- Examples 3: Using Multiple Comparison in Option I to Option III
The primary objective of the software is to facilitate the creation and evaluation of portfolios that take into account decarbonization and ESG investing and divestment practices in line with climate change prevention trends emerging in wealth management. The software enables the creation of divestment plans and sustainable portfolios, as well as the comparison of the corresponding risk/return profiles, ESG scores, and bespoke portfolio variables, such as carbon intensity. The evaluation is based on simulations that collect and include pertinent historical market data before and after divestment, while also taking into account varying divestment planning rates. The software permits the user to implement these evaluations on publicly traded equities assets, exchange-traded funds (ETFs), exchange-traded notes (ETNs), and Depositary Receipts (DR). Alternatively, Divfolio can be used for general proposes, such as portfolio comparison, gathering ESG scores, and downloading historical return data.
On the tab on the left, the User Guide provides detailed instructions on how to use this application. The application's functions are documented in Divestment Plan . Our contact information can be found in Our Team . We welcome the opportunity to collaborate with scholars and industry professionals interested in relevant issues and comparable Shiny applications. To report technical problem, please contact Pasin MarupanthoCancel changesrn at pm122@hw.ac.uk.
we offer three options to access the application.
The simplest way, just click on the link below
https://quantfilab.shinyapps.io/divfolioserveri/
This option is suited for R users who already have R and RStudio on the local machine. How fast the calcualtion process depended on your local machine speed. You can run Divfolio by the following command lines.
library(shiny)
shiny::runGitHub('QuantFILab/Divfolio')
We recommend R version 4.2.2 or later. The older R version may cause an error on the package dependency. The version of all packages included in application are list in the table below.
Package | Version |
---|---|
BatchGetSymbols | 2.6.4 |
cluster | 2.1.4 |
dashboardthemes | 1.1.6 |
DT | 0.26 |
huge | 1.3.5 |
jsonlite | 1.8.4 |
lubridate | 1.9.0 |
magic | 1.6.1 |
PerformanceAnalytics | 2.0.4 |
plotly | 4.10.1 |
qgraph | 1.9.3 |
quantmod | 0.4.20 |
reshape2 | 1.4.4 |
robustbase | 0.95.0 |
rvest | 1.0.3 |
shiny | 1.7.4 |
shinyBS | 0.61.1 |
shinycustomloader | 0.9.0 |
shinydashboard | 0.7.2 |
shinydashboardPlus | 2.0.3 |
shinyFeedback | 0.4.0 |
shinyjqui | 0.4.1 |
shinypop | 0.1.1 |
shinyWidgets | 0.7.5 |
tidyverse | 1.3.2 |
tmap | 3.3.3 |
viridis | 0.6.2 |
waiter | 0.2.5 |
We offer the electron-executable package on Github that you can be downloaded in the folder name Executable_Package. The size of the package is large 1.2 GB as it contains the R portable. You do not need to install R and RStudio on your local machine. Just download the whole folder and double-click on Divfolio.exe to run the application locally. It may take time for setting up when you run it the first time. Sometimes you need to close the window and reopen it again.
Divfolio is baed on the research results from two papers. Preprint versions of both papers are open access available on SSRN. First, the methodology paper explains all mathematical details in portfolio optimization, Mechanisms to Incentivise Fossil Fuel Divestment and Implications on Portfolio Risk and Returns. Secondly, the software paper explains how to use Divolio aloge with an example in FTSE100 divestment to improve ESG scores, DivFolio: A Shiny Application for Portfolio Divestment in Green Finance Wealth Management.
If you are interested in downloading historical data from Divfolio, you will need the Yahoo! Finance ticker. You may find the tickers here. Note that the ESG scores are available for certain stocks. The ESG scores are not available for others assets, but the historical data may be available.
DivFolio App tool comprises two core components as will be detailed in the panels below. The first component involves a set of sequential STEPs that users undertake consisting of STEP 1 through STEP 5, which must be performed sequentially. The second component involves a collection of three independent optional STEPs that can be performed individually. For the optional steps, so long as the user has the relevant data prepared in CSV format already, for instance as output from STEPS 1 to 5 in Component 1, then they can upload this directly into any of the STEPS in Component 2 instead of generating them again from the tool. For more details please see the user guide on the application.
STEP 1: Accessing the ESG scores and some profiles of the individual company.
STEP 2: Downloading ESG scores of the selected companies, and exporting to the local machine in CSV and png.
STEP 3: Downloading historical returns of the selected companies, comparing the performances, and exporting to the local machine in CSV and png.
STEP 4: Generating portfolio from the selected companies, rebalancing portfolio, summarising the performances, and exporting to the local machine in CSV and png.
STEP 5: Generating divestment schedule, divesting portfolio, rebalancing portfolio, summarising and comparing the performances, and exporting to the local machine in CSV and png.
Option I: For comparing more than two portfolios, generating divestment schedule, divesting portfolio, rebalancing portfolio, summarising and comparing the performances, and exporting to the local machine in CSV and png.
Option II: Clustering portfolio according to their risk profile, and exporting to local machine png.
Option III: Providing graph LASSO to portfolios over time to investigate covariance between assets during divestment, and exporting to local machine png.
You don't have to run all steps. For example, if you want only ESG scores, you can stop at STEP 2.
Let's set up the portfolio by divesting from big energy companies to the best ESG scoring companies in
Yahoo! Finance. We will invest in BAC, CRM, GOOGL, INTC, and MSFT which have a good environment score. Then, we divest from COP, CVM, and XOM which have a poor environmental scores.
To see the ESG score and past performance of the company (If you already have companies in mind, you can script this)
- Chick to the Gear icon to open the input window
- Type company's ticker in the box
- Click on the "submit" button
The results are shown below.
To pick company stocks to a portfolio (Required)
- Click on the Cart icon to open the input window.
- Type the company's ticker.
- Chick the "add" button.
You need to add them one by one the ticker. Here, input BAC, CRM, GOOGL, INTC, MSFT, COP, CVM, and XOM. The result will be shown in STEP 2.
The tickers selected in STEP1 will appear in the box of "Potential Assets". We need to assign a divestment status to each asset by dragging and dropping them into the box of "Investable Assets" and "Divestable Assets" like in the figure below.
To get the ESG data and Company's sector
- Drop tickers you want to invest in "Investable Assets" (If you want only ESG data, you can drop all assets to this box).
- Drop tickers you want to divest in "Divestable Assets".
- Click on the "summary" button and Click on "update summary" when you make a change to the divestment status or add more assets to the potential list.
The results are in the figure below. You can download the table to your local machine. The last table shows the percentage of the improvement in ESG score after divestment. The smaller score indicates lower ESG risk.
To get the historical data of the assets passed from STEP2
- Click on the Carlendar icon
- Input start date
- Input end date
- Click the "submit" button
You will get a table of the historical return calculated from the close price and the boxplots of the return that can be arranged by the company's historical risk profiles such as volatility and Sharpe ratio.
To generate portfolio weights
- Click on the List icon
- Select the type of portfolio (Here we use GMV with leverage 1.3)
- Switch on the option to limit the short position
- Select the number of days each time rebalancing (Here we rebalance the portfolio monthly)
- Select the window of covariance history (Usually equal to the number of days each time rebalancing)
- Click on the "submit" button
Te results will shown the ESG score and risk profiles of portfolio as in the figure below.
To generate a divestment schedule and divested portfolio
- Click on the Minus icon.
- Select the divestment schedule (Here, we use linear (gradually) divestment).
- Set the last date of divestment when the divestable assets will be divested completely.
- Set the divestment schedule parameter
- Click on the "preview" button to preview the divestment schedule
- If you like the current schedule click "submit" to process
The results show a comparison of the original portfolio in STEP4 and the divested portfolio in STEP5
Looking at the last boxplots, they tell us that with this divestment schedule, the return dropped significantly whereas the environmental score improved a little. Therefore, this divestment strategy may not suit profit seekers. You can try a different types of portfolios or divestment schedules for comparison.
For STEP 2 to STEP 5, if you already have CSV files in the given form (see in application and examples in Example Files for Github), you can upload those files without retrieving data online by Clicking on the "Check" icon and upload a file like in the figure below. the files need to be uploaded sequentially. For example, F2 can not be uploaded unless F1 was updated. For matching of files and STEPs please look at the diagram in Workflow.
These options required CSV files, see example in Example Files for Github. Here, we use a small portfolio in which the constituents selected from FTSE100 as an example. Here, we investigate the impact of the divestment schedule on the rsik profiles and stability of them. the comparison consists of the benmark portfolio (Passive Equal Weight), the linear (slow) divestment, the hyberbolic (Fast) divestment and the instant divestment.
First, upload the required files F5, F1, and F2 and click on "submit".
The results are the comparison of the ESG scores and risk profiles of the input portfolios.
Looking at the last panel in boxplots, the instant divestment yielded the most improvement (distribution) of the environmental score but it costs by dropping in return and other ESG scores both social and governance. If you mind the return and other scores rather than the E score, you shouldn't select this strategy. In contrast, if you mind the E score the hyperbolic divestment seems to be suited for you. The best divestment strategy depended on you final goal.
- Chick on "chick" icon
- Upload the required files, F5
- Upload the required files, F2
- Set the window of the smoothing risk profiles (Here we set 20 days)
- Set the window of clustering (Here we set 20 days)
- Click on "submit".
The results are the smoothed rsik profiles and the clustering results.
Looking at the last plots of the heatmap, you will see the different colors on the time series of the cluster label of the divested portfolio and the benchmarks. That indicates the divestment changes the relative behavior of that risk profile. The linear divestment seems to be the best tracking on the benchmark as the labels of the clusters are quite similar to the benchmark while the other divested portfolio yields the series of diferent labels.
- Upload file F5.
- Upload file F6 as an option (can be replaced by F1).
- Upload file F2.
- Select the date of rebalancing you want to see the correlation structure.
- Click on "submit" to process. The process is time-consuming as an optimization of the regularization parameter. Please be patient.
The results are the robust correlation structure of the portfolio at the given time. We allow three cross-sectional graphs for comparison as the limit of visualization.
Here, the linear and hyperbolic divestments do not change the correlation structure of the portfolio in the early states. The correlation structure will be changed at the terminal states when some assets were divested completely.