[SOLVED] Risk measurement and optimization of option portfolios

$25

File Name: Risk_measurement_and_optimization_of_option_portfolios.zip
File Size: 508.68 KB

5/5 - (1 vote)

This document describes one of the available topics for the MSc-project in Financial Mathematics. The focus is on optimization of a static portfolio of derivative instruments on given underlying assets. A primary goal is to set up and solve portfolio optimization problems that account for non-Gaussian return distributions. Such optimization problems can rarely be solved analytically so the project includes a significant numerical study that combines Monte Carlo simulation with convex optimization techniques.

The project consists of three parts. The first part consists of a literature review and a synthesis of techniques relevant for the thesis. In the second part, the student is given a specific portfolio optimization problem and he/she is asked to optimize the portfolio and to produce numerical results illustrating the properties of the optimal portfolio. In the third part, the student is free to develop the topic further in a direction of his/her choice.

Part 1: Literature review

In the first part of the thesis, the student should provide a literature review on risk measurement in the context of portfolio optimization. The review should cover approaches and techniques relevant to parts 2 and 3 of the project. It is particularly important that the student arrives at a synthesis of the various sources while telling a consistent story both in terms of notation and mathe- matical and financial content.

The following references give good starting points to the literature. The book Embrechts et al. [3] covers many aspects of quantitative risk management and risk measurement. Chapter 4 of F ollmer and Schied [1] provides a detailed analysis of risk measures from a more mathematical point of view. Rockafellar and Uryasev [4] gives an accessible introduction to the Conditional Value at Risk (CV@R) and its numerical optimization. The book Markowitz [2] is a classical reference on portfolio optimization. Sharpe, Alexander and Bailey [5] covers many practical aspects of portfolio management along with the classical

1

mean-variance theory (modern portfolio theory).
Researching books and published journal articles is an important part of

the project. Various sources are available also on the internet (e.g. arxiv.org, ssrn.com, repec.org,. . . ) but one should pay attention to the validity of results found in work that has not been peer reviewed.

Part 2: Numerical investigations with Amazon stock and options

On 18th April 2013 the prices in Table 1 were quoted for Amazon stock and options.1 All prices are quoted in dollars. The options are all non-dividend paying American call options. Recall that early exercise is never optimal for an American call option on a non-dividend paying stock that can be shorted at the spot price.

The risk free interest rate over the period is assumed to be 0.16% per annum.

Bloomberg Ticker

AMZN US Equity
AMZN US 05/18/13 C215 Equity AMZN US 05/18/13 C220 Equity AMZN US 05/18/13 C225 Equity AMZN US 05/18/13 C230 Equity AMZN US 05/18/13 C235 Equity AMZN US 05/18/13 C240 Equity AMZN US 05/18/13 C245 Equity AMZN US 05/18/13 C250 Equity AMZN US 05/18/13 C255 Equity AMZN US 05/18/13 C260 Equity AMZN US 05/18/13 C265 Equity AMZN US 05/18/13 C270 Equity AMZN US 05/18/13 C275 Equity AMZN US 05/18/13 C280 Equity AMZN US 05/18/13 C285 Equity AMZN US 05/18/13 C290 Equity AMZN US 05/18/13 C295 Equity AMZN US 05/18/13 C300 Equity AMZN US 05/18/13 C305 Equity

Bid Price

Ask Price

Days to expiry

 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30

Strike price

 215 220 225 230 235 240 245 250 255 260 265 270 275 280 285 290 295 300 305

259.32 259.36 44.2 46.35 40.85 41.6 36.5 37.15 30.75 32.9 27.9 28.8 24.05 24.85 20.8 21.2 17.5 17.85 14.5 14.85 11.85 12.15 9.5 9.8 7.5 7.75 5.8 6.05 4.4 4.6 3.3 3.45 2.41 2.55 1.74 1.86 1.19 1.34 0.85 0.94

Table 1: Stock and option prices on 18th April 2013

