Playback starts YouTube’s embedded player (privacy-enhanced mode).
R tutorial: The Portfolio Weights
ChannelDataCampDescription from the creator
Want to learn more? Take the full course at learn.datacamp.com/courses/introduction-to-port… at your own pace. More than a video, you'll learn hands-on coding & quickly apply skills to your daily work.
---
In the previous example, I intentionally chose two companies selling a similar product. Still, the analysis showed that the value of the stocks can diverge over time.
So how to decide between those two companies? Flip a coin?
No! In most cases, the rational decision is not to invest in either one or the other, but to reduce our risk by holding a portfolio that is invested in both of them. This is called diversifying your risks.
So how good is your portfolio diversification? To answer this question you need to investigate how the portfolio investments are spread across the different assets. This is done by computing the portfolio weight of each asset. This means that we compute the ratio between the value of one investment, relative to the total value of all the investments in the portfolio.
Suppose, for example, that there are N different investments, each with their own value Vi. Then the weight of investment I equals Vi divided by the sum of the value of all the investments in the portfolio.
The corresponding R code is simple. Suppose that values are the vector holding the values invested in the different assets. Then the corresponding weight vector is simply that vector of values, divided by its sum. Of course, this vector sums to unity.
In Chapter 4 we will see how to optimize the choice of portfolio weights. In the meantime, it is important to know that several approaches exist to set the portfolio weights.
A first approach is to concentrate the investment bet in one risky asset. This approach is speculative and very likely to be inefficient.
When all assets are similar in terms of risk and reward, a better approach is to aim for perfect diversification and to invest the same amount in each risky asset. This the so-called equal weighting approach.
Another popular approach is to set weights proportional to the market value of the asset. It implies overweighting stocks of big firms and underweighting stocks of small firms.
These are only a few examples of the large number of possible approaches to define portfolio weights.
For us, the important conclusion to remember is that, to avoid extreme losses, it is definitely not a good idea to put all your eggs in one basket.
#DataCamp #RTutorial #PortfolioAnalysisinR
---
In the previous example, I intentionally chose two companies selling a similar product. Still, the analysis showed that the value of the stocks can diverge over time.
So how to decide between those two companies? Flip a coin?
No! In most cases, the rational decision is not to invest in either one or the other, but to reduce our risk by holding a portfolio that is invested in both of them. This is called diversifying your risks.
So how good is your portfolio diversification? To answer this question you need to investigate how the portfolio investments are spread across the different assets. This is done by computing the portfolio weight of each asset. This means that we compute the ratio between the value of one investment, relative to the total value of all the investments in the portfolio.
Suppose, for example, that there are N different investments, each with their own value Vi. Then the weight of investment I equals Vi divided by the sum of the value of all the investments in the portfolio.
The corresponding R code is simple. Suppose that values are the vector holding the values invested in the different assets. Then the corresponding weight vector is simply that vector of values, divided by its sum. Of course, this vector sums to unity.
In Chapter 4 we will see how to optimize the choice of portfolio weights. In the meantime, it is important to know that several approaches exist to set the portfolio weights.
A first approach is to concentrate the investment bet in one risky asset. This approach is speculative and very likely to be inefficient.
When all assets are similar in terms of risk and reward, a better approach is to aim for perfect diversification and to invest the same amount in each risky asset. This the so-called equal weighting approach.
Another popular approach is to set weights proportional to the market value of the asset. It implies overweighting stocks of big firms and underweighting stocks of small firms.
These are only a few examples of the large number of possible approaches to define portfolio weights.
For us, the important conclusion to remember is that, to avoid extreme losses, it is definitely not a good idea to put all your eggs in one basket.
#DataCamp #RTutorial #PortfolioAnalysisinR
About this tutorial
DataCamp published this 2:53 video tutorial on November 13, 2016. It has been watched 11,270 times on YouTube.
Tags
Share
This tutorial in other languages
- FRtutoriel R: Les coefficients de pondération du portefeuille
- ESR tutorial: Pesos de la Cartera
- PTR tutorial: Pesos da carteira
- ITR tutorial: Pesi Il Portfolio
- DER Tutorial: Das Portfolio Gewicht
- NLR Tutorial: The Portfolio Gewichten
- RUR обучающий: Портфель Масса
- PLporadnik R: Masy ZESTAWIENIU
- JARチュートリアル:ポートフォリオの重み
- ARR التعليمي: الأوزان حافظة
- HIआर ट्यूटोरियल: THE पोर्टफोलियो बाट
- IDR tutorial: Portofolio Berat