ebook img

Supplement for: Quantitative Finance With Python (Includes coding examples) PDF

192 Pages·2022·0.933 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Supplement for: Quantitative Finance With Python (Includes coding examples)

Chris Kelliher A Practical Guide to Investment Management, Trading and Financial Engineering To my amazing daughter Sloane, my light and purpose. To my wonderful, loving wife Andrea without whom none of my achievements would be possible. To my incredible, supportive parents and sister and brother, Jen and Lucas. Contents Author Bio vii Foreword ix Contributors xi Section I Foundations of Quant Modeling Chapter 1(cid:4) Setting the Stage: Quant Landscape 3 1.0.1 Coding Example: Option Payoff 3 1.0.2 Coding Example: Valuing a Swap Contract 3 Chapter 2(cid:4) Theoretical Underpinnings of Quant Modeling: Modeling the Risk Neutral Measure 5 2.1 CALCULUSREVIEW 5 2.1.1 Differentiation 5 2.1.2 Derivatives of a Multivariate Function 7 2.1.3 Integration 7 2.1.4 Taylor Series 9 2.2 REVIEWOFPROBABILITYCONCEPTS 10 2.2.1 Discrete and Continuous Probability Distributions 10 2.2.2 Probability Density and Cumulative Density Functions 11 2.2.3 Expected Value, Variance and Correlation 12 2.2.4 Common Probability Distributions 15 2.2.5 Coding Example: Call Option Price via Binomial Tree 18 Chapter 3(cid:4) Theoretical Underpinnings of Quant Modeling: Modeling the Physical Measure 21 3.0.1 Coding Example: Using OLS to Find Regression Betas 21 i ii (cid:4) Contents 3.0.2 Coding Example: Portfolio Return and Volatility 21 3.0.3 Coding Example: Bootstrapping Synthetic Returns 22 Chapter 4(cid:4) Python Programming Environment 27 4.0.1 Plotting / Visualizations 27 4.1 WORKINGINAMULTI-PROGRAMMERENVIRONMENT 27 Chapter 5(cid:4) Programming Concepts in Python 33 5.0.1 Coding Example: Covariance Matrix Calculations 33 5.0.2 Coding Example: Working with Time Series Data 34 5.0.3 Coding Example: Working with Panel Data 34 5.0.4 CodingExample:TestingforAutocorrelationinStockReturns 34 5.0.5 Coding Example: Using Inheritance to Create a Generic Stochastic Process Class 35 5.0.6 Abstract Base Classes 36 5.0.7 Factory Pattern 36 5.0.8 Singleton Pattern 37 5.0.9 Template Method 37 5.0.10 Binary Search Algorithm 38 5.0.11 Selection Sort 38 5.0.12 Insertion Sort 38 5.0.13 Bubble Sort 39 5.0.14 Merge Sort 39 Chapter 6(cid:4) Working with Financial Datasets 45 6.0.1 Coding Example: Downloading Data from Yahoo Finance 45 6.1 BASICSOFSQLQUERYING 45 6.1.1 Modifying Data via Insert, Update and Delete Statements 46 6.1.2 Retrieving Data via Select Statements 46 6.1.3 Retrieving Data from Multiple Tables via JOINs 47 6.1.4 Aggregating Data via a Group By Clause 49 6.1.5 Coding Example: Filling Missing Data with Python Data Frames 49 6.1.6 Coding Example: Filling Missing ETF Data via Regression 50 Contents (cid:4) iii 6.1.7 Coding Example: Using Bootstrapping to Create Synthetic History for a set of Indices 51 6.1.8 Coding Example: Outlier Detection 51 Chapter 7(cid:4) Model Validation 55 7.1 UNIT TESTS IN PRACTICE: VALIDATING A SIMULATION ALGO- RITHM 55 Section II Options Modeling Chapter 8(cid:4) Stochastic Models 61 8.0.1 Coding Example: Black-Scholes Formula 61 8.0.2 Coding Example: Bachelier Pricing Formula 61 8.0.3 Coding Example: Option Pricing under the CEV Model 61 8.0.4 Coding Example: Option Prices in the SABR Model 62 8.0.5 Coding Example: Local Volatility Model 62 Chapter 9(cid:4) Options Pricing Techniques for European Options 67 9.0.1 Coding Example: Pricing a Digital Option via Quadrature Methods 67 9.0.2 Coding Example: FFT Option Pricing in the Heston Model 67 9.0.3 Coding Example: Extracting Implied Volatility using Root Finding 68 9.0.4 Coding Example: Finding the Minimum Variance Portfolio of Two Assets 68 9.0.5 Coding Example: Calibrating a Volatility Surface 69 Chapter 10(cid:4) Options Pricing Techniques for Exotic Options 75 10.0.1 Coding Example: Simulation from the Heston Model 75 10.0.2 Coding Example: Simulation from the Variance Gamma 76 10.0.3 Coding Example: American Options Pricing via the Black- Scholes PDE 76 Chapter 11(cid:4) Greeks and Options Trading 85 11.0.1 Coding Example: Calculating Delta and Gamma 85 iv (cid:4) Contents 11.0.2 Coding Example: Black-Scholes Theta 85 11.0.3 CodingExample:EstimationofLookbackOptionGreeksvia Finite Differences 85 11.0.4 Coding Example: Smile Adjusted Greeks 86 Chapter 12(cid:4) Extraction of Risk Neutral Densities 91 12.0.1 Breeden-Litzenberger: Python Coding Example 91 12.0.2 Coding Example: Pricing a Digital Option 92 12.0.3 Weighted Monte Carlo: Coding Example 92 Section III Quant Modelling in Different Markets Chapter 13(cid:4) Interest Rate Markets 99 13.0.1 Coding Example: Bond Pricing, Duration & Convexity 99 13.0.2 Coding Example: Bootstrapping a Yield Curve 99 13.0.3 Coding Example: Cap Pricing via Black’s Model 100 13.0.4 Coding Example: Calibrating Swaptions via the SABR Model 101 13.0.5 Coding Example: Simulation from the Vasicek Model 102 Chapter 14(cid:4) Credit Markets 111 14.0.1 Coding Example: Pricing a Risky Bond 111 14.0.2 Coding Example: Calibrating a CDS Curve via Optimization 111 14.0.3 Coding Example: Pricing a Knock-out CDS Swaption 113 14.0.4 Coding Example: Building an Index Loss Distribution in the Homogeneous Model 113 14.0.5 Coding Example: Merton’s Formula 114 Chapter 15(cid:4) Foreign Exchange Markets 121 15.0.1 Coding Example: Pricing FX Options via the Black-Scholes Model 121 15.0.2 Coding Example: Calibrating an FX Vol. Surface using SABR 121 15.0.3 Coding Example: Pricing Digis and One-Touches 123 Chapter 16(cid:4) Equity & Commodity Markets 127 Contents (cid:4) v Section IV Portfolio Construction & Risk Management Chapter 17(cid:4) Portfolio Construction & Optimization Techniques 135 17.0.1 Coding Example: Creating an Efficient Frontier 135 17.0.2 Coding Example: Safely Inverting a Covariance Matrix 136 17.0.3 Coding Example: Finding the Tangency Portfolio 137 17.0.4 Coding Example: Resampling an Efficient Frontier 137 17.0.5 Coding Example: Risk Parity Optimization 138 Chapter 18(cid:4) Modelling Expected Returns and Covariance Matrices 145 18.0.1 Coding Example: Regularization Models 145 18.0.2 Coding Example: Calculating Rolling IC 145 18.0.3 Coding Example: Calibration of GARCH(1,1) Model 146 18.0.4 Coding Example: Shrinking a Covariance Matrix 147 Chapter 19(cid:4) Risk Management 153 19.0.1 Coding Example: Calculating Common Risk Metrics 153 19.0.2 CodingExample:CalculatingValueatRiskviaBootstrapping 153 Chapter 20(cid:4) Quantitative Trading Models 159 20.0.1 Coding Example: Pairs Trading Algorithm 159 20.0.2 Coding Example: PCA Analysis 160 20.0.3 Coding Example: Momentum Strategy 160 20.0.4 Coding Example: Covered Calls Back-test 161 Chapter 21(cid:4) Incorporating Machine Learning Techniques 167 21.0.1 Coding Example: Optimizing Model Parameters via Cross Validation 167 21.0.2 Coding Example: Clustering 167 21.0.3 Coding Example: K-Nearest Neighbor Algorithm 168 21.0.4 Coding Example: Classification via SVM 168 21.0.5 Coding Example: Feature Importance Tools 168

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.