A trader, believing that the volatility of Amazon stock has been over-estimated by the market, buys the portfolio of call options given in Table 2. The trader believes that the mid-price S1 of Amazon stock follows the geometric Brownian motion

dSt = Stdt + StdWt 1The data was extracted from a Bloomberg terminal.

2

Option type

Call Call

Underlying

Amazon Amazon

Strike Quantity

235 100, 000 265 200, 000

Table 2: The initial portfolio
where = 0.01 and = 0.35 and W 1 is a Brownian motion.

  • Use Monte Carlo simulation to estimate the expectation and standard deviation of the payoff on the portfolio over a 30 day period. When com- puting the payoff you should assume that stock holdings can be bought or sold at the mid-price at the end of 30 days. In other words, you should ignore the bid ask spread at the end of the holding period.
  • Compute the 95% V@R and the 95% CV@R of the payoff portfolio over a 30 day holding period. The initial value of the portfolio should be computed as the cost of setting up the portfolio. The final value should be equal to the payoff after 30 days. In other words, you should take account of the bid ask spread at the start of the holding period.
  • Show that the trader can reduce her risk by investing the same amount in a different portfolio of the options, the stock and possibly cash. Find portfolios that maintain the same setup cost and expected payoff but with lower risk as measured using:

    1. the standard deviation (s.d.) of the payoff, 2. the CV@R.

    You should assume that unlimited amounts can be bought/sold at the ask/bid price in Table 1.

  • Plot the efficient frontier for each of these risk measures.
    Summarize your answers to the above questions by completing a table in the

format shown in Table 3. Portfolio

Original portfolio
Portfolio optimized for s.d. Portfolio optimized for CV@R

Expected payoff

s.d. of payoff

V@R CV@R

Table 3: Format to use to display your results

3

Part 3: Further developments (to be done after part 2)

In this part of the thesis, the student is invited to engage in independent research by developing the above topics in a direction that could be practically relevant and useful or otherwise interesting. Possible topics include (but are not limited to)

  • portfolio constraints: margin requirements, different interest rates for lending and borrowing, finite quantity available at the best bid and ask,
  • pricing and hedging of OTC derivatives using the vanilla options, cash and the underlying
  • more realistic models for the underlying risk factors
  • MC and variance reduction techniques
  • CV@R minimization with nonsmooth optimization techniques
  • dynamic trading strategies
  • Appendix A: Linear programming approach to CV@R optimization

    Rockafellar and Uryasev [4] discuss portfolio optimization with CV@R. This paper is essential reading to complete the optimization part of the project.

    The strategy is to generate a large number of scenarios of returns for each asset using Monte Carlo simulation. Approximating the the original return distribution with the Monte Carlo sample, allows for an easy calculation of the involved statistics for any given portfolio. So for these fixed scenarios, one

    Optimizing V@R is difficult since it is neither smooth nor convex. On the face of it, optimizing CV@R seems just as difficult but Rockafellar and Urya- sev describe a trick that allows optimization problems involving CV@R to be converted into convex optimization problems. They also describe how such problems can even be converted into linear optimization problems.

    This gives two possible approaches to solving the optimization problems in this problem.

    Convert the problem to a convex optimization problem and use a general purpose non-smooth convex optimization algorithm.

    4

can define three estimate functions V@R, CV@R, Mean from the linear space of possible portfolios to R. One can then consider optimizing one of these functions using a standard optimization algorithm.

Convert the problem to a linear optimization problem and use a general purpose linear optimization algorithm.

The first approach is the one that Rockafellar and Uryasev follow them- selves. Unfortunately the algorithm they use is only implemented in Fortran and Mathematica. So if you wish to use Matlab for your project this approach is probably not appropriate.

Since free linear optimization algorithms are available for Matlab, this is the approach we recommend you pursue. Appendix B gives some advice on optimization in Matlab.

Appendix B: Optimization in Matlab

