Coder Social home page Coder Social logo

financialengineering_ir_xva's Introduction

Financial Engineering Course

Here you will find materials for the course of "Financial Engineering: Interest rates & xVA"

YouTube lectures you can find at: https://www.youtube.com/ComputationsInFinance

The course is based on the book: "Mathematical Modeling and Computation in Finance: With Exercises and Python and MATLAB Computer Codes", by C.W. Oosterlee and L.A. Grzelak, World Scientific Publishing, 2019.

The website of the book is: https://QuantFinanceBook.com

Personal website of the author (with more courses) is: https://LechGrzelak.com

Content of the course:

Lecture 1- Introduction & Details Regarding the Course
Lecture 2- Understanding of Filtrations and Measures
Lecture 3- The HJM Framework
Lecture 4- Yield Curve Dynamics under Short Rate
Lecture 5- Interest Rate Products
Lecture 6- Construction of Yield Curve and Multi-Curves
Lecture 7- Pricing of Swaptions and Negative Interest Rates
Lecture 8- Mortgages and Prepayments
Lecture 9- Hybrid Models and Stochastic Interest Rates
Lecture 10- Foreign Exchange (FX) and Inflation
Lecture 11- Market Models and Convexity Adjustments
Lecture 12- Valuation Adjustments- xVA (CVA, BCVA and FVA)
Lecture 13- Value-at-Risk and Expected Shortfall
Lecture 14- The Summary of the Course\

financialengineering_ir_xva's People

Contributors

lechgrzelak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

financialengineering_ir_xva's Issues

Vectorized Ho-Lee Solution

Hello Lech!
Here's a vectorized approach for the short-rate models.
Thank you for your lectures & materials!

import typing

def f0T(t,P0T):
    dt = 0.01    
    return -(np.log(P0T(t+dt))-np.log(P0T(t-dt)))/(2*dt)

M: int = 25000 # n_simulations
N: int = 252 # n_steps
T: float = 40 
dt: float = T/N
sigma: float = 0.007
Z: np.ndarray = np.random.normal(0.0, 1.0, (M, N))
P0T: typing.Callable = lambda T: np.exp(-0.017*T)
x0: float = f0T(0.01, P0T) # r0
Ws: np.ndarray = np.cumsum(np.power(dt, 0.5)*Z, axis=1)
Ts: np.ndarray = np.arange(0, T, dt) # np.arange timesteps_vector
theta: typing.Callable = lambda t: (f0T(t+dt,P0T)-f0T(t-dt,P0T))/(2.0*dt) + sigma**2.0*t 

# np.ndarray of (M) short-rates dynamics
Xs = np.cumsum(np.concatenate((np.full(shape=(M, 1), fill_value=x0), 
    theta(Ts)[1:] * dt + sigma * np.diff(Ws)), axis=1), axis=1)

# np.ndarray of (M) money-savings accounts dynamics
Ms = np.cumprod(np.concatenate((np.full(shape=(M, 1), fill_value=1.0), 
    np.exp((Xs[:, 1:] + Xs[:, :-1]) * 0.5 * dt)), axis=1), axis=1)  

# Here we compare the price of an option on a ZCB from Monte Carlo the Market  
P_tMC = np.mean(1/Ms, axis=0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.