WEBVTT

00:00.910 --> 00:05.770
Welcome back to part two and we have still imparted the cap data frame.

00:05.770 --> 00:06.580
So let's have a look.

00:07.180 --> 00:13.840
So these are the market capitalizations for our constituents over time and then evaluated index each

00:13.840 --> 00:19.450
constituent has a way to corresponding to its proportional market capitalization.

00:19.450 --> 00:23.580
So therefore we have to calculate for each single timestamp.

00:23.590 --> 00:31.030
The total market capitalization for the constituents or to say the sum so we can do this with the sum

00:31.030 --> 00:31.570
method.

00:31.600 --> 00:33.310
So nothing new here.

00:33.310 --> 00:38.350
So this is uh on each timestamp the sum of market caps.

00:38.390 --> 00:44.800
Now we can actually calculate the weights of the constituents for each single timestamp and we can do

00:44.800 --> 00:52.540
this by dividing our M cap data frame by the total sum here.

00:52.570 --> 00:59.340
So actually for each single timestamp we actually calculate the proportion for each of the constituents.

00:59.470 --> 01:08.250
And uh we pass the index to the access parameter so here we have for each and every timestamp.

01:08.310 --> 01:09.610
The rates.

01:09.640 --> 01:13.530
So the proportional weights as per our market capitalization.

01:13.840 --> 01:20.640
And we can also save uh the weights data frame and the variable weights evaluated index.

01:20.860 --> 01:26.080
And let's again have a look at the last five rows here and 2000 and 18.

01:26.110 --> 01:32.770
And also here it makes sense to visualize the evolution of weights over time and we can do this here

01:32.800 --> 01:41.600
with the plot method on our weights evaluated index data frame so these is the evolution of weights

01:42.230 --> 01:48.290
and we can see here that uh the weight of the Microsoft the stock in our value weighted index is quite

01:48.290 --> 01:49.790
stable over time.

01:49.910 --> 01:59.420
So from 27 percent to about 35 percent and we have a significantly increasing weight of the Amazon stock

01:59.420 --> 02:03.030
starting from uh below 20 percent total.

02:03.050 --> 02:06.890
Also 34 thought 35 percent.

02:06.890 --> 02:11.250
So these are the weights of the constituents and our value weighted index.

02:11.460 --> 02:17.360
And uh yeah we can see that our value weighted index is kind of concentrated in two positions.

02:17.360 --> 02:21.280
So in the Amazon stock and in the Microsoft stock.

02:21.380 --> 02:27.070
So we are pretty far away from having a very diversified index portfolio.

02:27.290 --> 02:33.660
And now when the next step let's calculate the daily returns of our stock prices and we can do this

02:33.700 --> 02:35.630
with the percentage change method.

02:35.630 --> 02:37.400
So nothing new here.

02:37.400 --> 02:40.150
So these are the daily returns.

02:40.310 --> 02:43.950
And in addition to the daily returns we have also the daily rates.

02:43.970 --> 02:46.470
So that's again have a look here.

02:51.050 --> 02:54.380
And that's actually one pitfall that we have to keep in mind.

02:54.500 --> 03:01.310
So we can see here in the returns data frame the very first return we have on the second of January

03:01.310 --> 03:03.230
2014.

03:03.230 --> 03:11.300
So the immediately preceding price we had on the thirty first of December 2000 and uh 13 then the first

03:11.300 --> 03:13.450
of January was a bank holiday.

03:13.910 --> 03:21.500
And then on the 2nd of January we have um uh these daily returns here and these daily returns are based

03:21.500 --> 03:24.760
on the last price on the thirty first of December.

03:24.890 --> 03:30.950
And therefore if you want to calculate the weighted average return on the 2nd of January we have to

03:30.950 --> 03:38.110
do this with the rates of the thirty first of December so the next step we want to calculate for each

03:38.110 --> 03:46.660
single time stamp the weighted average return of our value weighted index by multiplying here the returns

03:46.660 --> 03:49.890
of our six constituents by the way.

03:50.230 --> 03:55.600
And we have to keep in mind that we have to shift our weights by one day.

03:56.080 --> 04:02.440
So we have to multiply the weights at the end of the thirty first of December with the return on the

04:02.440 --> 04:03.660
second.

04:03.700 --> 04:12.280
And uh we can do this here with the shift asset so let's do this here.

04:12.370 --> 04:15.800
So here we have shifted forward all rates by one day.

04:16.150 --> 04:20.980
So now we have the weights that we have to use the calculated the weighted average return on the 2nd

04:20.980 --> 04:24.610
of January here at the 2nd of January.

04:24.700 --> 04:28.180
And finally we should also drop here the very first row

04:32.460 --> 04:38.310
and calculating the weighted average returns for each single timestamp is actually now what we do.

04:38.310 --> 04:45.460
So we take our returns data frame and multiply it here with our shifted weights data frame.

04:45.540 --> 04:46.460
So let's have a look.

04:51.930 --> 04:57.460
So these are the daily returns of our six constituents made it by their respective rates.

04:57.540 --> 05:01.770
And finally we have to sum it up to get the weighted average return.

05:01.790 --> 05:02.700
So let's sort this

05:05.500 --> 05:10.300
so these are now the daily returns of our value weighted index.

05:10.300 --> 05:14.810
And um now we are only one step away from our value weighted index.

05:14.810 --> 05:23.640
So first of all we create the column in our norm data frame value weighted index and we assign 100 to

05:23.650 --> 05:30.370
each and every timestamp so here we are on the right hand side of our value weighted index.

05:30.370 --> 05:33.740
And same as with the equal weighted index.

05:33.850 --> 05:40.250
Now we can calculate for each and every a timestamp the cumulative investment might.

05:40.600 --> 05:44.920
And we can do this by adding one to each and every uh daily return.

05:44.920 --> 05:48.200
Then we are calculating the cumulative product.

05:48.310 --> 05:54.520
And this actually gives us uh then the cumulative investment multiple for each timestamp.

05:54.520 --> 06:02.820
And finally we multiply each uh multiple with 100 because uh we are starting here with a base value

06:02.820 --> 06:04.810
on normalized value of 100.

06:05.410 --> 06:06.630
So let's do this here.

06:07.810 --> 06:15.160
And here we have actually a beginning from the second of January our values for our value weighted index.

06:15.160 --> 06:21.050
So at the very first day it's 100 then you add the second day it's ninety nine point three two.

06:21.070 --> 06:26.580
And so on and therefore now we can over variety beginning from the second element.

06:26.590 --> 06:32.860
We can over variety of the values in our column value weighted index and exactly with the values that

06:32.860 --> 06:33.910
we calculated here.

06:33.940 --> 06:43.120
So let's do this and let's have a final look here so here we have our fine uh normalized data frame

06:43.630 --> 06:47.620
with the normalized prices of our six constituents.

06:47.680 --> 06:54.040
And in addition we FBA the three indexes the price weighted index so the equal weighted index and the

06:54.040 --> 06:55.750
value weighted index.

06:55.960 --> 07:04.470
And we can also visualize our new evaluated and next year with the six constituents.

07:04.590 --> 07:07.130
And here we can see in dark blue.

07:07.140 --> 07:14.870
So this this year our evaluated index so we are finished now with this video and in the next video we

07:14.870 --> 07:17.390
will compare our three indexes.

07:17.390 --> 07:19.580
So hope to see you also there by.
