MATLAB tutorial 2.6: Black Scholes model - Fluids at Brown
文章推薦指數: 80 %
This model was later built out by Fischer Black and Myron Scholes to develop the Black--Scholes pricing model. Robert C. Merton is a famed American economist ...
MATLABtutorial2.6:BlackScholesmodel
BlackScholesmodel
FischerBlack
MyronScholes
RobertC.Merton
Anoptionscontractisafinancialinstrumentwhichgivestheownertheright,
butnottherequirement,tobuyorsellstockonaparticulardate(the
expirationdate)foraspecifiedprice(thestrikeprice).Acallcontractis
thecontractthatprovidestheownertherighttopurchasestockatthestrike
priceontheexpirationdate,andaputcontractallowstheownertosellstock
atthestrikepriceontheexpirationdate.Thesecontractsarecommonlybought
andsoldonpublicexchanges,andoptionsmarketsexistformostpublicly
tradedstocks.
Giventhatthecontracthasvaluetotheownerandplacesaliabilityonthe
seller,itstandstoreasonthateachcontracthasafairvalueatanygiven
pointintime.Inotherwords,ifweassumethatabuyerandasellerofan
optionscontracthavethesameimperfectinformationaboutchangesinthestock
price,thereshouldbesomepriceatwhichthebuyerdoesnotstandtohavea
positiveexpectedgaingreaterthanthereturnprovidedbytheriskfree
interestrate.
TheBlackScholesmodel,alsoknownastheBlack--Scholes--Mertonmodel,isamodelofpricevariationovertimeoffinancialinstrumentssuchasstocksthatcan,amongotherthings,beusedtodeterminethepriceofaEuropeancalloption.ThemodelassumesthepriceofheavilytradedassetsfollowsageometricBrownianmotionwithconstantdriftandvolatility.Whenappliedtoastockoption,themodelincorporatestheconstantpricevariationofthestock,thetimevalueofmoney,theoption'sstrikeprice,andthetimetotheoption'sexpiry.
TheBlackScholesmodelisoneofthemostimportantconceptsinmodernfinancialtheory.Itwasdevelopedin1973byFisherBlack,RobertMerton,andMyronScholesandisstillwidelyusednow.Itisregardedasoneofthebestwaysofdeterminingfairpricesofoptions.TheBlackScholesmodelrequiresfiveinputvariables:thestrikepriceofanoption,thecurrentstockprice,thetimetoexpiration,therisk-freerate,andthevolatility.Additionally,themodelassumesstockpricesfollowalognormaldistributionbecauseassetpricescannotbenegative.Moreover,themodelassumestherearenotransactioncostsortaxes;therisk-freeinterestrateisconstantforallmaturities;shortsellingofsecuritieswithuseofproceedsispermitted;andtherearenorisklessarbitrageopportunities.
TheMertonmodelisananalysismodel–namedaftereconomistRobertC.Merton–usedtoassessthecreditriskofacompany'sdebt.AnalystsandinvestorsutilizetheMertonmodeltounderstandhowcapableacompanyisatmeetingfinancialobligations,servicingitsdebt,andweighingthegeneralpossibilitythatitwillgointocreditdefault.ThismodelwaslaterbuiltoutbyFischerBlackandMyronScholestodeveloptheBlack--Scholespricingmodel.
RobertC.MertonisafamedAmericaneconomistandNobelMemorialPrizelaureate,whobefittinglypurchasedhisfirststockatage10.Later,heearnedaBachelorinScienceatColumbiaUniversity,aMastersofScienceatCaliforniaInstituteofTechnology(CalTech),andadoctorateineconomicsatMassachusettsInstituteofTechnology(MIT),wherehelaterbecomeaprofessoruntil1988.AtMIT,hedevelopedandpublishedgroundbreakingandprecedent-settingideastobeutilizedinthefinancialworld.
PriortothedevelopmentoftheBlack-Scholesoptionspricingmodel,numericaltechniqueswere
oftenusedtoestimatethefairpriceofanoptionscontract.Aswewillseelater,anoptionscontract
isconsideredfairlypricedifthereisnowaytousesomecombinationofbuying/sellingstocksand
optionstoearnariskfreeprofitgreaterthanthereturnonariskfreeasset.
AcommontechniqueusedtomodelthestockmarketistoassumethatthepriceofastockfollowsGeometricBrownianMotionwithpositivedrift,meaningthatthepercent-wisemovementofthestockpriceisassumedtoberandomandnormallydistributedwithpositivemean.Itisalsoassumed
thatthereexistsariskfreeinterestrate,meaningthatthereissomepercent-wisereturnthatcan
beearnedoninvestedmoneywithnorisk.Generallythisisinterpretedtomeantheinterestrate
onU.S.Treasurybonds,orsomeotherinstrumentwhichhasaverylowriskofdefault.Lastly,the
stockisassumedtopaynodividend.
TheBlack--Scholesmodelmakescertainassumptions:
TheoptionisEuropeanandcanonlybeexercisedatexpiration.
Nodividendsarepaidoutduringthelifeoftheoption.
Marketsareefficient(i.e.,marketmovementscannotbepredicted).
Therearenotransactioncostsinbuyingtheoption.
Therisk-freerateandvolatilityoftheunderlyingareknownandconstant.
Thereturnsontheunderlyingarenormallydistributed.
Intherealworld,extremelylargemovementsinstockpricesaremuchmorec
ommonthantheseassumptionswouldsuggest.Financialcrisesandlarge
macroeconomicdisruptionscanoftencauseseveredownwardmovementsinstock
marketsthatwouldbenearlyimpossibleifthemarketfollowedatrue
GeometricBrownianMotion.
Despitethisdifference,andafewothers,theaboveassumptionsarestill
usedassimplifyingassumptionstodevelopthepricingmodelforoptions
contracts.
WedenotethestockpriceasafunctionoftimeS(t)andthe
priceofthecallcontractasafunctionofboththestockpriceandtime
V(S,t).Givenourassumptionthatthestockpricefollowsa
GeometricBrownianMotion,wecanwritethat
\[
{\textd}S=\muS\,{\textd}t+\sigmaS\,{\textd}X,
\]
whereXfollowsBrownianMotion.Intuitively,thisindicatesthat
changesinthestockpricearerelatedtosomepositivedrifttermthatis
proportionaltothestockprice,andtosomerandommovement,whoseaverage
magnitudeisalsoproportionaltothestockprice.
Supposewearetobuythecalloptionandsellthestockshort,meaningthat
weborrowsharesofstockfromsomeoneelseandsellthematthecurrentmarket
price,givingustheobligationtopurchasethesharesatalaterdateandr
eturnthem.Ourpositionthushasanetvalueof
\[
\Pi=V(S,t)-\DeltaS(t),
\]
wheredeltaistheamountofthestockthatweshort.(Intherealworld,it
isnotpossibletoshortfractionsofastock,butthesevaluescanbescaled
uptoverycloseintegerratios,soouranalysisisstillviable.)
Fromthisequation,wecanget
\[
{\textd}\Pi={\textd}V(S,t)-\Delta{\textd}S(t).
\]
ThenextsteprequiresustouseIto’sLemma,alemmathatisusedtocalculatethedifferentialof
afunctionoftimeandastochasticfunction,whichisexactlywhathestatedtheoptionpriceto
be.SeeEvans[5]formoreinformationonIto’sLemma.UsingIto’sLemma,wecanarriveat
\[
{\textd}V=\frac{\partialV}{\partialS}\,{\textd}S+\frac{\partialV}{\partialt}\,{\textd}t+\frac{1}{2}\,\sigma^2S^2\frac{\partial^2V}{\partialS^2}\,{\textd}t.
\]
Pluggingintoourequationforthevalueofourportfolio,weget:
\[
{\textd}\Pi=\frac{\partialV}{\partialS}\,{\textd}S+\frac{\partialV}{\partialt}\,{\textd}t+\frac{1}{2}\,\sigma^2S^2\frac{\partial^2V}{\partialS^2}\,{\textd}t-\Delta{\textd}S.
\]
Itwouldbetheoreticallypossibletoconstantlyadjustdeltasothat
\[
\Delta=\frac{\partialV}{\partialS}.
\]
Wethereforecancelthefirstandlasttermtoarriveat
\[
{\textd}\Pi=\frac{\partialV}{\partialS}\,{\textd}S+\frac{1}{2}\,\sigma^2S^2\frac{\partial^2V}{\partialS^2}\,{\textd}t.
\]
Becauseitshouldnotbepossibletoearnariskfreeprofitoffoftheoptionthatisgreaterthan
theriskfreerateofreturn(whichwewilldenotehereasr),wealsohave
\[
{\textd}\Pi=r\,\Pi\,{\textd}t=r\left(V-\DeltaS\right){\textd}t=
r\left(V-\frac{\partialV}{\partialS}\,S\right){\textd}t
\]
becausetheriskfreeratewillearntheproductofthevalueofourportfolio,
therateofreturn,andtimeelapsed.Therefore,
\[
\frac{\partialV}{\partialt}\,{\textd}t+\frac{1}{2}\,\sigma^2S^2
\frac{\partial^2V}{\partialS^2}\,{\textd}t=r\left(V-
\frac{\partialV}{\partialS}\,S\right){\textd}t.
\]
Upondroppingdt,itfollows
\[
\frac{\partialV}{\partialt}+\frac{1}{2}\,\sigma^2S^2\frac{\partial^2V}{\partialS^2}=r\left(V-\frac{\partialV}{\partialS}\,S\right).
\]
ThisgivestheBlack--Scholesequation:
\[
\frac{\partialV}{\partialt}+\frac{1}{2}\,\sigma^2S^2\frac{\partial^2V}{\partialS^2}+rS\,\frac{\partialV}{\partialS}-r\,V=0.
\]
ThepriceofanoptionV(S,t)isdefinedfor0K,
thenthecontractisworthS-K.However,ifS<
K,thenthecontractisworthlessbecausethereisnopointinexercising
yourrighttobuyatKwhenyoucanjustbuyatthemarketprice
S,whichisless.Thesecondconditionstatesthatthecallisworthless
ifthestockpriceis0.Becauseweassumedthatthestockwouldfollow
GeometricBrownianMotion,apriceof0wouldimplythatthepricewouldstay
at0forever,sincemovementsareproportionalinmagnitudetothestockprice.
Thereforethereisnovaluetoacallcontractifthepriceofthestockis0
(assumingthestrikepriceispositive).
Weapplythetransformation\(u=V\,e^{−rt}\)
(or\(V=u\,e^{rt}\))andaccordingly
\(e^{rt}\frac{\partialu}{\partialS}=
\frac{\partialV}{\partialS}\)and
\(e^{rt}\frac{\partial^2u}{\partialS^2}=
\frac{\partial^2V}{\partialS^2}\)
totheBlack--Scholesequation
\[
\frac{\partialV}{\partialt}+\frac{1}{2}\,\sigma^2S^2\frac{\partial^2V}{\partialS^2}+rS\,\frac{\partialV}{\partialS}-r\,V=0.
\]
toobtain
\[
r\,e^{rt}u+e^{rt}\frac{\partialu}{\partialt}+\frac{1}{2}\,\sigma^2S^2
e^{rt}\frac{\partial^2V}{\partialS^2}+rS\,e^{rt}\frac{\partialu}{\partialS}-r\,e^{rt}u=0.
\]
Thisissimplifiedto
\[
e^{rt}\frac{\partialu}{\partialt}+\frac{1}{2}\,\sigma^2S^2
e^{rt}\frac{\partial^2V}{\partialS^2}+rS\,e^{rt}\frac{\partialu}{\partialS}=0,
\]
whichuponeliminatingthecommonexponentialmultipleyields
\[
\frac{\partialu}{\partialt}+\frac{1}{2}\,\sigma^2S^2
\frac{\partial^2V}{\partialS^2}+rS\,\frac{\partialu}{\partialS}=0,
\]
Fromhere,wecanattempttomakethesubstitutions
\(S=e^y\)and
\(t=T-\tau\)totransform
u(S,t)tou(y,τ).
Thisshouldlikewisetransform
\(\frac{\partial}{\partialS}\)to
\(\frac{1}{S}\,\frac{\partial}{\partialy}\)and
\(\frac{\partial}{\partialt}\)to
\(-\frac{\partial}{\partial\tau}.\)
Wecanalsoderive
\[
\frac{\partial}{\partialS^2}=-\frac{1}{S^2}\,\frac{\partial}{\partialy}
+\frac{1}{S}\,\frac{\partial}{\partialS}\,\frac{\partial}{\partialy}=
-\frac{1}{S^2}\,\frac{\partial}{\partialy}
+\frac{1}{S^2}\,\frac{\partial}{\partialy^2}.
\]
Makingthesesubstitutionsandgroupingthe
\(\frac{\partialu}{\partialy}\)terms,we
arriveat
\[
-\frac{\partialu}{\partial\tau}+\frac{1}{2}\,\sigma^2
\frac{\partial^2u}{\partialy^2}+\left(r-\frac{1}{2}\,\sigma^2\right)
\frac{\partialu}{\partialy}=0.
\]
Weuseonelasttransformation,
\[
z=y+\left(r-\frac{1}{2}\,\sigma^2\right)\overline{\tau}\qquad
\mbox{and}\qquad\overline{\tau}=\tau,
\]
andthecorrespondingrelationships
\(\frac{\partial}{\partialy}=\frac{\partial}{\partialz}
\)and
\[
\frac{\partial}{\partial\overline{\tau}}=\frac{\partial}{\partial\tau}\,
\frac{\partial\tau}{\partial\overline{\tau}}+\frac{\partial}{\partialy}\,
\frac{\partialy}{\partial\overline{\tau}}=
\frac{\partial}{\partial\tau}-\left(r-\frac{1}{2}\,\sigma^2\right)
\frac{\partial}{\partialy}.
\]
WecansubstitutealltheseequationsintoBlack--Scholesequationtoobtain
\[
-\frac{\partialu}{\partial\overline{\tau}}-\left(r-\frac{1}{2}\,
\sigma^2\right)\frac{\partialu}{\partialz}+
\frac{1}{2}\,\sigma^2\frac{\partial^2u}{\partialz^2}+
\left(r-\frac{1}{2}\,
\sigma^2\right)\frac{\partialu}{\partialz}=0,
\]
whichcanbesimplifiedfurthertotheheatequation:
\[
\frac{\partialu}{\partial\overline{\tau}}=\frac{1}{2}\,\sigma^2
\frac{\partial^2u}{\partialz^2}
\]
Theinitialconditionistransformedto
\[
u(z,\tau)=e^{-r(T-\tau)}\,V\left(e^{z-(r-\sigma^2/2)},T-\tau
\right)\qquad\Longrightarrow\qquadu(z,0)=e^{-rT}\,V\left(e^z,T
\right)=e^{-rT}\,\max\left(0,e^z-K\right).
\]
Ourfinalresultissimplytheheatdiffusionequation
\(\frac{\partialu}{\partialt}=k\,
\frac{\partial^2u}{\partialx^2}\)subjecttotheinitialcondition
u(x,0)=φ(x).Itssolutionisknowntobe
\[
u(x,t)=\frac{1}{\sqrt{4\pikt}}\,\int_{-\infty}^{\infty}
e^{-(x-y)^2/(4kt)}\,\varphi(y)\,{\textd}y.
\]
Ifweplugourvaluesintothissolution,anddosomealgebratoreplacesome
ofthetransformedvariableswiththeoriginals(usingdifferentvariable
namestoavoidconfusionwiththeonesusedbefore),wehave
\[
V(S,t)=\frac{e^{-r\tau}}{\sqrt{2\pi\sigma^2\tau}}\,\int_{-\infty}^{\infty}
\exp\left\{-\frac{\left(r-\sigma^2/2\right)\tau+\ln(S)-\eta}{2\sigma^2\tau}\right\}\max\left(0,e^{\eta-K}\right){\textd}\eta,
\]
whichevaluatestotheBlack--ScholesFormula
\[
V(S,\tau)=S\,\Phi\left(d_1(S,\tau)\right)-K\,e^{-r\tau}\Phi
\left(d_2(S,\tau)\right),
\]
where
\[
\begin{split}
d_1(S,\tau)&=\frac{1}{\sigma\sqrt{\tau}}\left[\ln\frac{S}{K}+
\left(r+\frac{1}{2}\,\sigma^2\right)\tau\right],\\
d_2(S,\tau)&=\frac{1}{\sigma\sqrt{\tau}}\left[\ln\frac{S}{K}+
\left(r-\frac{1}{2}\,\sigma^2\right)\tau\right],
\end{split}
\]
whereΦisthenormalcumulativedistributionfunctionandτ=T-t.
UsingthesolutiontotheBlack-Scholesequation,wecansimulatethepriceof
acallorputcontractexpiringonSept1,2018withvariousstrikeprices,
startingayearbeforethatonSept1,2017.matlabcodeusedforthe
approximationisshownbelow:
functionbs
K=2600:100:3100;%strikeprices
n=numel(K);
sigma=xlsread('VIX','sheet');%volatility
S=xlsread('SP500','sheet');
%Callprices
figure
holdon
fori=1:n
cblackscholes(K(i),false,sigma,S)
end
labels('Call');
legend('location','NorthWest')
%Putprices
figure
holdon
fori=1:n
cblackscholes(K(i),true,sigma,S)
end
labels('Put');
end
functioncblackscholes(K,isput,sigma,S)
%constants
r=0.02;%riskfreeinterestrate
T=1;%day
n=length(S);
t=linspace(0,1,n);
call(n)=0;%memoryallocation
fori=1:n
tau=T-t(i);
d1=1/(sigma(i)*sqrt(tau))*(log(S(i)/K)+(r+sigma(i)^2/2)*tau);
d2=d1-sigma(i)*sqrt(tau);
call(i)=N(d1)*S(i)-N(d2)*K*exp(-r*tau);%Black-Scholesforumla
ifisput
call(i)=call(i)-S(i)+K*exp(-r*tau);
end
end
plot(t,call)
end
functionwt=N(d)%CDFofnormaldistribution
pd=makedist('Normal');%Makeprobabilitydistribution
wt=cdf(pd,d);
end
functionlabels(cp)
legend('K=2600','K=2700','K=2800','K=2900','K=3000','K=3100')
xlabel('TimeElapsed,years')
ylabel([cp,'Price,$'])
title(['Black-ScholesSimulated',cp,'PricesforS&P500,8/17-8/18'],'fontsize',12)
holdoff
end
UsingthiscodeanddataVIXandSP500,wegeneratethefollowinggraphs:
BlackScholessimulatedPutPricesS&P5008/17--8/18
BlackScholessimulatedCallPricesS&P5008/17--8/18
References
Black,FischerandScholes,Myron(1973)."ThePricingofOptionsandCorporateLiabilities".JournalofPoliticalEconomy.81(3):637--654.doi:10.1086/260062
Bodie,Zvi,Kane,Alex,andMarcus,Alan,Investments,11thEdition,McGraw-HillEducation,2018.
Dunbar,StevenR.,SolutionoftheBlack-ScholesEquation,StochasticProcessesandAdvancedMathematicalFinance.
Esekon,JosephEyang’an,AnalyticsolutionofanonlinearBlack--Scholesequation,InternationalJournalofPureandAppliedMathematics,Volume82No.42013,547--555.
Evans,Lawrence,AnIntroductiontoStochasticDifferentialEquations,Version1.2,DepartmentofMathematicsofUCBerkeley.Berkeley,CA.
Hull,JohnC.(1997).Options,Futures,andOtherDerivatives.PrenticeHall.ISBN0-13-601589-1.
Kumar,S,Yildirim,A,Khan,Y,Jafari,H,Sayevand,K,andWei,L,AnalyticalsolutionoffractionalBlack--ScholesEuropeanoptionpricingequationbyusingLaplacetransform,ournalofFractionalCalculusandApplications,Vol.2.Jan2012,No.8,pp.1-9.
ISSN:2090-5858.
http://www.fcaj.webs.com/
Manafian,JalilandPaknezhad,Mahnaz,AnalyticalsolutionsfortheBlack--Scholesequation,ApplicationsandAppliedMathematics:
AnInternationalJournal,Vol.12,Issue2,(December2017),pp.843--852.
Merton,RobertC.(1973)."TheoryofRationalOptionPricing".BellJournalofEconomicsandManagementScience.TheRANDCorporation.4(1):141–183.doi:10.2307/3003143.
Stecher,Michael,ConvertingtheBlack-ScholesPDEtotheheatequation
Stehlíková,Beáta,Black-Scholesmodel:Derivationandsolution
Yalincak,OrhunHakan.CriticismoftheBlack-ScholesModel:ButWhyisItStillUsed?:(The
AnswerisSimplerthantheFormula).NewYorkUniversity.NewYork,NY,2005.
延伸文章資訊
- 1MATLAB tutorial 2.6: Black Scholes model - Fluids at Brown
This model was later built out by Fischer Black and Myron Scholes to develop the Black--Scholes p...
- 2(PDF) Analog of the Black-Scholes formula for option pricing ...
For this model, we derive the Black-Scholes equation and formula, which describe the pricing of t...
- 3[衍生商品] 淺談Black-Scholes Model 的性質(0) - 謝宗翰的隨筆
這次要跟大家介紹衍生商品市場的Black-Scholes Model (B-S model),此Formula 是由Professor Fisher Black, Myron Scholes 與...
- 4The Black-Scholes formula, explained | by Jørgen Veisdal
The Black–Scholes model is a mathematical model simulating the dynamics of a financial market con...
- 5布萊克-休斯模型- 維基百科,自由的百科全書
布萊克-休斯模型(英語:Black-Scholes Model),簡稱BS模型,是一種為衍生性金融商品中的選擇權定價的數學模型,由美國經濟學家麥倫·舒爾斯與費雪·布萊克首先提出。