1
00:00:11,570 --> 00:00:14,420
So in this lecture, we are going to do a little warm up.

2
00:00:14,840 --> 00:00:17,000
So how can you think of this lecture?

3
00:00:17,360 --> 00:00:20,030
This is just like warming up when you do exercise.

4
00:00:20,390 --> 00:00:25,670
The goal is to get you primed for specific movements and for the specific ways of thinking that we will

5
00:00:25,670 --> 00:00:26,840
use in this course.

6
00:00:27,320 --> 00:00:31,820
It should also give you some sense of the kinds of tools we will use in this course and the level of

7
00:00:31,820 --> 00:00:33,530
complexity you should expect.

8
00:00:33,950 --> 00:00:38,390
Note that if you've taken courses with me before, you can comfortably skip this lecture.

9
00:00:39,230 --> 00:00:40,310
So let's begin.

10
00:00:44,830 --> 00:00:51,190
Your first exercise is to use numpy to generate 1000 random samples from the standard normal.

11
00:00:51,550 --> 00:00:55,990
That is, samples from the normal distribution with mean zero and variance one.

12
00:00:56,560 --> 00:01:00,010
Note that this lecture will also help us introduce some notation.

13
00:01:00,430 --> 00:01:04,030
You'll see that I'm using this unconventional letter n to mean the normal.

14
00:01:04,330 --> 00:01:08,980
This is so that we don't get it confused with the regular N, which I usually use to mean the number

15
00:01:08,980 --> 00:01:10,630
of samples in a data set.

16
00:01:12,160 --> 00:01:16,840
So once you've generated these samples, you want to plot the samples as a time series.

17
00:01:17,200 --> 00:01:19,960
Next, you'll want to plot the samples as a histogram.

18
00:01:24,570 --> 00:01:24,930
All right.

19
00:01:24,930 --> 00:01:29,580
So for the next exercise, you are going to add a trend line to the noise you just generated.

20
00:01:30,000 --> 00:01:32,730
Once you've done so, it should look something like this.

21
00:01:33,000 --> 00:01:35,970
Note that this is a scatterplot and not a line chart.

22
00:01:36,300 --> 00:01:38,310
I'll let you pick the parameters of the trend line.

23
00:01:38,310 --> 00:01:42,120
So play around with different values until you get something that looks reasonable.

24
00:01:46,720 --> 00:01:52,360
So the next exercise is to call the cumbersome function on your noise, which calculates the cumulative

25
00:01:52,360 --> 00:01:54,340
sum of the array you pass in.

26
00:01:55,360 --> 00:01:59,560
And next, I want you to take that output and plot it as a time series.

27
00:02:00,430 --> 00:02:04,900
Consider what this Time series reminds you of in the context of this course.

28
00:02:04,900 --> 00:02:06,340
The answer should be pretty obvious.

29
00:02:06,340 --> 00:02:12,070
But think about how what you just did might be related to what we will learn in the coming sessions.

30
00:02:16,960 --> 00:02:23,020
So in the next exercise, I want you to generate 1000 samples from the multivariate normal.

31
00:02:23,380 --> 00:02:31,660
This will have the mean vector zero zero and the covariance matrix one -0.5 -0.5 and two.

32
00:02:32,170 --> 00:02:35,650
You can use sci fi for this or any other library you prefer.

33
00:02:36,430 --> 00:02:40,630
Now, once you have your samples, I want you to plot them using a scatterplot.

34
00:02:41,260 --> 00:02:46,750
And again, this might not seem like much right now, but keep these concepts in mind as you go through

35
00:02:46,750 --> 00:02:47,650
the course.

36
00:02:52,130 --> 00:02:58,430
So your next exercise is to take the samples you just generated from the multivariate normal and calculate

37
00:02:58,430 --> 00:03:02,060
the sample mean and the sample covariance from your data.

38
00:03:02,510 --> 00:03:06,590
Consider whether or not these estimates are close to the values you expect.

39
00:03:07,250 --> 00:03:13,340
As a bonus, do not use the mean and co functions in numpy, but instead use the actual formulas.

40
00:03:13,640 --> 00:03:17,570
This will be useful for understanding many of the concepts in this course.

41
00:03:22,510 --> 00:03:25,360
So I hope this little warm up has been pretty easy.

42
00:03:25,960 --> 00:03:30,520
By the way, you can see that this is not the kind, of course, where we will spend 2 hours learning

43
00:03:30,520 --> 00:03:34,330
basic python, 2 hours learning how to use pandas and so on.

44
00:03:35,020 --> 00:03:40,960
As you can tell from these warmup exercises, this knowledge is knowledge you should already have.

45
00:03:41,410 --> 00:03:47,290
Now, it's my general feeling that if you just learn basic spelling and grammar today, you won't be

46
00:03:47,290 --> 00:03:49,180
ready to read Shakespeare tomorrow.

47
00:03:49,540 --> 00:03:54,880
And that's what it would be like if you just learn basic Python and then try to do financial analysis

48
00:03:54,880 --> 00:03:56,500
or time series analysis.

49
00:03:56,740 --> 00:03:59,650
So hopefully you agree with me that this is rational.

50
00:04:00,010 --> 00:04:05,380
It's really difficult to just learn how to code today and then apply all those skills to a complex field

51
00:04:05,380 --> 00:04:08,530
like Finance or Time series immediately after.

52
00:04:08,980 --> 00:04:13,780
So please take your time and remember that you have this course for a lifetime.

53
00:04:13,810 --> 00:04:15,520
There truly is no rush.

54
00:04:15,940 --> 00:04:21,820
And please note that I do teach numpy, pandas, psi, pi and map plot lib for free.

55
00:04:22,330 --> 00:04:27,040
Therefore, there is absolutely no excuse for not meeting these prerequisites.

56
00:04:27,190 --> 00:04:28,180
It's easy.

57
00:04:28,180 --> 00:04:29,110
It's free.

58
00:04:29,140 --> 00:04:32,500
And more importantly, it is only beneficial to learn them.

59
00:04:32,710 --> 00:04:34,570
In other words, it helps you.

60
00:04:34,810 --> 00:04:40,390
So help yourself and give yourself the best possible start that you can by taking advantage of this

61
00:04:40,390 --> 00:04:41,500
free content.
