
Hedge Fund Modelling and Analysis
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions


Persons
Content
Preface xi
CHAPTER 1 Essential C++ 1
1.1 A Brief History of C and C++ 1
1.2 A Basic C++ Program 2
1.3 Variables 4
1.3.1 Characters and Strings 5
1.3.2 Variable Declarations 8
1.3.3 Type Casting 9
1.3.4 Variable Scope 10
1.3.5 Constants 11
1.4 Operators 12
1.4.1 The Assignment Operator 12
1.4.2 Arithmetic Operators 14
1.4.3 Relational Operators 15
1.4.4 Logical Operators 16
1.4.5 Conditional Operator 17
1.5 Input and Output 18
1.6 Control Structures 21
1.6.1 Branching 21
1.6.2 Looping 25
1.6.3 The for Loop 25
1.6.4 The while Loop 27
1.6.5 The do...while Loop 29
1.7 Arrays 30
1.8 Vectors 31
1.9 Functions 33
1.9.1 Call-by-Value vs. Call-by-Reference 36
1.9.2 Overloading Functions 39
1.10 Object Oriented Programming 41
1.10.1 Classes and Abstract Data Types 42
1.10.2 Encapsulation and Interfaces 43
1.10.3 Inheritance and Overriding Functions 44
1.10.4 Polymorphism 45
1.10.5 An Example of a Class 46
1.10.6 Getter and Setter Methods 49
1.10.7 Constructors and Destructors 52
1.10.8 A More Detailed Class Example 55
1.10.9 Implementing Inheritance 61
1.10.10 Operator Overloading 64
CHAPTER 2 The Hedge Fund Industry 71
2.1 What are Hedge Funds? 71
2.2 The Structure of a Hedge Fund 74
2.2.1 Fund Administrators 74
2.2.2 Prime Brokers 75
2.2.3 Custodian, Auditors and Legal 76
2.3 The Global Hedge Fund Industry 77
2.3.1 North America 79
2.3.2 Europe 80
2.3.3 Asia 81
2.4 Specialist Investment Techniques 82
2.4.1 Short Selling 82
2.4.2 Leverage 83
2.4.3 Liquidity 84
2.5 Recent Developments for Hedge Funds 85
2.5.1 UCITS Hedge Funds 85
2.5.2 The European Passport 88
2.5.3 Restrictions on Short Selling 88
CHAPTER 3 Hedge Fund Data Sources 91
3.1 Hedge Fund Databases 91
3.2 Major Hedge Fund Indices 92
3.2.1 Non-Investable and Investable Indices 92
3.2.2 Dow Jones Credit Suisse Hedge Fund Indices (www.hedgeindex.com) 94
3.2.3 Hedge Fund Research (www.hedgefundresearch.com) 100
3.2.4 FTSE Hedge (www.ftse.com) 102
3.2.5 Greenwich Alternative Investments (www.greenwichai.com) 104
3.2.6 Morningstar Alternative Investment Center (www. morningstar.com/advisor/alternative-investments.htm) 108
3.2.7 EDHEC Risk and Asset Management Research Centre (www.edhec-risk.com) 112
3.3 Database and Index Biases 113
3.3.1 Survivorship Bias 113
3.3.2 Instant History Bias 115
3.4 Benchmarking 115
3.4.1 Tracking Error 116
CHAPTER 4 Statistical Analysis 119
4.1 The Stats Class 119
4.2 The Utils Class 120
4.3 The Import Class 123
4.4 Basic Performance Plots 127
4.4.1 Value Added Index 127
4.4.2 Histograms 130
4.5 Probability Distributions 131
4.5.1 Populations and Samples 132
4.6 Probability Density Function 133
4.7 Cumulative Distribution Function 134
4.8 The Normal Distribution 134
4.8.1 Standard Normal Distribution 136
4.9 Visual Tests for Normality 136
4.9.1 Inspection 136
4.9.2 Normal Probability Plot 137
4.10 Moments of a Distribution 138
4.10.1 Mean and Standard Deviation 138
4.10.2 Skew 141
4.10.3 Kurtosis 142
4.11 Covariance and Correlation 146
4.12 Linear Regression 158
4.12.1 Coefficient of Determination 163
4.12.2 Residual Plots 167
CHAPTER 5 Performance Measurement 173
5.1 The PMetrics Class 173
5.2 The Intuition Behind Risk-Adjusted Returns 174
5.2.1 Risk-Adjusted Returns 182
5.3 Absolute Risk-Adjusted Return Metrics 184
5.4 The Sharpe Ratio 187
5.5 Market Models 191
5.5.1 The Information Ratio 192
5.5.2 The Treynor Ratio 197
5.5.3 Jensen's Alpha 203
5.5.4 M-Squared 205
5.6 The Minimum Acceptable Return 207
5.6.1 The Sortino Ratio 207
5.6.2 The Omega Ratio 211
CHAPTER 6 Mean-Variance Optimisation 213
6.1 The Optimise Class 213
6.2 Mean-Variance Analysis 214
6.2.1 Portfolio Return and Variance 214
6.2.2 The Mean-Variance Optimisation Problem 229
6.2.3 The Global Minimum Variance Portfolio 244
6.2.4 Short Sale Constraints 246
CHAPTER 7 Market Risk Management 247
7.1 The RMetrics Class 247
7.2 Value-at-Risk 248
7.3 Traditional VaR Methods 251
7.3.1 Historical Simulation 251
7.3.2 Parametric Method 254
7.3.3 Monte-Carlo Simulation 261
7.4 Modified VaR 263
7.5 Expected Shortfall 266
7.6 Extreme Value Theory 271
7.6.1 Block Maxima 272
7.6.2 Peaks Over Threshold 272
References 277
Index 279
CHAPTER 1
Essential C++
This chapter covers the fundamental requirements necessary to allow the reader to get up and running building quantitative models using the C++ programming language. This introduction is in no way intended to be an in-depth treatment of the C++ programming language but more an overview of the basics required to build your own efficient and adaptable programs. Once the key concepts have been developed, object-oriented principles are introduced and many of the advantages of building quantitative systems using such programming approaches are outlined. It is assumed that the reader will have some prerequisite knowledge of a low-level programming language and the necessary computation skills to effectively grasp and apply the material presented here.
1.1 A Brief History of C and C++
C is a procedural1 programming language developed at Bell Laboratories between 1969 and 1973 for the UNIX operating system. Early versions of C were known as K&R C after the publication of the book The C Programming Language written by Brian Kernighan and Dennis Ritchie in 1978. However, as the language developed and became more standardised, a version known as ANSI2 C became more prominent. Although C is no longer the choice of many developers, there is still a huge amount of legacy software coded in it that is actively maintained. Indeed, C has greatly influenced other programming languages, in particular C++ which began purely as an extension of C.
Often described as a superset of the C language, C++ uses an entirely different set of programming concepts designed around the Object-Oriented Programming (OOP) paradigm. Solving a computer problem with OOP involves the design of so-called classes that are abstractions of physical objects containing the state, members, capabilities and methods of the object. C++ was initially developed by Bjarne Stroustrup in 1979 whilst at Bell Laboratories as an enhancement to C; originally known as C with Classes. The language was renamed C++ in the early 80s and by 1998, C++ was standardised as ANSI/ISO3 C++. During this time several new features were added to the language, including virtual functions, operator overloading, multiple inheritance and exception handling. The ANSI/ISO standard is based on two main components: the core language and the C++ Standard Library that incorporates the C Standard Library with a number of modifications optimised for use with the C++ language. The C++ Standard Library also includes most of the Standard Template Library (STL); a set of tools, such as containers and iterators that provide array-like functionality, as well as algorithms designed specifically for sorting and searching tasks. C++11 is the most recent complete overhaul of the C++ programming language approved by ANSI/ISO on 12 August 2011, replacing C++03, and superseded by C++14 on 18 August 2014. The naming convention follows the tradition of naming language versions by the year of the specification's publication, although it was formerly known as C++0x to take into account many publication delays. C++14 is the informal name for the most recent revision of the C++ ANSI/ISO standard, intended to be a small extension over C++11, featuring mainly bug fixes and small syntax improvements.
1.2 A Basic C++ Program
Without doubt the best method of learning a programming language is to actually start by writing and analysing programs. Source 1.1 implements a basic C++ program that simply outputs a string of text, once the program has been compiled and executed, to the console window. Although the program looks very simple it nevertheless contains many of the fundamental components that every C++ program generally requires.
Source 1.1: A basic C++ program
Statements beginning with a hash symbol (#) indicate directives to the preprocessor that initialise when the compiler is first invoked, in this case, to inform the compiler that certain functions from the C++ Standard Library must be included. #include <windows.h> gives the program access to certain functions in the library, such as SetConsoleTitle() whilst #include <iostream> enables console input and output (I/O). Typical objects in the iostream library include cin and cout which are explicitly included through the using statement at the top of the program. Writing using std::cout at the top of the program avoids the need to keep retyping std through the scope resolution operator (::) every time cout is used. For example, if we had not specified using std::cout we would have to explicitly write std in front of each usage throughout the program, that is:
std::cout << "\n " << "Hedge Fund Modelling and Analysis: An Object Oriented Approach Using C++"; std::cin.get();Although in this case there are only two occasions where we need std, you can imagine how this could quickly clog up code for very large programs. Note also that all C++ statements must end with a semi-colon (;).
A commonly identified problem with the C language is the issue of running out of names for definitions and functions when programs reach very large sizes eventually resulting in name clashes. Standard C++ has a mechanism to prevent such a clash through the use of the namespace keyword. Each set of C++ definitions in a library or program is wrapped into a namespace, and if some other definition has an identical name, but is in a different namespace, then there is no conflict. All Standard C++ libraries are wrapped in a single namespace called std and invoked with the using keyword:
using namespace std;Whether to use using namespace std or explicitly state their use through using std::cout, for example, is purely a preference of programming style. The main reason we do not invoke using namespace std in our programs is that this leaves us the opportunity of defining our own namespaces if we wish and it is generally good practice to have only one namespace invocation in each program.
The main() function is the point at which all C++ programs start their execution even if there are several other functions declared in the same program. For this reason, it is an essential requirement that all C++ programs have a main() function within the body at some point in the program. Once the text is output to the console window, cin.get() is used to cause the program to pause so that the user can read the output and then close and exit the window by pressing any key. Technically, in C or C++ the main() function must return a value because it is declared as int i.e. the main function should return an integer data type. The int value that main() returns is usually the value that will be passed back to the operating system; in this case it is 0i.e. return 0 which indicates that the program ran successfully. It is not necessary to state return 0 explicitly, because the compiler invokes this automatically when main() terminates, but it is good practice to include a return type for all functions (including main()).
1.3 Variables
A variable is a name associated with a portion of memory used to store and manipulate the data associated with that variable. The compiler sets aside a specific amount of memory space to store the data assigned to the variable and associates the variable name with that memory address. As the name implies, variables can be changed within a program as and when required. When new data is assigned to the same variable, the old data is overwritten and restored in the same memory address. The data stored in a variable is only temporary and only exists as long as the variable itself exists (defined by the scope of the variable). If the data stored in a variable is required beyond its existence then it must be written to a permanent storage device, such as a disk or file.
A variable name can be any length and composed of lower and upper case letters, numbers and the underscore (_) character, but keep in mind that variables are case-sensitive. In practice, a programmer will usually develop their own variable naming convention but bear in mind that C++ reserves certain keywords for variable names so try not to clash with these. Table 1.1 shows a list of reserved C++ keywords.
Table 1.1 Reserved C++ keywords
asm, auto, bool, break, case, catch, char, class, const, const_cast, continue, default, delete, do, double, dynamic_cast, else, enum, explicit, export, extern, false, float, for, friend, goto, if, inline, int, long, mutable, namespace, new, operator, private, protected, public, register, reinterpret_cast, return, short, signed, sizeof, static, static_cast, struct, switch, template, this, throw, true, try, typedef, typeid, typename, union, unsigned, using, virtual, void, volatile, wchar_t, whileThere are sevenal built-in data types...
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.