Professional Financial Computing Using Excel And VBA

1y ago
18 Views
3 Downloads
6.11 MB
352 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Emanuel Batten
Transcription

ProfessionalFinancialComputing UsingExcel and VBA

ProfessionalFinancialComputing UsingExcel and VBAHUMPHREY K. K. TUNG,DONNY C. F. LAI, andMICHAEL C. S. WONGwith STEPHEN NGJohn Wiley & Sons (Asia) Pte. Ltd.

Copyright # 2010 John Wiley & Sons (Asia) Pte. Ltd.Published in 2010 by John Wiley & Sons (Asia) Pte. Ltd.2 Clementi Loop, #02–01, Singapore 129809All rights reserved.No part of this publication may be reproduced, stored in a retrieval system, or transmitted inany form or by any means, electronic, mechanical, photocopying, recording, scanning, orotherwise, except as expressly permitted by law, without either the prior written permission ofthe Publisher, or authorization through payment of the appropriate photocopy fee to theCopyright Clearance Center. Requests for permission should be addressed to the Publisher,John Wiley & Sons (Asia) Pte. Ltd., 2 Clementi Loop, #02–01, Singapore 129809,tel: 65–6463–2400, fax: 65–6463–4605, e-mail: enquiry@wiley.com.This publication is designed to provide accurate and authoritative information in regard to thesubject matter covered. It is sold with the understanding that the publisher is not engaged inrendering professional services. If professional advice or other expert assistance is required, theservices of a competent professional person should be sought.Neither the authors nor the publisher are liable for any actions prompted or caused by theinformation presented in this book. Any views expressed herein are those of the authors and donot represent the views of the organizations they work for.Other Wiley Editorial OfficesJohn Wiley & Sons, 111 River Street, Hoboken, NJ 07030, USAJohn Wiley & Sons, The Atrium, Southern Gate, Chichester, West Sussex, P019 8SQ,United KingdomJohn Wiley & Sons (Canada) Ltd., 5353 Dundas Street West, Suite 400, Toronto, Ontario,M9B 6HB, CanadaJohn Wiley & Sons Australia Ltd., 42 McDougall Street, Milton, Queensland 4064, AustraliaWiley-VCH, Boschstrasse 12, D-69469 Weinheim, GermanyLibrary of Congress Cataloging-in-Publication DataISBN 978–0–470–82439–9Typeset in 10.5/13pt Sabon-Roman by Thomson Digital, IndiaPrinted in Singapore by Toppan Security Printing Pte. Ltd.10 9 8 7 6 5 4 3 2 1

ContentsPrefaceixCHAPTER 1Financial Engineering and Computing11.11.21.31.41.5.1.6Financial Engineering and Spreadsheet ModelingLehman Brothers’ Products for Retail InvestorsRisk Management and Basel IIAbout the BookChapter HighlightsOther RemarksCHAPTER 2The GARCH(1,1) Model2.1. The Model2.2. Excel Implementation2.3. Excel Plus VBA ImplementationCHAPTER 3Finite Difference Methods3.1.3.2.3.3.3.4.13446799101521Difference EquationsExcel ImplementationVBA ImplementationCrank–Nicholson Scheme21242833CHAPTER 4Portfolio Mean-Variance Optimization374.1. Portfolio Selection4.2. Excel Implementation4.3. Excel Plus VBA Implementation374248v

