All language subtitles for 10. Price Simulations in Code

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic Download
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

OK, so in this lecture, you're going to look at a simple example of how to simulate stock prices,

assuming that the log returns come from a normal distribution.

Now, this might seem at first to be a strange exercise, but it should get you thinking.

We'll see how totally unpredictable randomness can lead to something that looks very much like a stock

race time series.

In fact, this exact method can be used for doing Montecarlo simulations and evaluating the Black-Scholes

formula.

Furthermore, it is also useful for when we want to analyze certain rules of thumb for Arima.

This may not make too much sense right now, but you'll see how this kind of approach can help to validate

some of the rules that we use for a rhema model selection.

OK, so let's start by importing nonpaying matplotlib.

The next step is to set a few constants will be using, such as the number of time steps, the initial

price and the drift term.

The next step is to run our simulation, so we'll start by taking the log of the price and setting it

to last P last P is a variable will continue to update throughout the loop, since the current price

will always depend on the last price.

The next step is to create two arrays, to store log returns and our prices, and of course, these

should both have length T.

The next step is to enter a loop that goes 40 iterations inside the loop.

We'll start by sampling a random log return from a zero mean normal distribution with standard deviation

zero point zero one.

The next step is to compute our new log price.

This is equal to the old log price, plus the drifter, plus the random noise.

The next step is to store the log return and the new price note that we don't actually make use of the

log returns, but you may find them to be useful in later code for the price.

Note that we have to take the exponential since we want to plot the price and not the log price.

The final step in this loop is to assign P to last P so that last P has the correct value in the next

iteration.

OK, and so in the next block, we are going to plot our simulated time series.

So as you can see, this certainly looks like a plausible stock price evolution in the coming lectures,

you learn about the why behind what we just did.

And hopefully this will give you some insight behind this exercise.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.