Solving Boundary Value problems via Orthogonal Collocation
We continue with boundary value problems this time using a method often referred to as orthogonal collocation. In previous videos, we approximated a differential equation with a system of coupled algebraic equations. This system was often fairly large, say 100 or more coupled equations. This method allows (in some cases) to represent the differential equation by a handful of algebraic equations (though the matrices involved are not sparse). This potentially allows us to solve complicated systems much faster.
In this video, we look at optimizing a quantity that is part of a system of differential equations. We continue with simple physics problems, in this case projectile motion, and ask how far a baseball will travel when hit at a certain angle. Then we ask which angle will maximize the total horizontal distance traveled. We do this both with and without air resistance.
In the case of no air resistance, we check our numeric calculations by using the Sympy package to find the answer algebraically.
This video is part one of two.
Part 2: https://youtu.be/-hJc2zktxCs
Githyb: https://github.com/kpmooney/numerical_methods_youtube/tree/master/physics/projectile_motion
Free Fall Problem: https://youtu.be/XPT3_L13RFM
Donate: http://paypal.me/kpmooney
...
https://www.youtube.com/watch?v=DSJj9rfHKPk
Since a lot of people like the trading-related stuff, this is a quick video on adjusting a short strangle that has gone bad. Obviously, the markets have been crazy the last few months, and a lot of short premium trades have gone south. I have a spreadsheet detailing my initial trades and subsequent roles and discuss the reason for each one.
The spreadsheet can be found here: https://github.com/kpmooney/numerical_methods_youtube/tree/master/tlt
The video detailing dividend risk is here: https://youtu.be/vKX371HcbXc
Donate: http://paypal.me/kpmooney
...
https://www.youtube.com/watch?v=QHtfuXjeC4w
We look at doing a simple linear regression in Python to calculate a stock’s beta coefficient. This will be the first video in a series covering the basics of curve fitting.
Source code: https://github.com/kpmooney/numerical_methods_youtube/tree/master/beta
SciPy documentation on lingress: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.linregress.html
Donate: http://paypal.me/kpmooney
...
https://www.youtube.com/watch?v=jmKfDvk4k6g
In answer to a viewer’s question, I will go over calculating the probability of s stock ending up in a given range of prices. This is applicable to fields other than finance as well. I will likely do a follow-up video at a later date showing how to use Scipy’s built-in log-normal functions.
Github: https://github.com/kpmooney/numerical_methods_youtube/blob/master/market_analysis/Stock%20Range%20Probabilities.ipynb
Tip Jar: https://paypal.me/kpmooney
...
https://www.youtube.com/watch?v=Y2CURabE0yY
There is a known issue-- but not known to me, apparently-- with the way Scipy’s ODE solver solve_ivp handles event detection. This will affect our projectile motion problem from the last two videos. I compare this with MAYLAB and come up with a workaround though the video is just a quick code snippet showing how one might handle the issue.
...
https://www.youtube.com/watch?v=qjb8hMoDrLI
I look at solving for the implied volatility of an option given its price using a spreadsheet like MS Excel or Google Sheets. I don’t both reviewing the Black-Scholes model or root finding algorithm in this video. If you need a refresher, it is in the first seven minutes or so of this video: https://youtu.be/Jpy3iCsijIU
Edit (04/19/2020: A commenter noticed that I misspoke a couple of times in the video. I spoke the correct stock price but entered the wrong number. I also initially entered the wrong cell value for sigma when constructing the d1 field. I fixed these in the spreadsheet a long time ago, but never many an update here.
Github reop: https://github.com/kpmooney/numerical_methods_youtube
Original Blog Post: https://kevinpmooney.blogspot.com/2017/07/calculating-implied-volatility-from.html
Donate: http://paypal.me/kpmooney
...
https://www.youtube.com/watch?v=ljlqGWz1xDY
In this video, we continue going over some of the material in the book Optimal Mean Reversion Trading: Mathematical Analysis And Practical Applications by Tim Siu-tang Leung, Xin Li. Continuing with what we have done previously, we will use maximum likelihood estimation to estimate the Ornstein-Uhlenbeck parameters. This will be in the context of pairs trading, so we will extend what we’ve done to estimate the optimal share ratio that comprises the pair.
Previous videos in this series:
What is a pairs trade: https://youtu.be/vHzlZECzyPE
Maximum Likelihood Estimation with Ornstein-Uhlenbeck (part 1): https://youtu.be/GdqVY1kZ4XI
Maximum Likelihood Estimation with Ornstein-Uhlenbeck (part 2)
: https://youtu.be/3906CWKhLqQ
Tip Jar: https://paypal.me/kpmooney
...
https://www.youtube.com/watch?v=UrE-ckatris
This is a quick, impromptu video addressing a question on which fields to modify in our old spreadsheet to calculate the implied volatility of a put option rather than a call. Please see the videos below for an explanation of the math involved.
Original video calculating volatility with Excel: https://youtu.be/ljlqGWz1xDY
Video series on Newton’s Method: https://youtu.be/Q6COHive9CY
Calculating the Implied Volatility of a Option with Python: https://youtu.be/Jpy3iCsijIU
Calculating the IV of an Option with Excel: https://youtu.be/ljlqGWz1xDY
Tip Jar: https://paypal.me/kpmooney
...
https://www.youtube.com/watch?v=ImH3x6JP_ZU
This is a somewhat impromptu video. I had received several questions on the calculating option greeks video regarding why the computation of theta is a bit different from the other values. The answer boils down to the units the programmers of various trading platforms choose to use to display the information. In this video, I will go over the calculation of theta and vega and explain the units used in the Black-Sholes formula and those typically used on trading platforms to display those particular greeks.
Original option greeks video: https://youtu.be/pa2zNZ3FHH8
GithubL Github: https://github.com/kpmooney/numerical_methods_youtube/tree/master/option_greeks
Donate: paypal.me/kpmooney
...
https://www.youtube.com/watch?v=RN8zmSO6DfE