WEBVTT

00:01.090 --> 00:07.180
In this video we are going to compare the performance of our six stocks in terms of risk and return.

00:07.180 --> 00:14.080
So in this video we are working also with the NUM pay packets and first of all we want to plot our six

00:14.080 --> 00:22.840
stocks where we have here a starting value or a basic value of 100 for each stock and we can see that

00:22.840 --> 00:31.570
actually Boeing showed the best performance in terms of return for the period 2010 to 2019.

00:31.570 --> 00:36.070
And actually IBM showed here the worst performance.

00:36.070 --> 00:41.440
However when we are comparing financial performance you must also take into account the risk.

00:41.440 --> 00:49.520
So if you take a higher risk then you should also be rewarded with a higher return and vice versa so

00:49.520 --> 00:55.790
simply saying that the Boeing stock showed you the best performance is not really accurate because you

00:55.790 --> 01:02.050
have to take into account risk and return and therefore on this video we are going to compare the historical

01:02.090 --> 01:09.240
risk and the return for these six stocks and finance typical metrics for risk and return to actually

01:09.250 --> 01:10.630
the mean return.

01:10.790 --> 01:17.780
And the standard deviation of returns and this is exactly what we are going to calculate here.

01:17.780 --> 01:21.790
So first of all let's have a look here at our close data frame.

01:21.800 --> 01:29.450
So here we have the closing prices the daily closing prices for all six stocks and in the last video

01:29.450 --> 01:33.170
we learned how to calculate returns for one single stock here.

01:33.170 --> 01:35.540
So for example for the Apple stock.

01:35.780 --> 01:38.880
But we can also apply the percentage change method.

01:38.960 --> 01:43.040
Also on the entire data frame and on all columns.

01:43.040 --> 01:52.450
So let's do this here and we can actually see the daily returns for all six stocks and of course here

01:52.450 --> 01:57.800
at our very first timestamp we do not have a return and therefore we shot.

01:57.850 --> 02:04.660
Also you will see at the drop and a method to drop all arrows that we have missing values.

02:04.660 --> 02:07.030
So here we are dropping the very first row.

02:07.570 --> 02:13.870
And once they're happy here with our data frame where we have the daily returns we can also save the

02:13.870 --> 02:18.170
data frame and we do this and the grab a return or red.

02:18.670 --> 02:24.220
So let's do this and let's have a look here.

02:24.250 --> 02:27.420
So here we have a data frame this daily returns.

02:27.580 --> 02:33.790
And as I said before we are mainly interested in the summary statistics the mean and standard deviation

02:33.790 --> 02:35.470
of these returns.

02:35.470 --> 02:41.020
And first of all we can call here the described method on our returns data frame

02:44.920 --> 02:51.970
so we get four or six stocks that mean return the standard deviation the minimum return the maximum

02:51.970 --> 02:59.640
return and so on and actually if you want to create now a summary data frame we have a few on the left

02:59.640 --> 03:07.320
hand side as labels our stocks and as columns the mean and standard deviation and therefore we have

03:07.320 --> 03:12.590
to transpose here the data frame we can do this with the transpose attribute.

03:12.600 --> 03:17.960
T capital T.

03:18.090 --> 03:25.410
So now we have transposed here our summary statistics and now we want to only select the columns mean

03:25.440 --> 03:29.940
and standard deviation and we can do this with the local operator.

03:29.970 --> 03:34.890
So we want to have all the rows they want to have all stocks and we want to have the columns mean and

03:34.890 --> 03:44.710
standard deviation so this is our data frame with the summary statistics mean return and standard deviation

03:44.710 --> 03:51.280
of returns and we can also save you the data frame and the variable summary.

03:51.370 --> 03:53.150
So here we are.

03:53.980 --> 04:00.270
And here we can see now that we have for the mean are the average daily returns and we ask the standard

04:00.280 --> 04:04.960
deviation of daily returns and these are quite small numbers.

04:04.960 --> 04:10.110
And actually it's more intuitive to have these summary statistics annualized.

04:10.480 --> 04:17.020
So we want to have the annualized that mean return and we want to f the annualized the standard deviation

04:17.020 --> 04:24.490
of returns and we can do this by multiplying here the mean values by two hundred fifty two.