CONTENTSviCHAPTER 5Newton–Raphson Method5.1. Newton–Raphson Method for Systems of Equations5.2. VBA Routine595961CHAPTER 6Yield Curve Construction Using Cubic Spline676.1. Cubic Spline Interpolation6.2. Yield Curve Construction6.3. Excel Plus VBA Implementation677577CHAPTER 7Binomial Option Pricing Model7.1. Risk-Neutral Option Pricingand the Binomial Tree7.2. VBA ImplementationCHAPTER 8The Black–Derman–Toy Model8.1. The Term Structure Model andthe Black–Derman–Toy Tree8.2. Excel Plus VBA ImplementationCHAPTER 9Monte Carlo Option Pricing9.1.9.2.9.3.9.4.9.5.The Monte Carlo MethodRisk-Neutral ValuationVBA ImplementationExotic OptionsAmerican OptionsCHAPTER 10Portfolio Value-at-Risk10.1.10.2.10.3.10.4.10.5.Portfolio Risk SimulationMonte Carlo Simulation for Multiple-Asset PortfoliosHistorical Simulation for Multiple-Asset PortfoliosVBA Implementation of Portfolio Risk SimulationDrill Down of Portfolio 80

viiContentsCHAPTER 11The Hull–White Model11.1.11.2.11.3.11.4.Hull–White Trinomial TreeExcel Plus VBA ImplementationThe General Hull–White ModelImplementation of the GeneralHull–White ModelCHAPTER 12CreditMetrics Model12.1.12.2.12.312.4.The CreditMetrics ModelIndividual (Segregate) Asset Valuation FrameworkMonte Carlo Simulation in DetailExcel and VBA ImplementationCHAPTER 13KMV–Merton Model13.1. KMV–Merton Model of Credit Risk13.2. Excel and VBA ImplementationAPPENDIX AVBA ProgrammingA.1 IntroductionA.2 A Brief History of VBAA.3 Essential Excel Elements for VBAA.3.1 Excel Cell ReferenceA.3.2 Excel Defined NamesA.3.3 Excel Worksheet FunctionsA.4 The VBA Development Environment (VBE)A.4.1 The Developer Tab in the RibbonA.4.2 The Windows of VBEA.4.3 The Project ExplorerA.4.4 The VBA Project StructureA.4.5 The Procedure to Create a VBA SubroutineA.4.6 The Procedure to Create a VBA FunctionA.5 Basic VBA Programming ConceptsA.5.1 Variables and Data TypesA.5.2 Declaration and Assignment StatementsA.5.3 Flow Control StatementsA.6 VBA 00

CONTENTSviiiA.7A.8Using Worksheet Matrix Functions in VBASummary304311APPENDIX BThe Excel Object Model315APPENDIX CVBA Debugging Tools321APPENDIX DSummary of VBA Operators327APPENDIX ESummary of VBA Functions331APPENDIX FSummary of VBA Statements333APPENDIX GExcel Array Formula341Index349

PrefaceThis book is a good company to Master degree programs in FinancialEngineering, Financial Risk Management, Quantitative Investment,Computational Finance, or Mathematical Finance. Also, risk managers,traders, IT analysts, quantitative analysts working in investment banks andhedge fund will find it to be a good reference.The book provides VBA examples on some widely-used finance and riskmodels. We expect that readers have prior training on these models becausesome of them require strong mathematical foundation. Through theexamples, readers can easily build their implementable analytics and applysimilar skills to other complex models.Feedbacks from professors, students, analysts, and risk professionalsare warmly welcome.Humphrey TungDonny LaiMichael WongStephen NgEmail: efmcw103@gmail.comix

Professional Financial Computing Using Excel and VBAby Humphrey K. K. Tung, Donny C. F. Lai, Michael C. S. Wong and Stephen NGCopyright 2010 John Wiley & Sons (Asia) Pte. Ltd.CHAPTER1Financial Engineeringand Computing1.1 FINANCIAL ENGINEERING AND SPREADSHEETMODELING‘‘Spreadsheet Modeling for Finance’’ has long been a popular course in theMSc Financial Engineering program at the university we served in HongKong. The course is different from introductory Excel courses in financialmanagement. It is an advanced course offered mainly to students with solidtraining in mathematical finance, option pricing, and risk modeling. Mostof the students in the course have been designated a chartered financialanalyst (CFA) or certified as a financial risk manager (FRM). The financialengineering program mainly recruits part-time students working in variousfinancial institutions. There are around 40 to 60 new recruits each year. Manyof them are derivatives traders, bank risk managers, bank IT specialists, fundmanagers, product structurers, bank regulators, and product auditors. In1997–2008, the program trained more than 500 graduates. Most of themsuccessfully applied the knowledge gained to their daily work.Some may ask why no ‘‘quantitative analysts’’ are mentioned. Looselyspeaking, these financial engineering graduates are quantitative analysts innature. Strictly speaking, none of them carries the job title ‘‘quantitativeanalyst.’’ A global investment bank may have one or two quantitativeanalysts and/or financial engineers in Hong Kong. Given the presence of15 global institutions, there are a maximum of 10 quantitative analystjob vacancies a year. This number cannot satisfy the continuous supply offinancial engineering graduates every year. Although our graduates are notcalled quantitative analysts, their training in financial engineering did helptheir fast career development. Also, their quantitative skills have enabledHong Kong to excel in financial services.1

