ebook img

Financial Derivative and Energy Market Valuation: Theory and Implementation in Matlab® PDF

651 Pages·12.111 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 Financial Derivative and Energy Market Valuation: Theory and Implementation in Matlab®

FINANCIAL DERIVATIVE AND ENERGY MARKET VALUATION FINANCIAL DERIVATIVE AND ENERGY MARKET VALUATION Theory and Implementation (cid:2) in Matlab R Michael Mastro U.S.NavalResearchLab Washington,DC A JOHN WILEY & SONS, INC., PUBLICATION Copyright©2013byJohnWiley&Sons,Inc.Allrightsreserved. PublishedbyJohnWiley&Sons,Inc.,Hoboken,NewJersey. PublishedsimultaneouslyinCanada. Nopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmittedinanyform orbyanymeans,electronic,mechanical,photocopying,recording,scanning,orotherwise,exceptas permittedunderSection107or108ofthe1976UnitedStatesCopyrightAct,withouteithertheprior writtenpermissionofthePublisher,orauthorizationthroughpaymentoftheappropriateper-copyfee totheCopyrightClearanceCenter,Inc.,222RosewoodDrive,Danvers,MA01923,(978)750-8400, fax(978)750-4470,oronthewebatwww.copyright.com.RequeststothePublisherforpermission shouldbeaddressedtothePermissionsDepartment,JohnWiley&Sons,Inc.,111RiverStreet, Hoboken,NJ07030,(201)748-6011,fax(201)748-6008,oronlineat http://www.wiley.com/go/permission. LimitofLiability/DisclaimerofWarranty:Whilethepublisherandauthorhaveusedtheirbestefforts inpreparingthisbook,theymakenorepresentationsorwarrantieswithrespecttotheaccuracyor completenessofthecontentsofthisbookandspecificallydisclaimanyimpliedwarrantiesof merchantabilityorfitnessforaparticularpurpose.Nowarrantymaybecreatedorextendedbysales representativesorwrittensalesmaterials.Theadviceandstrategiescontainedhereinmaynotbe suitableforyoursituation.Youshouldconsultwithaprofessionalwhereappropriate.Neitherthe publishernorauthorshallbeliableforanylossofprofitoranyothercommercialdamages,including butnotlimitedtospecial,incidental,consequential,orotherdamages. Forgeneralinformationonourotherproductsandservicesorfortechnicalsupport,pleasecontactour CustomerCareDepartmentwithintheUnitedStatesat(800)762-2974,outsidetheUnitedStatesat (317)572-3993orfax(317)572-4002. Wileyalsopublishesitsbooksinavarietyofelectronicformats.Somecontentthatappearsinprint maynotbeavailableinelectronicformats.FormoreinformationaboutWileyproducts,visitourweb siteatwww.wiley.com. ® MATLAB isatrademarkofTheMathWorks,Inc.andisusedwithpermission.TheMathWorks doesnotwarranttheaccuracyofthetextorexercisesinthisbook.Thisbook’suseordiscussionof ® MATLAB softwareorrelatedproductsdoesnotconstituteendorsementorsponsorshipbyThe ® MathWorksofaparticularpedagogicalapproachorparticularuseoftheMATLAB software. LibraryofCongressCataloging-in-PublicationData: Mastro,MichaelA.,1975– ® Financialderivativeandenergymarketvaluation:theoryandimplementationinMatlab / MichaelMastro. p.cm. Includesbibliographicalreferencesandindex. ISBN978-1-118-48771-6(cloth) 1. Derivativesecurities. 2. Energyderivatives. 3. MATLAB. I.Title. HG6024.A3M37742012 332.64’57–dc23 2012031825 PrintedintheUnitedStatesofAmerica 10987654321 CONTENTS Preface vii 1 Financial Models 1 2 Jump Models 35 3 Options 65 4 Binomial Trees 105 5 Trinomial Trees 131 6 Finite Difference Methods 167 7 Kalman Filter 231 8 Futures and Forwards 245 9 Nonlinear and Non-Gaussian Kalman Filter 295 10 Short-Term Deviation/Long-Term Equilibrium Model 349 11 Futures and Forwards Options 359 12 Fourier Transform 397 13 Fundamentals of Characteristic Functions 459 14 Application of Characteristic Functions 467 15 Levy Processes 505 16 Fourier-Based Option Analysis 547 17 Fundamentals of Stochastic Finance 585 18 Affine Jump-Diffusion Processes 605 Index 645 v PREFACE Energy markets and their associated financial derivatives are characterized by sudden jumps, mean reversion, and stochastic volatility. These aspects necessitate sophisticated models to properly describe even a subset of these traits. Moreover, the implementation of these models itself requires advanced numerical methods. This book establishes the fundamental mathematics and builds up all necessary statistical, quantitative, and financial theories. A number of theoretical topics are expanded, including the Fourier transform, momentgeneratingfunctions,characteristicfunctions,andfiniteandinfiniteactivity Levyprocessessuchasthealphastable,temperedstable,gamma,variancegamma, inverse Gaussian, and normal inverse Gaussian processes. Applied mathematics such as the fast Fourier transform and the fractional fast Fourier transform are developed and used to generate statistical distributions and for option pricing. Onthebasisofthisknowledge,state-of-the-artquantitativefinancialmodelsare developed without the need to refer external sources. Seminal works are derived andimplemented,includingtheBlack–Scholes,Black,Ornstein–Uhlenbeck,Mer- ton Gaussian jump diffusion, Kou double exponential jump diffusion, and Heston stochastic volatility models. Nevertheless, these models cannot capture the true behavior of the energy markets. The influential two-factor stochastic convenience yield model and the short-term long-term model are derived and implemented. It is shown that adding jumps to these models can be done in a rather ad hoc manner; however, a thorough discussion of the affine transform formalism is pre- sented. This provides an elegant framework to augment jumps to the two-factor models or develop similar jump-diffusion models. Tofitthesemodelsanddisplaytheirpredictivepower,aparticularfocusismade indevelopingandutilizingtheKalmanfilter.ForlinearmodelswithGaussiannoise, the Kalman filter finds an optimal recursive solution with very little computational burden. For the nonlinear and non-Gaussian models developed in this book, we build up and exploit the extended, Gauss–Hermite, unscented, Monte Carlo, and particle Kalman filters. Assuggestedbythetitle,amajorveinofthisbookistheimplementationofthese models.Availabilityofworkingcodeofmodernfinancialmodelsislimited,andthe implementationistypicallyonlydiscussedinanabstractsense.Thisbookdetailsthe ® necessary steps for implementation and displays the working code. The Matlab vii viii PREFACE environment was selected because it is broadly available and is simple to port to other popular environments including C++ and C#. In addition, Matlab provides refined graphing routines that allow our code to focus on the relevant quantitative and financial concepts. Michael Mastro 1 Financial Models 1.1. INTRODUCTION The movement of financial assets and products generally displays some type of expected return, even over a short period. This expected return trends at a predictable rate that may be positive, indicating growth; negative, indicating a decline; or zero. Additionally, there are random movements that are individually unpredictable; however, the general distribution of these fluctuations is predictable based on historical movements. The common approach to model randomness is to assume a single- or multi-component Gaussian process. The generalized format to describe a time-dependent stochastic process is dS =α(S,t)dt +σ(S,t)dW , t t where the drift α and volatility σ are functions of time t and asset price S, and W isaWienerprocess.Ifthedriftα(S,t)=μandvolatilityσ areconstants,then t the process dS =μdt +σdW t t isknownasarithmeticBrownianmotion.Thisprocessbyitselfstatesthatthestock price S will increase (or decrease) without bound at a rate that is not dependent on the current stock price. Clearly, this does not describe the typical behavior for an asset, but modified versions of arithmetic motion are useful in finance and are revisited later in the text. 1.2. GEOMETRIC BROWNIAN MOTION A more appropriate description of a stock price process is that the movements in the stock are proportional to the value of the stock. A specific description is that the overall drift, α(S,t)=μS , is the product of an expected return μ and the t current asset price S . Adding a stochastic movement that is also proportional to t the current price level gives dS =μSdt +σSdW , t t ® FinancialDerivativeandEnergyMarketValuation:TheoryandImplementationinMatlab , FirstEdition.MichaelMastro. ©2013JohnWiley&Sons,Inc.Published2013byJohnWiley&Sons,Inc. 1 2 FINANCIALMODELS which is the well known geometric Brownian motion process. A crude discrete approximation of the stochastic differential equation for geometric Brownian motion given by (cid:4)S t =μ(cid:4)t +σ(cid:4)W S t t isonlyvalidovershorttimeintervals.Thisformdoeshighlightthatthepercentage change in the stock price (cid:4)S over a sho√rt time interval is normally distributed S with mean μ(cid:4)t and standard deviation σ (cid:4)t, where μ is the drift and σ is the volatility. The shorthand for a normal distribution is (cid:2) √ (cid:3) (cid:4)S ∼N μ(cid:4)t,σ (cid:4)t . S (cid:4) (cid:5) Thevarianceofthisstochasticreturnisproportionaltothetimeinterval,var (cid:4)S = S σ2(cid:4)t (Hull,2006).OnebenefitofgeometricBrownianmotionisthatnegativeasset pricesarenotpossiblebecauseanypricechangeisproportionaltothecurrentprice. Bankruptcy could drive an asset price down to but not past the natural absorbing barrier at zero (Chance, 1994). The discrete approximation of the geometric Brownian(cid:4) m(cid:5)otion stochastic equation is composed of a trend (or expectation) term E dS =μdt and an S uncertainty (of deviation) term. The uncertainty term is given by the Wiener increment √ dW =ε dt, t t with E(dW )=0, where ε is the standard normal distribution. It turns out that t the variance of dW is equal to the time interval dt. The variance of the Wiener t increment was found by evaluating var(dW )=E[dW −μ ]2 =E(dW 2)−E(dW )2 =E(dW2). t t dWj t t t √ Theexpectedvalueof(dW )2 is,bydefinition,E[(dW )2]=E[(ε dt)2](Chance, t t t 2005). Pulling the dt factor out of the expectation gives E(dW2)=E(ε2dt)=(E(ε2))dt. t t t To evaluate the E(ε2) term requires the computational formula for the variance t var(ε )=E[(ε −E(ε ))2]=E[(ε2−2ε E(ε )+E(ε ))2] t t t t t t t var(ε )=E(ε2)−2E(ε )E(ε )+E(ε )2 =E(ε2)−2E(ε )2+E(ε )2 t t t t t t t t var(ε )=E(ε2)−E(ε )2 t t t →E(ε2)=var(ε )−E(ε )2. t t t GEOMETRICBROWNIANMOTION 3 The variance term of a standard normal variable is one, var(ε )=1. The expected t value of a standard normal variable E(ε ) and the square of the expected value t E(ε )2 are zero. Therefore, t E(ε2)=var(ε )−E(ε )2 =1−0, t t t the expected value of a squared standard normal variable is one. The value for the expectation of the Wiener increment squared is given by E(dW2)=(E(ε2))dt =dt. t t This important result states that the square of a Wiener process equals the time interval, dt =dW2. In other words, the Weiner process is unpredictable but the t square of the Weiner process is predictable. The percentage price change of the stochastic representation of dSt is normally St distributed because the stochastic differential equation, written as dS t =μdt +σdW , S t t is a linear transformation of the normally distributed variable dW . The relative t return S0+dSt =1+ dSt = St overatimeperiodT istheproductoftheintervening S0 S0 S0 price changes as displayed by ST = S1S2 ... St−1 ST , S0 S0S1 St−2St−1 where each increment inrelative return Si iscapable of being furthersubdivided Si−1 in time. A logarithm of the product converts the product series into a summation series as given by (cid:6) (cid:7) (cid:6) (cid:7) (cid:6) (cid:7) (cid:6) (cid:7) (cid:6) (cid:7) ln ST =ln S1 +ln S2 +···+ln St−1 +ln ST . S0 S0 S1 St−2 St−1 Thecentrallimittheoremstatesthatthesummationofalargenumberofidentically distributed and independent random variables, each with finite mean and variance, will be approximately normally distributed (Rice, 1995). 1.2.1. Lognormal Stochastic Differential Equation Theinsightofthepreviousparagraphprovidesamotivationtorecastthegeometric Brownian motion dS =μSdt +σSdW, 4 FINANCIALMODELS as a lognormal diffusion stochastic differential equation. The alteration is accom- plished by using the function G=lnS, and its derivatives ∂G 1 ∂2G 1 ∂G = =− =0. ∂S S ∂S2 S2 ∂t Application of Ito’s lemma gives Infinitesimally sm(cid:8)a(cid:9)l(cid:10)l→(cid:11)0 ∂G 1∂2G ∂G 1∂2G dG= dS+ (dS)2+ dt + (dt)2 ∂S 2 ∂S2 ∂t 2 ∂t2 1 1 1 dG= dS− (dS)2+0 S 2S2 1 1 1 dG= (μSdt +σSdW)− (μSdt +σSdW)2 S 2S2 dG=(μdt +σdW) ⎛ ⎞ ⎜ d(cid:8)W(cid:9)2(cid:10)=(cid:11)dt Infis(cid:8)nmita(cid:9)els(cid:10)l→im(cid:11)0ally Infisnm(cid:8)ita(cid:9)els(cid:10)l→i(cid:11)m0ally⎟ 1 1 ⎜ ⎟ − ⎜σ2S2 dW2 +μσS2 dtdW +α2S2 dt2 ⎟ 2S2 ⎝ ⎠ 1 dG=(μdt +σdW)− σ2dt 2 ⎛ ⎞ (cid:8) =(cid:9)(cid:10)η (cid:11) ⎜ ⎟ dG=⎜⎝μ− 1σ2⎟⎠dt +σdW, 2 where we have introduced a lognormal return drift factor, η, which is the con- tinuously compounded return. A solution to the log return stochastic differential equation is found by integrating (cid:18) (cid:18) (cid:18) dG = ηdt + σdW . u u The deterministic drift term can be integrated similar to an ordinary differential equation. The σ coefficient is taken as a time-invariant constant, which greatly simplifies the stochastic integral to (cid:18)t σdW =σ(W −W )=σ(W −0), u t 0 t 0

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.