Skip to Content
Mastering Python for Finance - Second Edition
book

Mastering Python for Finance - Second Edition

by James Ma Weiming
April 2019
Intermediate to advanced
426 pages
11h 13m
English
Packt Publishing
Content preview from Mastering Python for Finance - Second Edition

The Vasicek model

In the one-factor Vasicek model, the short-rate is modeled as a single stochastic factor:

Here, K, θ, and σ are constants, and σ is the instantaneous standard deviation. W(t) is the random Wiener process. The Vasicek follows an Ornstein-Uhlenbeck process, where the model reverts around the mean, θ, with K, the speed of mean reversion. As a result, the interest rates may become negative, which is an undesirable property in most normal economic conditions.

To help us understand this model, the following code generates a list of interest rates:

In [ ]:    import math    import numpy as np def vasicek(r0, K, theta, sigma, T=1., N=10, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python for Finance - Second Edition

Python for Finance - Second Edition

Yuxing Yan
Python for Finance

Python for Finance

Yves Hilpisch

Publisher Resources

ISBN: 9781789346466Supplemental Content