2PROFESSIONAL FINANCIAL COMPUTING USING EXCEL AND VBAWhen we planned this book in 2007, the financial market in Hong Kongwas very bullish. Many China initial public offering (IPO) deals werecompleted in Hong Kong. The Hang Seng Index reached over 30,000 points.Structured products and hedge funds were prevalent in corporate bankingand private banking. Equity-linked notes, minibonds, and currency-linkedproducts were common in retail banking.In addition to sizable financial institutions, Hong Kong is a hub ofboutique hedge funds. It is believed that there are 600 or more. These hedgefunds employ few people, but their asset under management (AUM) can beover US 100 million each. In these hedge funds, financial and risk analysis ismostly based on Excel and Visual Basic for Applications (VBA) programming.This is a reason why the course ‘‘Spreadsheet Modeling’’ is very popular.Our progress in writing this book was hindered by the financial tsunamiin 2008. High market volatility, depreciation of wealth, and massive layoffs inthe banking sector brought a lot of frustration to financial practitioners andfinancial educators. When we completed this book in June 2009, the marketremained very weak. Many wealthy individuals suffered huge losses in thepast 12 months; financial institutions cut their manpower seriously; sellingcomplex products became difficult; and new regulations were enacted relatingto structured products. In 2009, students in the course ‘‘Spreadsheet Modeling’’ still enjoyed the class but were slightly worried outside of the class. Thisis because the next round, which would be the fourth or fifth round, ofmassive layoffs would affect them. Investment banking follows obviousbusiness cycles. This applies to study programs in financial engineering as well.Mature students are always pragmatic in acquiring knowledge.Complex mathematics is very fancy, but our mature students tend to take itfor granted and focus mostly on the applications of the mathematics. Thecourse ‘‘Spreadsheet Modeling’’ makes those fancy mathematical conceptsmore easily applicable. From the perspective of educators, this mindsetof the students is not harmful. After using Excel and VBA to build theirmodels, some students become more interested in complex mathematics.What we would like them to know is not simply building models forfinancial analysis. We wish that they could understand model risks andestimate when these risks are likely to occur. The increased curiosity of ourstudents after the course made us feel satisfied about our educational efforts.Many new financial products have no mathematical models. Dueto the advancement of technology, an analyst can easily apply MonteCarlo simulation on related variables and find out an average value. Ourstudents especially like this analytical approach because there is less of amathematical foundation required. In fact, Excel and VBA can easily handleMonte Carlo simulation.