Matlab has an optimization toolbox which allows one to solve various numer- ical optimization problems. This includes the following functions:

  • The function linprog to solve linear optimization problems
  • The function quadprog to solve quadratic optimization problems
  • The function fmincon to solve constrained nonlinear optimization prob- lems

    The online help for Matlab describes the basic use of these functions, which is all one needs to solve small toy problems. Unfortunately, these functions may fail or, worse, give misleading answers when used on more complex problems. Matlabs online help does not give a very clear account of how to to address these issues. The aim of this appendix is to fill that gap.

    Linear Optimization

    A typical linear optimization (aka linear programming) problem is to minimize an linear form f x over vectors x subject to the constraint Ax b where f and b are vectors and A is a matrix.

    The specific problem with coefficients

    1 0 0

1000 10 f= 90 , A=3 1, b=70

13 80

can be solved as follows with the linprog function from Matlabs optimization toolbox:

f = [-100 -90]; A = [-1 0 ; 0 -1 ; 3 1 ; 1 3]; b = [0 0 70 80];[x, v ] = linprog(f,A,b);

5

The optimum choice of x is then stored in the variable x and the optimal value for f x is stored in v.

Unfortunately Matlabs built in linprog function is not sufficiently efficient for the portfolio optimization problem. When you use a large number of sce- narios in your computation you will find that Matlab will run out of memory. We recommend therefore that use use the Mosek solver (www.mosek.com). A free academic license is available for Mosek.

Once you have installed Mosek, you need to tell Matlab where to find the Mosek libraries in order to use its functions. This is done using the Matlab command addpath. We recommend that whenever you use Mosek functions you call addpath beforehand and rmpath afterwards. This stops Moseks functions interfering with Matlabs functions. Here is the same code as above, but now using the Mosek solver.

f = [-100 -90]; A = [-1 0 ; 0 -1 ; 3 1 ; 1 3]; b = [0 0 70 80];addpath(C:Program FilesMosek6toolboxr2009b); [x, v ] =linprog(f,A,b); rmpath(C:Program FilesMosek6toolboxr2009b);

As you can see, the Mosek solver can be used exactly like Matlabs linprog function. However, it performs much better than the built in linprog function when one uses sparse matrices. In many matrix problems, the matrices that one considers consist mostly of zeros and have only a few non zero entries. Stan- dard storage and matrix manipulation routines are highly inefficient for sparse matrices since they waste a lot of time performing unnecessary multiplications by zero. Moseks solver is designed to work well with sparse matrices.

Sparse matrices are created using the Matlab sparse command. We repeat our example from above using a sparse matrix to represent A.

f = [-100 -90];
b = [0 0 70 80]; ai = [ 1 2 3 3 4 4]; aj = [ 1 2 1 2 1 2];av=[-1-1 3 1 1 3];sparseA=sparse(ai,aj,av); addpath(C:Program FilesMosek6toolboxr2009b); [x,v] = linprog( f, sparseA, b); rmpath(C:Program FilesMosek6toolboxr2009b);

The vector av contains all the non zero values contained in the matrix A. The vectors ai and aj contain the corresponding row and column indices for these values. We can then create a sparse matrix sparseA using these three vectors.

Since the matrix A is not particularly sparse (2 zero entries versus 6 non- zero entries), for this small example the use of sparse matrices is less efficient. However, for large, genuinely sparse matrices you will see a large performance difference when using sparse matrices.

Quadratic Optimization

Matlab has a built in function quadprog for performing quadratic optimization. If you already understand how to use the linprog function, Matlabs online documentation for quadprog should be easy to follow.

6

It is better to use the Mosek implementation of quadprog than the imple- mentation built into Matlab. The reason is simply that Matlabs implementa- tion sometimes fails when Mosek succeeds. To use Mosek, one follows the same procedure as for linprog, calling addpath and rmpath. Here is an example:

H = [ 1 -1 ; -1 2];f = [-2 -6]; A = [1 1; -1 2; 2 1]; b = [2; 2; 3]; lb = zeros(2,1);addpath(C:Program FilesMosek6toolboxr2009b); [x,v] =quadprog(H,f,A,b,[],[],lb) rmpath(C:ProgramFilesMosek6toolboxr2009b);

Scaling and centering optimization problems

