您好,欢迎访问三七文档
当前位置:首页 > 金融/证券 > 金融资料 > 金融工程非常简要的通过Matlab介绍(pdf11)英文(1)
AVeryBriefIntroductiontoFinancialEngineeringviaMatlabDrBradBaxterSchoolofEconomics,MathematicsandStatisticsBirkbeckCollege,LondonW1CE7HXb.baxter@bbk.ac.ukhttp:cato.tzo.com/brad/»baxter.htmlThesenotesprovideaverybriefintroductiontopricingEuropeanoptions.ThissketchisthelatestversionofashortintroductionwrittenforbeginningquantsatCommerzbank,writtenwhileconsultinginFrankfurt.Italsoserved,inmodi¯edform,asabriefintroductionforstudentsontheMScinMathematicalFinance,whenIwaslecturingatImperialCollege.Thelatestincarnationdi®ersfromtheseinthatit'sbasedonMatlab.1.AbriefintroductiontoEuropeanoptionsThesenotesarefairlyself-contained:somereviewofprobabilitytheoryisdiscussedinaseparatesection,andbackgroundinformationiskepttoamin-imum.Further,therearemanyimportantpointsthataremerelysketchedhere,butwillbediscussedindetailduringtheprincipalcourses.AEuropeanoptionisanyfunctionf´f(S;t)thatsatis¯estheequationf(S(t);t)=e¡rhEf(S(t+h);t+h);foranyh0:(1.1)Hereristherisk-freeinterestrate,whichistheinterestrateforacurrencypaidbyacentralbank.It'snotreallyrisk-free,butisfarmorereliablethanotherinvestments,andweshallassumethatit'sconstant.TheassetpriceS(t)evolvesrandomlyaccordingtoamathematicalmodelcalledgeometricBrownianmotion.Itsfullde¯nitionisrathercomplicated,butthecrucialequationisS(t+h)=S(t)exp((r¡¾2=2)h+¾phZt´;foranyh0;(1.2)where¾isapositiveconstantcalledthevolatilityoftheasset.Therandom-nessisprovidedbytherandomvariableZt,whichisanormalizedGaussianrandomvariable(i.e.meanzeroandvarianceone).Inparticular,togener-atesamplepricesS(T)atsomefuturetimeTgiventheinitialpriceS(0),weuseS(T)=S(0)exp((r¡¾2=2)T+¾pTZT´;whereZT»N(0;1):(1.3)2BradBaxterTherearemanyimportantdetailsomittedhere,butwecanlearnagreatdealbystudyingthemathematicalconsequencesof(1.1)and(1.2).Weseethat(1.1)describesacontractf(S;t)whosecurrentvalueisthediscountedvalueofitsexpectedfuturevalue.Example1.1.AplainvanillaEuropeanputoptionisaEuropeanoptionforwhichthefunctionfP(S;t)obeystheconditionfP(S(T);T)=(K¡S(T))+;(1.4)whereTiscalledtheexpirytimeoftheoption,theconstantKiscalledtheexerciseprice,and(z)+:=maxfz;0g.ThisissimplyaninsurancecontractthatallowsustoselloneunitoftheassetattheexercisepriceKattimeTinthefuture.Iftheasset'spriceS(T)islessthanKatthisexpirytime,thentheoptionisworthK¡S(T),otherwiseit'sworthless.Suchcontractsprotectusifwe'reworriedthattheasset'spricemightdrop.Often,weknowthevalueoftheoptionf(S(T);T)forallvaluesoftheassetS(T)atsomefuturetimeT.Ourproblemistocomputeitsvalueatsomeearliertime,becausewe'rebuyingorsellingthisoption.Example1.2.AplainvanillaEuropeancalloptionisaEuropeanoptionforwhichthefunctionfC(S;t)obeystheconditionfC(S(T);T)=(S(T)¡K)+;(1.5)usingthesamenotationasExample1.1.ThisgivesustherighttobuyoneunitoftheassetattheexercisepriceKattimeT.Iftheasset'spriceS(T)exceedsKatthisexpirytime,thentheoptionisworthS(T)¡K,otherwiseit'sworthless.Suchcontractsprotectusifwe'reworriedthattheasset'spricemightrise.Howdowecomputef(S(0);0)?Thedi±cultpartiscomputingtheex-pectedfuturevalueEf(S(T);T).Thiscanbedoneanalyticallyforatinynumberofoptions,includingtheEuropeanPutandCall(seeTheorem1.2),butusuallywemustresorttoanumericalcalculation.Thisleadsustoour¯rstalgorithm:MonteCarlosimulation.HerewechoosealargeintegerNandgenerateNpseudo-randomnumbersZ1;Z2;:::;ZNthathavethenor-malizedGaussiandistribution;inMatlab,wesimplywriteZ=randn(N,1).Using(1.2),thesegeneratethefutureassetpricesSk=S(0)exp³(r¡¾22)T+¾pTZk´;k=1;:::;N:(1.6)Wethenapproximatethefutureexpectedvaluebyanaverage,thatis,wetakef(S(0);0)¼e¡rTNNXk=1f(Sk;T):(1.7)BriefIntroductionviaMatlab3MonteCarlosimulationhasthegreatadvantagethatitisextremelysimpletoprogram.Itsdisadvantageisthattheerrorisusuallyamultipleof1=pN,sothatverylargeNisneededforhighaccuracy(eachdecimalplaceofaccuracyrequiresaboutahundredtimesmorework).Wenotethat(1.7)willcomputethevalueofanyEuropeanoptionthatiscompletelyde¯nedbyaknown¯nalvaluef(S(T);T).WeshallnowuseMonteCarlotoapproximatelyevaluatetheEuropeanCallandPutcontracts.Infact,Put-Callparity,describedbelowinTheorem1.1,impliesthatweonlyneedaprogramtocalculateoneofthese,becausetheyarerelatedbythesimpleformulafC(S(0);0)¡fP(S(0);0)=S(0)¡Ke¡rT:(1.8)Here'stheMatlabprogramfortheEuropeanPut.%%ThesearetheparameterschoseninExample11.6of%OPTIONS,FUTURESANDOTHERDERIVATIVES,%byJohnC.Hull(PrenticeHall,4thedn,2000)%%%initialstockpriceS0=42;%unitoftime=year%250workingdaysperyear%continuouscompoundingrisk-freerater=0.1;%exercisepriceK=40;%timetoexpirationinyearsT=0.5;%volatilitysigma=0.2;%generateassetpricesatexpiryZ=randn(N,1);ST=S0*exp((r-(sigma^2)/2)*T+sigma*sqrt(T)*Z);%calculateputcontractvaluesatexpiryfput=max(K-ST,0.0);%averageputvaluesatexpiryanddiscounttopresentmc_put=exp(-r*T)*sum(fput)/N%calculateanalyticvalueofputcontractwK=(log(K/S0)-(r-(sigma^2)/2)*T)/(sigma*sqrt(T));a_put=K*exp(-r*T)*Phi(wK)-S0*Phi(wK-sigma*sqrt(T))Thisprogram,andtheutilityfunctionPhi.m,canbeobtainedfrommyhomepage.4BradBaxterWehaveonlyrevealedthetipofamassiveiceberginthisbriefintroduc-tion.Firstly,theBlack-Scholesmodel,whereassetpricesevolv
本文标题:金融工程非常简要的通过Matlab介绍(pdf11)英文(1)
链接地址:https://www.777doc.com/doc-251230 .html