Financial Engineering and Computing31.2 LEHMAN BROTHERS’ PRODUCTS FORRETAIL INVESTORSSince 2005, Lehman Brothers began actively distributing a wide range ofstructured products via retail banks in Hong Kong, as well as in Singapore.One of our former financial engineering students came from France. Aftergraduation, he worked in Lehman Brothers (Tokyo). A major part of hisjob was to structure products, which were finally sold to Hong Kong retailinvestors via local retail banks.These products included equity-linked notes, minibonds (collateralizeddebt obligation [CDO] with total return swaps), and index-linked guaranteed notes. The equity-linked notes could provide an annual yield of30 percent. Obviously the distribution of stock returns at that time wasasymmetric with high upside potential and limited downside risk. Theminibonds offered yields much better than bank deposits and the principlewas guaranteed by an AA/A-rated institution—Lehman Brothers. Thisrating is better than that of many local banks.Unfortunately, Lehman Brothers collapsed in September 2008. Morethan 40,000 retail investors in Hong Kong became victims. Some lostalmost all their wealth. These victims continuously demonstrated in thestreet, at the front doors of various banks, and at the entrance of theHong Kong Monetary Authority. Regulators encouraged banks tobuy back the Lehman products. Banks were unwilling to do so. TheHong Kong banking industry experienced unprecedented exposure toreputational risk. In fact, this risk has never been discussed seriously andmeasured properly.The Lehman incident made financial regulators extremely busy.Many of our financial engineering students are working for the regulatorybodies in Hong Kong. They were under serious pressure in the six-monthperiod after September 2008. To mitigate regulatory risk, the regulators inHong Kong announced a series of measures to prevent ordinary citizensfrom mistakenly buying high-risk products. These measures includedmystery shopper programs (that is somebody pretending to be a bank clientin order to test the selling process of frontline people) and audio-recordingall relevant transactions. At the same time, the legal risk of banks intensified. Misrepresentation and insufficient duty of care became thewords surrounding all financial institutions in Hong Kong. As a result,one of our authors was appointed to be an expert witness in some legaldisputes relating to complex products. Risk management in bankssuddenly became crisis management. Quantitative risk measures seemedless appealing.

4PROFESSIONAL FINANCIAL COMPUTING USING EXCEL AND VBA1.3 RISK MANAGEMENT AND BASEL IIThis book does not cover much about Basel II, which is the standard of riskmanagement for the banking sector. There is a chapter about value-at-risk(VaR) and a chapter about probability of default (PD). Both VaR and PDare fundamental to bank capital charge. This book intends to share howcomplex financial products can be priced properly with simple programming tools. Asset pricing is a cornerstone of risk management. If an assetdoes not have any pricing model, we find it hard to measure its risk andevaluate its fair value. A pricing model facilitates scenario analysis:how much the asset will gain or lose in different scenarios, including somestress scenarios.After the financial tsunami, Basel II has lost its credibility. Regulatorsobviously underestimated the impact of pro-cyclicality on credit risk. In2002–2006, our university worked closely with the Hong Kong MonetaryAuthority to promote Basel II discussion in the Hong Kong banking sector.One of our authors was also an architect of the first internal-ratings-basedsystem in Hong Kong. Basel II did help banks save capital charge. Thiscould be an incentive for banks to invest heavily in risk management systems. This is also a reason why banks were undercapitalized in the crisis.Basel II imposes capital requirements on market risk, credit risk, andoperational risk. However, the interrelationship of these three risks has notbeen considered seriously. The VaR methodology assumes normal distribution of asset returns. Many credit-linked products, such as CDOs, collateralized mortgage obligations (CMOs), and others, are marketable securitiessubject to both interest rate risk plus credit migration risk. Actual orexpected increase in credit risk can substantially lower asset prices. It seemsthat the Basel II capital requirement does not adequately address this issue.How should the correlation of credit risk and market risk be modeled? Thatis beyond the scope of this book.Liquidity risk and stress testing risk are key issues in the collapse ofbanks. These risks are covered in Pillar II of Basel II. How can liquidity riskbe modeled? Excel and VBA may help, but there is no consensus on whatassumptions should be adopted. Stress testing usually involves manyassumptions and a subjective selection of scenarios. Stress tests can be easilydone and regulators usually find it hard to challenge those test results.1.4 ABOUT THE BOOKThe main topic of this book is the practical implementation of financialmodels using Excel and VBA programming. Too often, books on