An additional complication with using quadprog or fmincon is that one must be more careful about scaling. This is generally true for non-linear numerical opti- mization algorithms. In just the same way as the earth looks flat when viewed on one scale and round on another scale, so the solutions to an optimization problem can be difficult to detect and verify when one uses the wrong scale.

Optimization algorithms are usually written to perform best when the scale of the problem is of the order 1. The optimization problem we wish to solve involves a portfolio which costs roughly one million dollars so it is advisable to rescale the problem. Ideally you should rescale each x coordinate so that they all have roughly the same effect on the quantity you are optimizing. One reason that Mosek quadprog is easier to use than Matlabs built in function that it performs some sensible rescaling automatically.

Similarly it can be important to ensure that the problem is centered, in other words one should try to ensure that the optimum is reasonably near to the origin. For the problems we are considering this is unlikely to be a problem unless you make a deliberately perverse choice of x coordinates.

One might wonder how one can ensure that the scale and center of the problem are correct when one doesnt know the solution to the optimization problem. How can you ensure that the optimum is near the origin if you do not yet know where the optimum is? In practice so long as the constraints are correctly scaled, they will usually force the optimum to be correctly scaled.

Passing options to an optimization function

Both Matlab and Moseks opimization functions allow you to pass options that control how the optimization is performed. Looking at the documentation for all of these options can be rather daunting as the documentation usually assumes that you understand the various optimization algorithms. There are three main aspects of the optimization that you can configure:

The specific optimization algorithm to use. Matlab comes with various choices of algorithm to use. We recommend that you use Moseks default algorithm, so there is nothing to configure here.

7

  • Various step sizes, bounds on the maximum number of iterations, required tolerances on the accuracy of the output etc.. The numerical algorithms are approximate and iterative so there are various ways of tuning the algorithm. Often needing to tune these parameters is a sign that you have a badly scaled problem. Since it is easier to rescale the problem than learn how to tune a specific optimization algorithm, we recommend you use Moseks defaults for this project.
  • The amount of diagnostic information to print out. This is the only op- timization parameter that is likely to be useful for this project. When an optimization fails, it can be helpful to get the algorithm print out some additional diagnostic information as it may help you understand what has gone wrong.

    As an example here is the MATLAB code to turn on diagnostics for a linear optimization.

    % Create default optionsoptions = optimset(linprog);% Configure the optionsoptions = optimset(options,Diagnostics,on);% Run the optimizationlinprog( f,A,b, Aeq, beq,[],[],[],options);

    The general mechanism for passing optimization parameters is:

  1. Use the function optimset to first create an options object. You should pass in the name of the function you plan to call to optimset and it will return the default options object for that function.
  2. Next one configures the options by using the optimset function a second time. This allows you to set the value of given properties. In the example above we set the property Diagnostics to have the value on. Note that the optimset takes the old options object and returns a new options object with the desired property changed.
  3. Pass the options object to the optimization function as the final parameter.

Verifying the solution to the optimization problem

The optimization functions all return an exit flag which you should check to verify the accuracy of the solution:

[x,v,exitflag] = linprog( f, sparseA, b); if (exitflag<=0)error(Optimization failed)

end

8

Unfortunately this check is not always enough. Matlabs built in non-linear optimization algorithm fmincon uses a heuristic method of deciding whether they have found an optimal solution. This means that it may report that it has found an optimum when it has not. This is more likely to happen if you have a badly scaled problem.

Mosek uses the notion of the duality gap to determine the accuracy of the solutions given by linprog and quadprog. There is a general theory of duality in optimization problems which it is beyond the scope of this document to dis- cuss. We will simply remark that if an approximate solution to an optimization problem is found with value v1 and a solution is found to the dual problem with value v2 then the true optimal value lies in [v1,v2]. The duality gap is the difference between v1 and v2. It provides a rigorous bound on the accuracy of the optimization.

By switching diagnostics on, as described in the previous section you can get Mosek to priint out the values v1 and v2 that it has found for the original problem and the dual problem. Here is a small sample of the diagnostic output from Moseks quadprog function:

