Hi Jason, great work here. I revisited this approach with a 10 days window to calculate de standard deviation "more accurate". It really improved the results. Thanks for your job.
@quantroom3 жыл бұрын
Excellent & thanks for sharing!
@esteban_ruiz3 жыл бұрын
R is awesome for MC simulation but I also suggest C++ for speedier simulations and HFT ;)
@caitlinmccormick81357 ай бұрын
Hiya, what particular Monte Carlo Simulation method would you say you have used here?
@quantroomАй бұрын
Don't recall the exact method.
@RIDICULOUSLOGIN4 жыл бұрын
That's a great tutorial. Could you post the results?
@quantroom4 жыл бұрын
Yes I will post them here under the description & on social media.
@joselouisiparraguirre64732 жыл бұрын
Hi Jason, Just bumped into this video. Great job! One question: do we need to simulate the volatility as well? If it happens that a GARCH model with an asymmetric distribution fits the time series better, must we use that distribution (say, a skewed Student's t) instead of qnorm or not? Regards
@quantroom2 жыл бұрын
Thank you for your comment. I think your question may be a little too advanced for me, but maybe someone with more experience may answer it here. You can also try posting a question on StackOverflow to see if they can answer it there.
@joselouisiparraguirre64732 жыл бұрын
@@quantroom Many thanks Jason. I'll do
@mindfreak93522 жыл бұрын
Hi Jason, question at min. 19:35 How to interpret the plot at index of 50? Does it mean: With a probability of 50% the end price (or closing price) of the stock will be at average $ 100? Thank you.
@quantroom2 жыл бұрын
The X axis serves as the position/location of the data points. It is not meaningful to the Monte Carlo Simulation. I just created the plot to visualize the "bands" above/below where the "End.PRC" for the stock.
@bored13153 жыл бұрын
Hi The simulation is stuck on 99% for a long time and returned this: Error in quantile.default(stock_prices, probs = seq(0, 1, 0.05)) : missing values and NaN's not allowed if 'na.rm' is FALSE In addition: There were 50 or more warnings (use warnings() to see the first 50) Could you give an update please? Thanks
@quantroom3 жыл бұрын
try adding na.rm in the quantile function: *quantile.default(stock_prices, probs = seq(0, 1, 0.05), na.rm=TRUE)* but also check the data to verify it is complete i.e. without NAs
@bored13153 жыл бұрын
@@quantroom Its worked, thanks again 👍
@eduardopossealvarez77173 жыл бұрын
Great video Jason. Please, May you tell me why it is needed to multiply the mean by delta_t and the variance by the square of delta_t in the qnorm distribution? Why delta_t must be1/N, that is, greater for shorter periods? Thank you
@quantroom3 жыл бұрын
Thanks Eduardo! We multiply by delta_t to give it weight/standardize such that a STDEV of 20% & mean of 0.005 across a 20-day period (1/20) would yield a lower result since it spread over the 20 days than having the same 20% STDEV in say 1 day (or 1/1) that is why it becomes greater for shorter periods. I may be wrong, so anyone feel free to correct me here.
@eduardopossealvarez77173 жыл бұрын
@@quantroom thank you
@dustinsmith83903 жыл бұрын
How would you go about alerting the script, so you would be looking ahead say a week or month? Currently, the last row in my dataframe "p" is tomorrows date.
@quantroom3 жыл бұрын
You would have to modify the EXPIRY variable to the dates you want. You can use seq.Date() to create a date vector spaced out in Weeks or Months.
@dustinsmith83903 жыл бұрын
@@quantroom Thanks for the reply! As far as forecasting/looking into the future. Say, if I want to look in the future next week, two weeks, so on, would I adjust the NEXT.EXPIRY variable?
@JonesDawg4 жыл бұрын
This is great, thanks!
@morganfuller53143 жыл бұрын
The STK_PRC comes up as numeric(empty) when I run the code and this leads to the monte carlo simulation coming up with an error. How do I correct this or why is this happening?
@quantroom3 жыл бұрын
Try running the code using my script to see if you get the same error. You can get the link to the script in the description area.
@morganfuller53143 жыл бұрын
@@quantroom Thanks for the reply Jason! I ran your code and now get the error 'Error in quantile.default(stock_prices, probs = seq(0, 1, 0.05)) : missing values and NaN's not allowed if 'na.rm' is FALSE' after running the Monte Carlo assigned to variable p. Any ideas of how to solve this?
@aniafistasz3k3982 жыл бұрын
@@morganfuller5314 Hello I have the same problem :(
@richaka4 жыл бұрын
Hey Jason, great work man, i tried to replicate your code, however, at p
@quantroom4 жыл бұрын
Thank You! Check out 18:06 i think you may have accidentally copied it wrong. Try using p
@richaka4 жыл бұрын
@@quantroom, thank you, I found where the bug was. In my MonteCarlo simulation function,i had misspelled one of the objects.
@fearingz4 жыл бұрын
Great tutorial!
@quantroom4 жыл бұрын
Thank you!
@fearingz4 жыл бұрын
@@quantroom Is it possible to change the code so that I can evaluate my own xts file with historical values? I would like to do some tests with it towards the lehman crisis and corona crisis. (For the university)
@quantroom4 жыл бұрын
@@fearingz I believe you can use your own data just replace the stock variable
@jmagomez13 жыл бұрын
Dear Jason, congrats for this video! I tried to replicate your code, but i got this message at the end, what could I do before at the code to avoid this message? Thanks! > p
@quantroom3 жыл бұрын
Thanks for the comment. It looks like you may have some NAs in your data that are triggering the error.