Financial Engineering and Computing5spreadsheet modeling provide only quick-and-dirty implementations offinancial models that have very little use in real-world applications. Thisbook focuses on the programming practices and skills to perform real-worldimplementation of financial models that are robust, reusable, and flexible. Ittakes an in-depth look at how to implement financial models using bothExcel and VBA, and discusses the essential programming practices and skillsin structuring complex financial models through advanced VBA features. Itprovides comprehensive coverage of financial models in the areas of derivatives pricing, market and credit risk modeling, and advanced interest ratemodeling. Each of the later chapters on model implementation starts with areview of all the necessary financial theory and concepts from a practitioner’s perspective. Step-by-step instructions on the implementation are thenprovided to explain the programming techniques involved for models withdifferent complexities. Alternative approaches are also discussed to enablereaders a comprehensive understanding of different techniques.This book is suitable for those who have solid backgrounds in financialengineering, financial modeling, and financial risk management; a master’sdegree in financial mathematics, financial engineering, or computationalfinance is preferable. CFA, FRM, or professional risk manager (PRM)qualifications will be helpful to readers, but these readers must have priortraining in calculus and matrix algebra. When we wrote this book, wesurveyed books with relevant titles. None of them were advanced enoughfor our MSc (Financial Engineering) students. Most books with titlessuch as Financial Modeling, Excel Modeling in Finance, or SpreadsheetModeling in Finance are targeted at undergraduate students in Finance orMBA students. Our book is targeted at financial engineering or mathematicalfinance students at business schools or engineering schools.The book title ‘‘Financial Computing’’ is modified from ‘‘Computational Finance.’’ When our MSc (Financial Engineering) program was firstlaunched in the 1990s, a number of professors from Carnegie MellonUniversity (CMU) served as our program advisors and teaching fellows.CMU offers a well-known program—MSc (Computational Finance).Computational Finance focuses on financial models that are based onmathematical theories and computational intelligence. Our book places lessemphasis on financial models although we provide brief summaries on thetheories mentioned in the book. We place more emphasis on how toimplement these advanced models with Excel and VBA programming. Thishelps quantitative analysts quickly develop some models for their analyticalwork. This is the reason we named the book ‘‘Financial Computing’’instead of ‘‘Computational Finance.’’ Our book covers a small number ofwell-known models and illustrates how Excel and VBA programming canbe applied to implement these models. Through these models, readers can

6PROFESSIONAL FINANCIAL COMPUTING USING EXCEL AND VBApick up Excel and VBA skills easily and apply these skills to other complexmodels. We believe that the book will be a good companion to any degreeprogram in financial engineering or financial mathematics.1.5 CHAPTER HIGHLIGHTSChapter 2 deals with the GARCH(1,1) model, which is used to predictthe volatility of asset prices. Volatility estimates are critical for derivativespricing and the volatility index can be traded. We introduce an effectiveway to use Solver in conjunction with VBA routines to enhance the functionality of Solver. Chapter 3 looks at the finite difference model, whichis frequently used in derivatives pricing based on the Black–Scholes partialdifferential equation. We discuss the use of matrix manipulation underExcel as well as the VBA programming environment. A general frameworkthat may be used to price a variety of options is formulated. Chapter 4turns to portfolio mean-variance optimization. This is the base of moderninvestment theory and investment portfolio formation. We pay particularattention to the implementation of the Markowitz algorithm under shortselling restrictions. In all these chapters, we discuss the deficiency in takinga simple Excel implementation and demonstrate the necessity of using VBAprogramming in efficiently coping with complex conditions.Chapter 5 introduces the Newton–Raphson method. This numericalprocedure is powerful in solving a system of equations, and the routinedeveloped here will be useful throughout the book. Chapter 6 discussesyield curve construction with cubic spline interpolation. We describe ageneralized bootstrapping method, a computer-intensive statistical method,in the construction of a smooth yield curve given any available data set ofbond prices. This enables the construction of an interest rate tree discussedin later chapters.Chapters 7 and 8 deal with two different tree models in option pricings:the binomial model and the Black–Derman–Toy model. The binomial modelcan be applied to a wide range of equity derivatives. It can be implementedvery easily using VBA programming. The Black–Derman–Toy model isparticularly useful for pricing interest rate derivatives. We introduce aneffective way to implement this model in VBA taking bond options as ourworking example.Chapter 9 discusses option pricing using the Monte Carlo simulationmethod, which is a powerful tool in the valuation of exotic options withcomplex payoff conditions. We discuss various important issues regardingthis method and look at the implementation for a number of exotic options.

