(8)统计与金融首先用with命令载入工具包stats、finance。restart;with(stats);with(finance);金融工具包(本工具包内容未做汉化)Thefinancepackageassistsyouinperformingfinancialcalculations.Withit,youcancalculatethepresentvalueandaccumulatedvalueofannuities,growingannuities,perpetuities,growingperpetuitiesandlevelcouponbonds.Moreover,itcanalsohelpyoucomputetheyieldtomaturityofabond.Youcanconstructanamortizationtable,determinetheeffectiverateofinterestforagivencompoundinterestrate,andfindthepresentvalueandfuturevalueofafixedquantityforagivencompoundinterestrate.Note:allexamplesusedollars($)andinterestratesareintermsofpercent(%).Moreover,thedefaultsettingforfloatingpointprecisionis10.RoundupeachanswerthatMaplefindstothenearestcent.AmortizationMethodThemostcommonmethodofrepayinginterest-bearingloansistheamortizationmethod.Thisprocedureisusedtoliquidateaninterest-bearingdebtbyaseriesofperiodicpayments,usuallyequal,atagiveninterestrate.YoumayuseMapletodeterminehowmanypaymentsarerequiredtopayofftheloan,usingtheamortizationcommand.Youcanalsocreateamortizationtables.Adebtof$100withinterestat10%perannumistobeamortizedbypaymentsof$50attheendofeachyearforaslongasnecessary.A:=amortization(100,50,0.10);Theoutputfromthecommandaboveissummarizedinthetablebelow.Fromtheresultweseethatyoumustmakethreepayments:$50,$50and$17.60.Thelastresultintheoutput,$17.60,isthecostoftheloan.amortization_table[n,Payment,Interest,Principal,Balance]=matrix(A[1]);Thefirstcolumnofthematrixreferstothepaymentnumber.Thesecondcolumnshowsthepaymentpertimeperiod.Thethirdcolumnishowmuchofthepaymentgoestowardspayingofftheinterest.Thefourthreferstohowmuchgoestopayofftheprincipalperpayment.Thelastcolumnistheoutstandingbalanceofthedebt.AnnuitiesMaplecanfindthepresentvalueofordinarysimpleannuities.Supposeyouwanttofindthepresentvalueofanannuitypaying$100perannum,for5years,startingin1yearfromnow,atanannualinterestrateof10%.annuity(100,0.10,5);Consideragrowing(increasing)annuitythatpays$100attheendofthefirstyear,thengrowsat5%perannum.Itisafive-yearannuityandtheannualrateofinterestis10%.Usethegrowingannuitycommand.growingannuity(100,0.1,0.05,5);Iftheinterestratechangesto%andthegrowthrateisunknown(callit),thenthefuturevalueisgivenbytheformulabelow.growingannuity(100,0.1/12,g,5*12);Asafinalexample,analyzethecasewherethepaymentspertimeperiodarenotfixed.Supposeyouwanttofindthepresentvalueofvariablerevenuesexpectedfromaproject.Attheendofyearone,theprojectexpects$200inrevenue,and$150and$100inyearstwoandthreerespectively.Theopportunitycostofcapitalis7.8%.cashflows([200,150,100],0.078);Youmaygeneralizetheaboveresult.Ifthediscountrateis%,thepresentvalueofthebenefitsearnedfromtheprojectisgivenbythecashflowscommand.cashflows([200,150,100],r);BondsWhenacorporationorgovernmentneedstoborrowalargesumofmoneyforareasonablylongperiodoftime,theyissuebondswhichtheyselltoinvestors.A$1000bondthatpaysinterestat%(bondrate)isredeemableatparattheendoffiveyears.Supposeyouwanttofindthepurchasepriceofthebondtoyieldaninvestor14%compoundedsemi-annually.(Note:theyieldratealwayscomesbeforethecouponrate).levelcoupon(1000,.14/2,.10/2,5*2);Theresultshowsthatthebondispurchasedatadiscount,sincetheopportunitycostofcapitalishigherthanthebondrate.Supposeyouwanttofindtheyieldratetomaturityofabond.Supposealargecorporationissuesa15-yearbondthathasafacevalueof$10000000,andpaysinterestatarateof%.Ifthepurchasepriceofthebondis$11729203.32,theyieldtomaturityforthebondisfoundbytheyieldtomaturitycommand.yieldtomaturity(11729203.32,10000000.00,.10/2,30);Thatis,approximately4%perhalf-year,or%.EffectiveInterestRatesForagivennominalrateofinterestcompoundedtimesperyear,theannualeffectiverateofinterestistheratejwhich,ifcompoundedannually,willproducethesameamountofinterestperyear.Computetheannualeffectiverateofinterestto%effectiverate(.1325,365);Theannualeffectiverateworksouttobeabout14.17%.Theeffectiveannualrateofinterestcorrespondingto%iscalculatedasfollows.effectiverate(r,m);Asanotherexample,tofindtherateequivalentto%,enterthefollowingcommand.4*effectiverate(.10/4,2/4);Theannualeffectiverateisapproximately9.88%.Recallthatistheannualinterestratethatiscompoundedmtimesperannum.Thecontinuouscompoundrateisthenominalinterestratethatiscompoundedwithoutlimit,orcontinuously.Typicalnotationforthisis.Forinstance,theannualeffectiverateofinterestequivalentto=15%iscomputedasfollows.effectiverate(.15,infinity);InterestFormulasIfistheprincipalatthebeginningofthefirstinterestperiod,istheaccumulatedvalueattheendofperiods,andistheinterestratepertimeperiod,then.Usethefuturevaluecommandtofindandthepresentvaluecommandtodetermine.Supposeyoudeposit$100inthebankandearninterestat10%perannum.Thefollowingcommandfindstheaccumulatedvalueattheendoffouryears.futurevalue(100,.10,4);Ifyouwant$146.41infouryearsfromnow,howmuchmoneymustyouinvestnowataninterestrateof10%?presentvalue(146.41,.10,4);Youcanextendthefirstexampletothefundamentalcompoundinterestformula.Ifistheprincipalatthebeginningofthefirstinterestperiod,istheaccumulatedvalueattheendofperiods,andistheinterestratepe