Optimal Portfolio Modeling
Total Page:16
File Type:pdf, Size:1020Kb
fm JWPR068-McDonnell December 18, 2007 13:36 Char Count= 0 Optimal Portfolio Modeling Models to Maximize Return and Control Risk in Excel and R + CD-ROM PHILIP J. McDONNELL fm JWPR068-McDonnell December 18, 2007 13:36 Char Count= 0 fm JWPR068-McDonnell December 18, 2007 13:36 Char Count= 0 Optimal Portfolio Modeling fm JWPR068-McDonnell December 18, 2007 13:36 Char Count= 0 Founded in 1807, John Wiley & Sons is the oldest independent publishing company in the United States. With offices in North America, Europe, Australia, and Asia, Wiley is glob- ally committed to developing and marketing print and electronic products and services for our customers’ professional and personal knowledge and understanding. The Wiley Trading series features books by traders who have survived the mar- ket’s ever changing temperament and have prospered—some by reinventing systems, others by getting back to basics. Whether a novice trader, professional, or somewhere in-between, these books will provide the advice and strategies needed to prosper today and well into the future. For a list of available titles, please visit our Web site at www.WileyFinance.com. fm JWPR068-McDonnell December 18, 2007 13:36 Char Count= 0 Optimal Portfolio Modeling Models to Maximize Return and Control Risk in Excel and R + CD-ROM PHILIP J. McDONNELL fm JWPR068-McDonnell December 18, 2007 13:36 Char Count= 0 Copyright C 2008 by Philip J. McDonnell. All rights reserved. Published by John Wiley & Sons, Inc., Hoboken, New Jersey. Published simultaneously in Canada. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted un- der Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600, or on the Web at www.copyright.com. Requests to the Publisher for permission should be addressed to the Permissions Depart- ment, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the con- tents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. No warranty may be created or extended by sales representatives or written sales materials. The advice and strategies contained herein may not be suitable for your situation. You should consult with a professional where appropriate. Neither the publisher nor author shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages. For general information on our other products and services or for technical support, please contact our Cus- tomer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. For more information about Wiley products, visit our Web site at www.wiley.com. Designations used by companies to distinguish their products are often claimed as trademarks. In all instances where John Wiley & Sons, Inc. is aware of a claim, the product names appear in initial capital or all capital letters. Readers, however, should contact the appropriate companies for more complete information regarding trademarks and registration. Library of Congress Cataloging-in-Publication Data: McDonnell, Philip J., 1949– Optimal portfolio modeling : models to maximize return and control risk in Excel and R + CD-ROM / Philip J. McDonnell. p. cm. – (Wiley trading series) Includes bibliographical references and index. ISBN 978-0-470-11766-8 (cloth/CD-ROM) 1. Portfolio management. 2. Risk management. 3. Investments. 4. Microsoft Excel (Computer file) I. Title. HG4529.5.M385 2008 332.60285554–dc22 2007038105 Printed in the United States of America. 10987654321 fm JWPR068-McDonnell December 18, 2007 13:36 Char Count= 0 Authoring a book is a labor of love coupled with a dash of inspiration and an abundance of hard effort. Needless to say this takes a toll on family life. With these thoughts in mind, this book is dedicated to my wife Pat and my family. Without their patient tolerance this work would not have been possible. fm JWPR068-McDonnell December 18, 2007 13:36 Char Count= 0 About the Author hilip J. McDonnell is an active options trader living in Sammamish, Washington. He and his wife have two grown children. PMr. McDonnell has been trading options since the first listed options exchange was formed. His trading experience spans more than 30 years. The emphasis and focus of his trading have been on quantitative methods. Formerly, Mr. McDonnell was president of Dollar/Soft Corporation, a financial soft- ware company specializing in options and derivatives-related products. He has done con- sulting for Charles Schwab & Co. and developed risk-management software to allow the firm to perform what-if analyses of its customer margin accounts. He has also been the president of Accelerated Data Systems, in which he and his team designed a new scientific high-performance minicomputer. Previously, he was vice president of engineering and manufacturing for a microcomputer company and helped turn critical manufacturing problems around. Prior to that, he served as president of Ad- vanced Information Design, a maker of small business computer systems. His experience also includes stints at Stanford Linear Accelerator and a Northern California investment company. His academic background is centered around the University of California at Berke- ley, where he received his B.A. in 1972. His academic credentials include full satisfaction for all the degree requirements in mathematics, computer science, and statistics. His work also included all of the course work in finance and investments at both the under- grad and graduate levels. He was employed as a researcher by the U.C. Berkeley Business School, where he worked closely with Prof. Victor Niederhoffer. vi fm JWPR068-McDonnell December 18, 2007 13:36 Char Count= 0 Contents Preface xi Acknowledgments xiii CHAPTER 1 Modeling Market Microstructure—Randomness in Markets 1 The Random Walk Model 3 What You Cannot Predict Is Random to You 5 Market Microstructure 7 Efficient Market Hypothesis 9 Arbitrage Pricing Theory 10 CHAPTER 2 Distribution of Price Changes 13 The Normal Distribution 13 Reflection Principle 17 Approximation of the Normal Distribution by Rational Polynomial 18 Lognormal Distribution 19 Symmetry of the Normal and Lognormal 22 Why Pick a Distribution at All? 23 The Empirical Distribution 24 The Lognormal as an Approximation 26 vii fm JWPR068-McDonnell December 18, 2007 13:36 Char Count= 0 viii CONTENTS CHAPTER 3 Investment Objectives 29 Statistician’s Fair Game 29 A Fair Game Is a Loser! 30 Criteria for a Favorable Game 30 Gambler’s Ruin 31 Optimal Return Models 32 Markets Are Rational, Psychologists Are Not 34 The St. Petersburg Paradox 36 Compounded Return Is the Real Objective 37 Defining Risk 38 Minimum Risk Models 41 Correlation of Assets 41 Summary of Correlation Relationships 42 Beta and Alpha 43 The Efficient Frontier and the Market Portfolio 46 TheSharpeRatio 47 Limitations of Modern Portfolio Theory 48 CHAPTER 4 Modeling Risk Management and Stop-loss Myths 51 Stop-loss Orders 52 Stops: Effect on the Mean Return 53 Stops: Effect on the Probability of Gain 56 Stops: Probability of Being Stopped Out 56 Stops: Effect on Variance and Standard Deviation 58 Effect on Skew 59 Effect on the Kurtosis 60 Stop-loss: Summary 61 Modeling Stops 61 Identifying When to Use Stops and When Not To 62 Stop-Profits 64 Puts and Calls 65 CHAPTER 5 Maximal Compounded Return Model 67 Optimal Compound Return Models 68 Relative Returns 68 Average Stock Returns, but Compound Portfolio Returns 70 fm JWPR068-McDonnell December 18, 2007 13:36 Char Count= 0 Contents ix Logarithms and the Optimal Exponential Growth Model 71 Position Sizing as the Only Guaranteed Risk Control 71 Controlling Risk through Optimal Position Sizing 72 Maximize Compounded Portfolio Return 72 Maximal Compounded Return Models 73 What the Model Is and Is Not 74 Modeling the Empirical Distribution 75 Correlations 76 The Enhanced Maximum Investment Formulas 77 Expected Drawdowns May Be Large 78 CHAPTER 6 Utility Models—Preferences Toward Risk and Return 79 Basis for a Utility Model 80 History of Logarithms 81 Optimal Compounded Utility Model 84 The Sharpe Ratio 85 Optimal Model for the Sharpe Ratio 85 Optimization with Excel Solver 88 CHAPTER 7 Money Management Formulas Using the Joint Multiasset Distribution 93 The Continuous Theoretical Distributions 94 Maximal Log Log Model in the Presence of Correlation 94 Optimal Sharpe Model with Correlation 95 The Empirical Distribution 96 Maximal Log Log Model in the Presence of Correlation 97 Maximizing the Sharpe Ratio in the Presence of Correlation 97 CHAPTER 8 Proper Backtesting for Portfolio Models 101 Assuring Good Data 102 Synchronize Data 102 Use Net Changes Not Levels 103