Financial Engineering and Computing7In particular, we take a closer look at the Monte Carlo pricing of Americanstyle options with early exercising features.Chapter 10 applies simulation techniques to determine portfolio valueat-risk. This chapter aims at providing the necessary programming skills tobuild a flexible and expandable risk engine for portfolio risk simulation.Chapter 11 looks at the state-of-the-art Hull–White model of interestrates, which is commonly adopted by the industry for pricing interest ratederivatives. We discuss an effective way to implement the complex structureof this model taking bond options again as an example.Chapters 12 and 13 discuss two well-known credit risk models: theCreditMetrics model and the KMV–Merton model. We start the discussionof the CreditMetrics model with a single issuer and then move to creditmigration risk of credit portfolios. Chapter 12 focuses on the implementation of the credit RiskMetrics framework with the use of Monte Carlosimulation. In Chapter 13 we introduce the structural model developed byRobert C. Merton and extend our discussion to the KMV–Merton model.The KMV–Merton model is best applied to publicly traded firms and itsunderlying methodology predicts the probability of default of a firm withina given time horizon.Appendices A to G provide a review of Excel and VBA programming.Many engineering school graduates may be familiar with Fortran, C, or Javaand seldom touch Excel or VBA. The appendices will help these readers.In all chapters, mathematical models are briefly mentioned. Our focusis to share with readers how to write relevant VBA programs. There is nostandard programming route for a single problem. Readers may find fasterprogramming methods to achieve the same outcome. These readers arewelcome to contact us and share your better approaches with us. Practicalexercises are provided at the end of each chapter that allow the readers toapply their technical skills acquired from the chapter. The solutions to thesequestions can be downloaded through the ftp link given by http://www.cs.cityu.edu.hk/ donny/humphrey/financial computing.1.6 OTHER REMARKSWe would like to thank our students in Hong Kong for asking us challenging questions in class. This helps improve our thinking and sharpen ourteaching performance. Among all the authors, Dr. Humphrey Tung contributed the most. He carefully reviewed every equation in the book. The otherthree authors would like to thank him for his passion in this project.

Professional Financial Computing Using Excel and VBAby Humphrey K. K. Tung, Donny C. F. Lai, Michael C. S. Wong and Stephen NGCopyright 2010 John Wiley & Sons (Asia) Pte. Ltd.CHAPTER2The GARCH(1,1) Model2.1 THE MODELIn this chapter, we discuss what is known as the GARCH(1,1) model,introduced by Bollerslev.1 The distinctive feature of this model is thatvolatilities of asset price returns are not constant. Under the stochasticregime, price return rt between, for example, the end of previous day t 1and the end of day t can be generated through random normal drawings as:rt ¼ e(m; s t )ð2:1Þwith dynamical volatility st and constant mean m. The model attemptsto keep track and forecast the variations in the volatility through time.Applications of this so-called GARCH (generalized autoregressiveconditional heteroscedasticity) volatility are widespread especially in theassessment of portfolio risk exposure over a short period of time.In GARCH(1,1), future variance s 2tþ1 is a weighted average of its immediate past estimation s 2t , the most recent observation of squared residual(rt m)2, and a long-run average variance VL. It follows an iterationequation given by:s 2tþ1 ¼ gV L þ a(rt m)2 þ bs 2tð2:2Þwith weight factors a 0, b 0, and g 0. Since the total weight must sumup to one, we have:g ¼ 1 a b:Note that the constant mean m in equation (2.2) can be estimated based onits historical average. There are all together three parameters in the model,namely (VL, a, b) that satisfy the constraints,V L 0; a 0; b 0; and a þ b 1:ð2:3Þ9