04:24.490 --> 04:29.590
So on average a calendar year has two hundred fifty two business days or trading days.

04:29.920 --> 04:33.700
So we multiply here the mean by 252.

04:34.060 --> 04:40.450
And we also want to annualize to the standard deviation and we can do this by multiplying the column

04:40.450 --> 04:45.490
standard deviation by the square root of 252.

04:45.580 --> 04:54.070
So let's run the cell and actually be about right at our column so let's re inspect our summary data

04:54.080 --> 04:55.190
frame.

04:55.550 --> 05:01.010
And here we have now the annualized mean return and the annualized standard deviation.

05:01.010 --> 05:09.680
So for example for Apple we have an annualized mean return in the period 2010 to 2019 of twenty two

05:09.680 --> 05:10.640
percent per year.

05:10.640 --> 05:12.860
So this is quite good.

05:12.860 --> 05:19.010
And we have an annualized standard deviation of 26 percent and actually to better compare here the stocks

05:19.400 --> 05:22.530
it might make sense to do this graphically.

05:23.030 --> 05:32.330
So we can create here a scatter plot where we have on the x axis the standard deviation and on the y

05:32.330 --> 05:34.280
axis the mean return.

05:34.880 --> 05:40.700
So we're actually creating here a scattered plot on our summary data frame and I expect to get to a

05:40.720 --> 05:45.490
six get us six dots for each stuck here actually.

05:45.500 --> 05:46.950
So let's run this out.

05:49.990 --> 05:56.110
So here we have on the x axis that the annualized the risk in terms of annualized the standard deviation

05:56.530 --> 06:00.870
and on the y axis we have actually the annualized the return.

06:00.910 --> 06:05.060
And here we have the six dots for our six stocks.

06:05.200 --> 06:12.790
And actually it might be more comfortable to also label here the dots and we can do this with the method

06:12.820 --> 06:21.160
purity that notate and therefore actually we are iterating here of our index and our summary data frame.

06:21.160 --> 06:28.000
So we take all six stocks here and for each stock we are creating a label with the ticker symbol and

06:28.000 --> 06:33.670
we place the label near the X Y coordinate at the top other point for the stock is located.

06:34.030 --> 06:41.680
So for each stock actually we place the label in our graph at the coordinate with the x value is where

06:41.680 --> 06:51.550
we have the standard deviation and divide where you mean so let's enable this here and let's have a

06:51.550 --> 06:51.820
look

06:54.680 --> 07:02.750
and as I said before a higher risk should be awarded with a higher return so we can see that the Coca-Cola

07:02.750 --> 07:07.010
stock has quite low risk and also quite low return.

07:07.370 --> 07:10.910
And we can see here that the Boeing stock and also the Apple stock.

07:11.010 --> 07:14.910
So quite high risk but also quite high return.

07:15.110 --> 07:21.590
So we can say that the Boeing stock and the Apple stock showed a better performance as the Coca-Cola

07:21.590 --> 07:23.250
stock in terms of return.

07:23.510 --> 07:30.620
But if you combine risk and return then we cannot really say that these two stocks showed a better performance.

07:30.620 --> 07:36.800
So they simply generated a higher return because then they also had a higher risk and actually also

07:36.830 --> 07:44.450
had the Disney stock and the Microsoft stock are actually in line with the risk return framework.

07:44.450 --> 07:52.130
So on a risk adjusted basis these five stocks showed actually more or less than the same risk adjusted

07:52.280 --> 07:54.110
return performance.

07:54.110 --> 07:59.600
However we can say that the IBM stock showed quite a weak performance.

07:59.600 --> 08:07.150
So it seems like the IBM stocks showed the weakest performance in terms of risk and return.

08:07.160 --> 08:11.030
However as I mentioned before here we have only the price returns.

08:11.030 --> 08:13.820
So we didn't take into account any dividends.

08:14.360 --> 08:21.140
So maybe we have a different conclusion if we also include your dividends but this is not a finance

08:21.140 --> 08:21.660
costs.

08:21.680 --> 08:28.130
And with this visualization here we are finished seventh this session and I hope to see you also in

08:28.130 --> 08:29.420
the next video by.
