So in this lecture, we are going to do a little warm up.
So how can you think of this lecture?
This is just like warming up when you do exercise.
The goal is to get you primed for specific movements and for the specific ways of thinking that we will
use in this course.
It should also give you some sense of the kinds of tools we will use in this course and the level of
complexity you should expect.
Note that if you've taken courses with me before, you can comfortably skip this lecture.
So let's begin.
Your first exercise is to use numpy to generate 1000 random samples from the standard normal.
That is, samples from the normal distribution with mean zero and variance one.
Note that this lecture will also help us introduce some notation.
You'll see that I'm using this unconventional letter n to mean the normal.
This is so that we don't get it confused with the regular N, which I usually use to mean the number
of samples in a data set.
So once you've generated these samples, you want to plot the samples as a time series.
Next, you'll want to plot the samples as a histogram.
All right.
So for the next exercise, you are going to add a trend line to the noise you just generated.
Once you've done so, it should look something like this.
Note that this is a scatterplot and not a line chart.
I'll let you pick the parameters of the trend line.
So play around with different values until you get something that looks reasonable.
So the next exercise is to call the cumbersome function on your noise, which calculates the cumulative
sum of the array you pass in.
And next, I want you to take that output and plot it as a time series.
Consider what this Time series reminds you of in the context of this course.
The answer should be pretty obvious.
But think about how what you just did might be related to what we will learn in the coming sessions.
So in the next exercise, I want you to generate 1000 samples from the multivariate normal.
This will have the mean vector zero zero and the covariance matrix one -0.5 -0.5 and two.
You can use sci fi for this or any other library you prefer.
Now, once you have your samples, I want you to plot them using a scatterplot.
And again, this might not seem like much right now, but keep these concepts in mind as you go through
the course.
So your next exercise is to take the samples you just generated from the multivariate normal and calculate
the sample mean and the sample covariance from your data.
Consider whether or not these estimates are close to the values you expect.
As a bonus, do not use the mean and co functions in numpy, but instead use the actual formulas.
This will be useful for understanding many of the concepts in this course.
So I hope this little warm up has been pretty easy.
By the way, you can see that this is not the kind, of course, where we will spend 2 hours learning
basic python, 2 hours learning how to use pandas and so on.
As you can tell from these warmup exercises, this knowledge is knowledge you should already have.
Now, it's my general feeling that if you just learn basic spelling and grammar today, you won't be
ready to read Shakespeare tomorrow.
And that's what it would be like if you just learn basic Python and then try to do financial analysis
or time series analysis.
So hopefully you agree with me that this is rational.
It's really difficult to just learn how to code today and then apply all those skills to a complex field
like Finance or Time series immediately after.
So please take your time and remember that you have this course for a lifetime.
There truly is no rush.
And please note that I do teach numpy, pandas, psi, pi and map plot lib for free.
Therefore, there is absolutely no excuse for not meeting these prerequisites.
It's easy.
It's free.
And more importantly, it is only beneficial to learn them.
In other words, it helps you.
So help yourself and give yourself the best possible start that you can by taking advantage of this
free content.