PROFESSIONAL FINANCIAL COMPUTING USING EXCEL AND VBA10They can be estimated under the notion of maximum likelihood of seeingthe historical data. Given the historical time series of price returns {r1,r2, . . . , rn}, we can first estimate the constant mean historically as:m ffi (1 n)(r1 þ . . . þ rn ):For a particular choice of model parameters, GARCH volatilities {s1,s2, . . . , sn} can be generated through equation (2.2) where the iterationstarts off from observation r1 and estimate s 21 ffi (r1 m)2 . According to therandom normal assumption in equation (2.1), the likelihood or chance ofthe entire historical data set being observed is proportional to:L/expf 12(r1 m)2 s 21 gexpf 12(rn m)2 s 2n �ffiffiffiffiffiffi . :2ps 2n2ps 21ð2:4ÞThe best model parameters should therefore generate the volatilities {s1,s2, . . . , sn} that maximize the likelihood L in (2.4) or equivalently thelogarithm of likelihood ln(L) given by:"#2P(r m)tln(L) ¼ 12 nt¼1 ln(s 2t ) þð2:5Þs 2twhere all constant terms irrelevant to the maximization are ignored inthe equation.2.2 EXCEL IMPLEMENTATIONFigure 2.1 illustrates how the above calculation could be organized in anExcel spreadsheet.2 The table analyzes daily returns of the Dow JonesIndustrial Average (DJI) between March 22, 1990 and December 6, 2006.The leading segment from 19900322 to 19940302 will be taken as in-sampledata for the determination of model parameters. The rest will be used as outof-sample data to back test the accuracy of the model. From row 13 onward,column A in the table records the date, column B shows the closing of theDJI on each of these dates, while column C calculates the correspondingdaily returns. For example, the formula adopted in C14 ¼ (B14 B13)/B13.The cell C2 defines the range ‘‘C14:C1011’’ of the entire in-sample historicalreturns {r1, r2, . . . , rn}. The cell C3 ¼ AVERAGE(INDIRECT(C2)) calculates the corresponding constant mean m in the model. Trial values of themodel parameters (VL, a, b) are input through cells F5, F6, and F7,

The GARCH(1,1) Model11FIGURE 2.1 Excel Implementation of GARCH(1,1).respectively. We may define several named cells to enhance the readability ofthe formulae: C3(mu), F5(longvar), F6(alpha), F7(beta), and C7(zvalue).The fourth column from D14 onward calculates the residuals (rt m)for each of these returns using the formula D14 ¼ (C14 mu), for example.GARCH variances s 2t are recorded in the fifth column from E14. They aregenerated iteratively using the formula (see equation [2.2]):E15 ¼ (1 alpha beta) longvar þ alpha D14 2 þ beta E14starting off with the value in E14 D14 2. To determine the best modelparameters, we need to first evaluate the likelihood value associated witheach trial parameter set. Column F under the data caption implementsterm-by-term the expression for ln(L) in equation (2.5) using the formula:F14 ¼ ð 0:5Þ ðLN(E14) þ D14 2 E14)such that the total in-sample ln(L) is given by cell F10 ¼ SUM(OFFSET(INDIRECT(C2),0,3)). For example, consider the trial model parameters of(VL ¼ 0.00005, a ¼ 0.02, b ¼ 0.95) that satisfy the constraints in (2.3), wehave the likelihood value being ln(L) ¼ 4365.5993.Here, we are interested in choosing (VL, a, b) that maximize ln(L)under the constraints in (2.3). Such a task can be achieved by using theSolver algorithm in Excel. We can simply go to Tools, then Solver, and theSolver Parameters screen will pop up as shown in Figure 2.2. Set Target Cellis the cell F10 that is the likelihood value ln(L), check Equal To as Maxfor maximizing, and input the cells F5:F7 in By Changing Cells for the trialvalues of VL, a, and b.