Solution summaryInterior-point solution
Problem status: PRIMAL_AND_DUAL_FEASIBLESolution status : OPTIMALPrimal - objective: 9.8497599452e+001eq. inf.: 2.79e-013 max...Dual - objective: 9.8497599451e+001eq. inf.: 4.68e-012 max...

In this example we have v1 = 98.497599452 and v2 = 98.497599451. Thus the duality gap is negligible and we can be confident that Mosek has found the true solution.

By way of contrast fmincon does not report the duality gap. This makes it difficult to know when to trust its output.

In practice if you use Moseks linprog and quadprog functions you should be able to rely on the answers so long as the exit flag is 1. If you use fmincon you must be more circumspect.

Putting it all together

It can be useful to write a helper function that: automatically adds and removes Mosek from the path; switches on additional diagnostic information whenever there is an error; stops program execution whenever there is an error.

Here is a function that does all of this automatically which you can copy directly into your project if you wish.

function [X, FVAL, EXITFLAG] = mosek_linprog(f,A,b, Aeq, beq)
% Call moseks linprog function. This temporarily changes the path% to include mosek functions then removes them again to restore normal% Matlab behaviour

9

addpath(C:Program FilesMosek6toolboxr2009b); if (nargin<4)Aeq = [];

beq = []; end

[X,FVAL,EXITFLAG] = linprog( f,A,b, Aeq, beq); if EXITFLAG~=1options = optimset(linprog);options = optimset(options,Diagnostics,on);linprog( f,A,b, Aeq, beq,[],[],[],options);rmpath(C:Program FilesMosek6toolboxr2009b);error(Optimization failed - return code %d., EXITFLAG );
endrmpath(C:Program FilesMosek6toolboxr2009b); end

References

  1. [1] H. F ollmer and A. Schied. Stochastic finance. Walter de Gruyter & Co., Berlin, extended edition, 2011. An introduction in discrete time.
  2. [2] H. M. Markowitz. Portfolio selection: Efficient diversification of invest- ments. Cowles Foundation for Research in Economics at Yale University, Monograph 16. John Wiley & Sons Inc., New York, 1959.
  3. [3] A. J. McNeil, R. Frey, and P. Embrechts. Quantitative risk management. Princeton Series in Finance. Princeton University Press, Princeton, NJ, 2005. Concepts, techniques and tools.
  4. [4] R. T. Rockafellar and S.P. Uryasev. Optimization of Conditional Value-at- Risk. Journal of Risk, 2:2142, 2000.
  5. [5] W.F. Sharpe, G.J. Alexander, and J.V. Bailey. Investments. Prentice Hall, Upper Side River, 1999.

Important: General notes on writing a Master Dissertation for Kings Financial Mathematics Mas- ter

All students on the MSc course in Financial Mathematics are required to submit the dissertation. The following describes what this involves.

The MSc dissertation consists of a review of a suggested area of currently active research in mathematical finance, with the addition of some specific ap- plication and with possible developments. It would be good if a student could produce some original research in the final part of the dissertation, although this is not always possible in the short time available. What the faculty is hoping to

10

see is a critical understanding of the literature, including acquired results, open problems, current difficulties, past importance and potential for future applica- tions, and the ability to apply what has been understood in a practical case. When reading the dissertation, the examiners will try to see whether the stu- dent has absorbed and understood the material while presenting it in her own way, and whether the student has been able to implement the ideas effectively.

Important: The student should not copy whole sentences or even paragraphs directly from published papers, and should write her own code. Violations are easily noticed by markers and would be penal- ized. Furthermore, all sources must be properly referenced.

The dissertation must be an independent piece of work. While it can be helpful to talk with other students who are writing the disserta- tion, the final work produced by the student should not be collabo- rative.

Before resorting to advisors for help the students are encouraged to be proac- tive in solving their problems. It it expected that students resort to advisor help for substantial matters and only as a last resort. Advisors should not be con- tacted for trivial suggestions.

11

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] Risk measurement and optimization of option portfolios
$25