we are almost there all we have to do in this lesson is create a price list each price must
equal the product of the price observe the previous day and the simulated daily return
therefore once we obtain the price and day T we can estimate the expected stock price
we will have in day t plus one then this process will be repeated 1,000 times and we
will obtain a prediction of a company's stock price 1,000 days from now this sounds awesome
but where can we start we already created a matrix containing daily returns right
so the daily returns variable is available however which will be the first price in
our list 0 1 million of course not to make credible predictions about the future the
first stock price in our list must be the last one in our data set it is the current
market price let's call this variable s 0 as it contains the stock price today at
the starting point x 0 with the help of the aisle oke method and the index operator we
can indicate we need the last value from the table by typing minus 1 within the brackets
perfect this is the first stock price in our list let's proceed with filling in the
list how big should it be as big as the daily returns array right this is why the price list
matrix could be at most as big as the daily returns matrix and as we all hoped numpy has
a method that can create an array with the same dimensions as an array that exists and that we
have specified this method is called zeroes like as an argument insert the daily returns array
we will obtain an array of 1000 by 1000 mints just like the dimension
of daily returns and then fill it with zeros
so why did we create this object well now we can replace these zeros with the expected stock
prices by using a loop let's do this first we must set the first row of our price list to s0
yes not just the first value but the entire row of ten elements because s0 will be the initial
price for each of the ten iterations we intend to generate we will obtain the following array
you
great finally we can generate values for our price list we must set up a
loop that begins in day one and ends at day 1000 we can simply write down
the formula for the expected stock price on date T and pythonic it will be equal
to the price in day t minus one times the daily return observed in day tea
let's verify if we completed the price list
absolutely see and if we would like to plot it on a graph with size 10 to 6 we can do
that by using the matplotlib syntax when we execute we will obtain 10 possible paths of
the expected stock price of Procter & Gamble stock starting from the last day for which we
have data from Yahoo we called these trends iterations since the computer will iterate
through the provided formula 10 times here we have the paths we simulated amazing right
this was another Tuffy wasn't it we realized we got involved in more technical language and
more advanced concepts but this is the type of topics you need to master to get into the
field of finance or data science rewind if you would like to see how the process was carried
out next we will learn more about derivatives and options pricing stay tuned and thanks for watching