12PROFESSIONAL FINANCIAL COMPUTING USING EXCEL AND VBAFIGURE 2.2 Solver Parameters screen.The constraints in (2.3) can easily be included in the Solver algorithmunder the Subject to the Constraints field. Click Add and, as shown inFigure 2.3, enter the following through the Add Constraint screen:longvar ¼ 0; alpha ¼ 0; beta ¼ 0; and F8 ¼ 1for the constraints VL 0, a 0, b 0, and a þ b 1, respectively. In thespreadsheet, we have defined the cell F8 alpha þ beta to be the sum of aand b. Note that Solver provides only the choices

13.2. Excel and VBA Implementation 248 APPENDIX A VBA Programming 255 A.1 Introduction 255 A.2 A Brief History of VBA 255 A.3 Essential Excel Elements for VBA 256 A.3.1 Excel Cell Reference 257 A.3.2 Excel Defined Names 261 A.3.3 Excel Worksheet Functions 264 A.4 The VBA Development Enviro

Related Documents:

Excel 5.0 Excel 5.0 1993 Excel 5.0 1993 Excel 7.0 Excel 95 1995 Excel 8.0 Excel 97 1997 Excel 98 1998 Excel 9.0 Excel 2000 1999 Excel 2001 2000 Excel 10.0 Excel XP 2001 Excel v.X 2001 Excel 11.0 Excel 2003 2003 Excel 2004 2004 2.1.2 Worksheet Document Definition: Worksheet Document A worksheet document consists of a single sheet only.

Power Map Power Map provides a new perspective for your data by plotting geocoded data onto a three-dimensional view of the earth and optionally showing changes to that data over time. To use Power Map, you import raw data into a Microsoft Excel 2013 workbook, add the data to an Excel data model, and enhance the data in the data model if necessary.File Size: 1MBPage Count: 17Explore furtherGetting an excel list of all Azure Virtual machinesdbaharrison.blogspot.comDownload Azure Devops Board To Excelwww.how-use-excel.comGetting an excel list of all Azure Virtual machines .www.firstcloud.ioGetting an excel list of all Azure Virtual machines .laptrinhx.comRunning Excel On Azurewww.how-use-excel.comRecommended to you based on what's popular Feedback

Click the Excel 2019 app to run the Excel app and display the Excel start screen Click the Blank workbook thumbnail on the Excel start screen to create a blank Excel workbook in the Excel window-7-Starting and Using Excel (3 o

While Excel 2010 documents share a file extension with Excel 2007 (*.pptx), the Excel 2010 file is a unique file type. Excel 2007 documents will open in “Compatibility mode” and will not have certain Excel 2010 tools available unless re-saved as an Excel 2010 document. Saving a Excel

Cloud Computing J.B.I.E.T Page 5 Computing Paradigm Distinctions . The high-technology community has argued for many years about the precise definitions of centralized computing, parallel computing, distributed computing, and cloud computing. In general, distributed computing is the opposite of centralized computing.

If you are not using Excel 2010 you need a different book This book is for Excel 2010 users. If you have a different version of Excel you can download the correct version of this book at the ExcelCentral.com web site. Here are the direct links: Excel 2007, Excel 2013, Excel 2016. Make sure you are using the latest version of this free e-book .

If you are not using Excel 2007 you need a different book This book is for Excel 2007 users. If you have a different version of Excel you can download the correct version of this book at the ExcelCentral.com web site. Here are the direct links: Excel 2010, Excel 2013, Excel 2016. Make sure you are using the latest version of this free e-book

Albert Woodfox a, quant à lui, vu sa condamnation annulée trois fois : en 1992, 2008, et . février 2013. Pourtant, il reste maintenu en prison, à l’isolement. En 1992 et 2013, la décision était motivée par la discrimination dans la sélection des membres du jury. En 2008, la Cour concluait qu’il avait été privé de son droit de bénéficier de l’assistance adéquate d’un .