1 / 56

STAT 906: Computer Intensive Methods In Finance

Don McLeish: MC6138 email:dlmcleis@uwaterloo.ca Text: Monte Carlo Simulation and Finance. Don L. McLeish (Wiley, 2005) Available from me @60% of $119. Early version of book and slides available at www.mcleish.ca (follow links). STAT 906: Computer Intensive Methods In Finance.

hilde
Download Presentation

STAT 906: Computer Intensive Methods In Finance

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Don McLeish: MC6138 email:dlmcleis@uwaterloo.ca Text: Monte Carlo Simulation and Finance. Don L. McLeish (Wiley, 2005) Available from me @60% of $119. Early version of book and slides available at www.mcleish.ca (follow links) STAT 906: Computer Intensive Methods In Finance

  2. Other References • The Mathematics of Financial Derivatives • (Wilmott, Howison, Dewynne) • Monte Carlo: Concepts, Algorithms and Applications. George Fishman QA298.F57 • Arbitrage Theory in Continuous Time. Tomas Bjork • Mathematics of Financial Markets. R.J. Elliott and P.E. Kopp (Springer) HG4515.3.E37 • Glasserman, P. (2003) Monte Carlo Methods in Financial Engineering (Applications of Mathematics, 53) Springer, New York • Jaeckel, P. (2003) Monte Carlo Methods in Finance, Wiley, New York

  3. Marks distribution Midterm Tests (2): 35 Project&presentation (15 minutes per presentation) 50 Class problem presentations 15 Tentative Calendar: Week of Sept 13+15: Sep 20+22 : Sep 27+29 : Oct. 4+6: Oct 11+13: Oct 18+20: Oct 25: Midterm Test 1 Oct 27: Nov 1 : Nov 10 : Nov 17: Nov 24: Nov 26: Midterm Test 2 Dec 1+3+5: Projects Marking

  4. A general discussion of simulation. Example: 2 person game. Some basic theory of finance (Chapter 2) How to generate random numbers (Uniform and non-uniform)(Chapter 3) Variance Reduction Quasi Monte Carlo Simulation and Option valuation Estimation and Calibration Sensitivity Analysis Numerical solutions to PDE’s Contents

  5. Course Prerequisites • Knowledge of (or tolerance of) Stochastic Calculus. • Some finance knowledge/interest • Computing: Some computer language (e.g. MATLAB, R, C++) • “Tolerance of” means have taken course, seen before, or willing to read on side.

  6. Simulation: Imitation of a real-world process or system. Model: set of assumptions concerning the operation of the system Monte Carlo: simulation of random phenomena Parameters: numerical values associated with the model Why use simulation? A cheap source of experience. E.g. Airbus pilots Permits changing model and parameters, examining interactions, changes to system, Simulation: Monte Carlo Methods

  7. Option • Gives the holder the right (no obligation) to buy or sell an asset at a prescribed price,time determined by the contract. • e.g. a (European) call option on IBM stock. exercise price $120. expiry date Oct 20, 2003. If S=stock price on Oct 20 the value of option on expiry is max(S-120,0)

  8. Uses of financial derivatives • Speculate on a rise (call option) or fall (put option) in asset price. • Hedge a portfolio already held-e.g. a promise to deliver IBM stock at point in future. Insurance against disadvantageous moves in asset prices, currency exchange rates, interest rates, credit changes, weather, electricity demand, …...

  9. Asset prices as random variables • Random models often applied to complex systems which are essentially causal with many factors influencing result in a complex way. e.g. Brownian motion, toss of coin, currency exchange rates, … • What are the constants---- a dollar and if so whose…..? Choice of “numeraire”.

  10. Experience Permits experimenting with the controllable system parameters to identify optimal settings Permits examining effect of environmental or exogenous changes. Identify which of several systems is most efficient Determine which variables are most important. Verify and check robustness of analytic solutions. Why use simulation?

  11. investigate effects of changes, new designs, new models, etc. without costly implementation. Stress testing: test systems under different scenarios (e.g. higher interest rates, different exchange rates) “What if” questions. NON-FINANCE applications Identify bottlenecks in systems and rectify Increase experience with complex system at lower cost. Advantages of Simulation

  12. Two models for same process may differ. Simulation output is random so hard to interpret results. Building models and running simulation is time consuming ANALYTIC SOLUTIONS, IF AVAILABLE, SHOULD BE USED! (analytic solutions to a similar (simpler) model can be used to improve a simulation) Disadvantages

  13. Manufacturing systems: e.g. material handling, inventory, assembly plants, scheduling, Public Systems: health care- hospital management, emergency room, Military Natural resource management, transportation, traffic systems, airport (e.g. Motorway) Construction systems: project planning, scheduling, entertainment: restaurants, movies etc. Non Finance Applications

  14. State variables: determine the state of the system in order to simulate future events. Discrete: state variables change only at discrete time points. (discrete event simulation) Continuous: state variables change continuously over time Stochastic, deterministic Types of Systems

  15. Interested in required number of tellers. State variables: number of tellers available, number of customers in bank, (possibly also the time in service of customers being served) Example (Discrete): Bank queue

  16. Calling population queue (waiting line) server(s) EXAMPLE: QUEUE Office Hours

  17. One-server queue

  18. Repair facility(garage, mechanics, etc.) hospital, airport,production line, job shop, computer, telephone, ticket office, grocery store, taxi, mass transit, warehouse Identify the customers and the server(s) in each. Examples of queueing systems

  19. X(t) = TSE300 index at time t. Changes (almost) continuously in time On what present values does the future depend? (state variables) : Current value of index possibly other factors depending on model (e.g. interest rates, exchange rates, balance of trade, agricultural prices, forest product prices, kitchen sink …) Example (continuous-time model):TSE300 index.

  20. Formulate Problem (why do a simulation?) Set objectives suggest candidate models. Collect real data- identify most appropriate model Computer implementation of model (code or program) Verify model (i.e. debug) validate model (i.e. accurately represents system?) Steps in contructing a simulation

  21. Design the simulation- what alternatives are to be simulated? How long a run- what data is collected etc. Run simulation and analyse output. More runs? Change model? Change parameters? Document report on results Conclusion Designing Simulation

  22. Prisoner’s dilemna • A non-zero-sum game called the "Prisoner's Dilemma" • The two players choose between two moves, either "cooperate" or "defect". • each player gains when both cooperate, but if only one of them cooperates, the other one, who defects, will gain more. If both defect, both lose (or gain very little) but not as much as the "cheated" cooperator whose cooperation is not returned. The whole game situation and its different outcomes can be summarized below. Points=payoff to A • Mathematical model of “plea-bargain”. The dilemma resides in the fact that each prisoner has a choice between only two options, but cannot make an optimal decision without knowing what the other one will do.

  23. Payoff matrix Prisoners Alf and Butch either confess or not. Payoffs taken from table: A chooses row (don’t confess/ confess) B chooses column (don’t confess/confess) Payoff (to Alf) cooperate: 5 -10 Defect 10 0 (to B) cooperate defect 5 10 -10 0 Example: Simulate the Prisoner’s Dilemma.

  24. Summary of game& simulation results. A = 5 -10 10 0 B = 5 10 -10 0 >> [p,q,val]=nonzerosum(A,B,10000) p = 0 1 q = 0 1 val = 0 0 “Defect”=second strategy dominates for both players

  25. TWO PERSON GAME-MATLAB CODE • [p,q]=nonzerosum(A,B,nsim) • n=size(A); p=ones(1,n(1)); % q=ones(n(2),1); • for i=1:nsim • [m,s]=max(A*q); p(s)=p(s)+1; • [m,s]=max(p*B); q(s)=q(s)+1; • end • p=p-ones(1,n(1)); p=p/sum(p); • q=q-ones(n(2),1); q=q/sum(q);

  26. Payoff matrix Two companies A and B each choose bid . Payoffs taken from table: Payoff to A A’s Bid Payoffs 12 3 2 -2 13 1 -4 4 14 0 -5 6 Payoff to B B’s bid B1 B2 B3 -1 -2 3 0 4 -6 0 5 -5 Another two-person game.

  27. [p,q]=nonzerosum(A,B,50000) p = 0.6667 0 0.3333 q = 0 0.53334 0.46666 and the value of the game 0 to A and 0.3333 to B. OUTPUT

  28. Generating random bid • Generate a uniform [0,1] random variable. • If U<2/3, then bid $12, • otherwise bid $14.

  29. Basic Theory of Finance: The No Arbitrage Principle • Can I Make money with positive probability with net investment of $0??( this is called an arbitrage)

  30. One stock, One bond, one period • Assume stock presently worth $s will be worth su or sd after one month where d<1<u. • A riskless bond, presently worth $1 is valued $(1+r) next month • Buy x bonds and y shares of stock. • Value in 1 month =x(1+r)+ysu or x(1+r)+ysd depending on whether stock goes up or down.

  31. Possible stock movements.

  32. Find an arbitrage • Can you find values of (x,y) so that the net cost is $0 (e.g. sell short bonds and buy stocks) so that you are certain you will not lose money and you make a positive amount with positive prob. i.e. both x(1+r)+ysu>=0 and • x(1+r)+ysd >=0 with either or both is >0. • For net investment =0, need sy=-x.

  33. No point on 0-investment line in yellow region…no arbitrage.

  34. Condition for no arbitrage • ArbitrageIS possible UNLESS • d<1+r<u • i.e. $1 in stock either returns more (u) or less (d) than bond. In this case, the bond return is a CONVEX linear combination of the stock returns. • THAT IS 1+r=qu+(1-q)d for some 0<q<1.

  35. RISK NEUTRAL MEASURE • Solve for q: • q=(1+r-d)/(u-d) • The distribution which assigns probability q to the stock rising to su and probability 1-q to the stock falling to sd is the risk neutral measure, denoted Q.

  36. Expected value of stock price under Q Denote by Q the probability distribution which puts probabilities q and 1 − q on these points su, sd. If there is to be no arbitrage, there exists a probability measure Q such that the expected price of future value of the stock S1 discounted to the present using the return from a risk-free bond is exactly the present value of the stock.

  37. Risk neutral measure • consensus investors' attitude to risk avoidance. It is not necessarily true that the expected value of S1 under the actual probability distributionP describing the future probabilities of the stock is equal to s, only the expected value under Q.

  38. Derivatives Financial Derivatives: investments which derive their value from that of a corresponding asset, such as a stock. A European call option is an option which permits you (but does not compel you) to purchase the stock at a fixed future date ( the maturity date) or for a given predetermined price, the exercise price of the option). Example: a call option with exercise price $10 on a stock whose future value is denoted S1, is worth on expiry S1 − 10 if S1 > 10, nothing if S1 < 10. The difference S1 − 10 between the value of the stock on expiry and the exercise price of the option is your profit if you exercises the option, purchasing the stock for $10 and sell it on the open market at $ S1. However, if S1 < 10, there is no point in exercising your option (you are not compelled to do so) .. return = $0.

  39. Replicating a Contingent Claim • A function of the stock price V (S1) which may represent the return from a • portfolio of stocks and derivatives is called a contingent claim. V (S1) represents the payoff to an investor from a certain financial instrument or derivative when the stock price at the end of the period is S1. • In a complete market, there is an investment solely in the stock and bond which reproduces these values V (su) and V (sd) exactly. • Solve for x and y • x(1+r)+ysu=V(su) • x(1+r)+ysd=V(sd)

  40. Investment in stock • Replicating portfolio requires that investment in stock is slope of value function between (sd,su) • A complete market is one in which every contingent claim (every function V(S1) of a stock price) can be replicated with using (marketable) stocks and risk-free bonds.

  41. Discounted Expected value of V(S1) under Q

  42. Recap • Under the Q measure, the expected discounted-to-present value of any marketed asset (stock or contingent claim) is its present price. • In a complete market, there is only one measure Q measure with this ``martingale’’ property.

  43. Multiperiod Models • When an asset price evolves over time, decisions about an investment are made at various periods during the life of investment. • Decisions made with the benefit of information including the price of the asset and any related assets at all previous time periods, beginning at some time t=0 when we started observing the process.

  44. The “History” sequence. • When an asset price evolves over time, the investor normally makes decisions about the investment at various periods during its life. Such decisions are made with the benefit of current information, including the price of the asset and any related assets at all previous time periods, beginning at some time t = 0. • Denote this information available for use at time t as Ht. • Ht is what is sigma-field generated by the past. • two fundamental properties of Ht: • Ht increases in t. (our information about this and related processes increases over time). • Ht includes the value of the asset price Su , for all u less than or equal to t. (St is adapted to or measurable with respect to Ht).

  45. In general, under Q, the discounted stock price is a martingale

  46. CAPM AND PORTFOLIO SELECTION

  47. Forms the interior of a region like this:

  48. The boundary of this region is the “efficient frontier”. The point with smallest standard deviation is the most conservative investment

  49. The conservative portfolio

  50. Add a risk-free bond paying r  (p, p) Everything below this line L is now feasible Any point on L can be achieved with a weighted average of the market (point p) and the risk-free bond

More Related