Volatility. Downloads  Today’s work is in: matlab_lec04.m  Functions we need today: simsec.m, simsecJ.m, simsecSV.m  Datasets we need today: data_msft.m.

Slides:



Advertisements
Similar presentations
How do we generate the statistics of a function of a random variable? – Why is the method called “Monte Carlo?” How do we use the uniform random number.
Advertisements

Uncertainty in fall time surrogate Prediction variance vs. data sensitivity – Non-uniform noise – Example Uncertainty in fall time data Bootstrapping.
Probability Distributions CSLU 2850.Lo1 Spring 2008 Cameron McInally Fordham University May contain work from the Creative Commons.
Materials for Lecture 11 Chapters 3 and 6 Chapter 16 Section 4.0 and 5.0 Lecture 11 Pseudo Random LHC.xls Lecture 11 Validation Tests.xls Next 4 slides.
Chapter 21 Value at Risk Options, Futures, and Other Derivatives, 8th Edition, Copyright © John C. Hull 2012.
FE-W EMBAF Zvi Wiener Financial Engineering.
Mobile Intelligent Systems 2004 Course Responsibility: Ola Bengtsson.
Stochastic Calculus and Model of the Behavior of Stock Prices.
Spot Price Models. Spot Price Dynamics An examination of the previous graph shows several items of interest. –Price series exhibit spikes with seasonal.
Pricing an Option Monte Carlo Simulation. We will explore a technique, called Monte Carlo simulation, to numerically derive the price of an option or.
Financial Time Series CS3. Financial Time Series.
Lecture 20 Simple linear regression (18.6, 18.9)
Value at Risk (VAR) VAR is the maximum loss over a target
Copyright K.Cuthbertson, D. Nitzsche 1 FINANCIAL ENGINEERING: DERIVATIVES AND RISK MANAGEMENT (J. Wiley, 2001) K. Cuthbertson and D. Nitzsche Lecture VaR:
1 4. Multiple Regression I ECON 251 Research Methods.
Market Risk VaR: Historical Simulation Approach
Classification and Prediction: Regression Analysis
By: Brian Scott. Topics Defining a Stochastic Process Geometric Brownian Motion G.B.M. With Jump Diffusion G.B.M with jump diffusion when volatility is.
Options, Futures, and Other Derivatives 6 th Edition, Copyright © John C. Hull Chapter 18 Value at Risk.
Value at Risk.
STATISTICS: BASICS Aswath Damodaran 1. 2 The role of statistics Aswath Damodaran 2  When you are given lots of data, and especially when that data is.
1 Least squares procedure Inference for least squares lines Simple Linear Regression.
CH12- WIENER PROCESSES AND ITÔ'S LEMMA
Wiener Processes and Itô’s Lemma Chapter 12 1 Options, Futures, and Other Derivatives, 7th Edition, Copyright © John C. Hull 2008.
Chapter 13 Wiener Processes and Itô’s Lemma
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Curve Fitting.
Two Approaches to Calculating Correlated Reserve Indications Across Multiple Lines of Business Gerald Kirschner Classic Solutions Casualty Loss Reserve.
MULTIPLE TRIANGLE MODELLING ( or MPTF ) APPLICATIONS MULTIPLE LINES OF BUSINESS- DIVERSIFICATION? MULTIPLE SEGMENTS –MEDICAL VERSUS INDEMNITY –SAME LINE,
Value at Risk Chapter 20 Value at Risk part 1 資管所 陳竑廷.
10.1 Options, Futures, and Other Derivatives, 4th edition © 1999 by John C. Hull Model of the Behavior of Stock Prices Chapter 10.
MTH 161: Introduction To Statistics
Continuous Distributions The Uniform distribution from a to b.
Valuation of Asian Option Qi An Jingjing Guo. CONTENT Asian option Pricing Monte Carlo simulation Conclusion.
Modeling Multiple Securities. Downloads  Today’s work is in: matlab_lec06.m  Functions we need today: crosssection.m.
3.2 Least Squares Regression Line. Regression Line Describes how a response variable changes as an explanatory variable changes Formula sheet: Calculator.
Simulation. Downloads  Today’s work is in: matlab_lec03.m  Datasets we need today: data_msft.m.
6-1 Introduction To Empirical Models Based on the scatter diagram, it is probably reasonable to assume that the mean of the random variable Y is.
Value at Risk Chapter 16. The Question Being Asked in VaR “What loss level is such that we are X % confident it will not be exceeded in N business days?”
1 Wiener Processes and Itô’s Lemma MGT 821/ECON 873 Wiener Processes and Itô’s Lemma.
Expectation. Let X denote a discrete random variable with probability function p(x) (probability density function f(x) if X is continuous) then the expected.
Robert Engle UCSD and NYU and Robert F. Engle, Econometric Services DYNAMIC CONDITIONAL CORRELATIONS.
Monte-Carlo Simulations Seminar Project. Task  To Build an application in Excel/VBA to solve option prices.  Use a stochastic volatility in the model.
Multiple Logistic Regression STAT E-150 Statistical Methods.
Trees Example More than one variable. The residual plot suggests that the linear model is satisfactory. The R squared value seems quite low though,
Sampling and estimation Petter Mostad
Value at Risk Chapter 20 Options, Futures, and Other Derivatives, 7th International Edition, Copyright © John C. Hull 2008.
Simulation Chapter 16 of Quantitative Methods for Business, by Anderson, Sweeney and Williams Read sections 16.1, 16.2, 16.3, 16.4, and Appendix 16.1.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Logistic Regression Saed Sayad 1www.ismartsoft.com.
Options, Futures, and Other Derivatives, 5th edition © 2002 by John C. Hull 16.1 Value at Risk Chapter 16.
Options, Futures, and Other Derivatives, 4th edition © 1999 by John C. Hull 14.1 Value at Risk Chapter 14.
Intro to Statistics for the Behavioral Sciences PSYC 1900 Lecture 7: Regression.
Central Limit Theorem Let X 1, X 2, …, X n be n independent, identically distributed random variables with mean  and standard deviation . For large n:
1 Ka-fu Wong University of Hong Kong A Brief Review of Probability, Statistics, and Regression for Forecasting.
1 VaR Models VaR Models for Energy Commodities Parametric VaR Historical Simulation VaR Monte Carlo VaR VaR based on Volatility Adjusted.
Chapter 13 Wiener Processes and Itô’s Lemma 1. Stochastic Processes Describes the way in which a variable such as a stock price, exchange rate or interest.
Returns and stylized facts. Returns Objective: Use available information to say something about future returns.
Types of risk Market risk
The Three Common Approaches for Calculating Value at Risk
Wiener Processes and Itô’s Lemma
Vera Tabakova, East Carolina University
Correlation and Simple Linear Regression
Types of risk Market risk
Probability & Statistics Probability Theory Mathematical Probability Models Event Relationships Distributions of Random Variables Continuous Random.
Correlation and Simple Linear Regression
Machine Learning Math Essentials Part 2
Chapter 14 Wiener Processes and Itô’s Lemma
Kunal Jain March 24, 2010 Economics 201FS
Correlation and Simple Linear Regression
Correlation and Simple Linear Regression
Presentation transcript:

Volatility

Downloads  Today’s work is in: matlab_lec04.m  Functions we need today: simsec.m, simsecJ.m, simsecSV.m  Datasets we need today: data_msft.m

Homework 1 function r=simsec(mu,sigma,T); x=randn(T,1); for t=1:T; r(t,1)=exp(mu+sigma*x(t))-1; end;

Simulate Simple Process >>data_msft; >>subplot(2,1,1); hist(msft(:,4),[-.2:.01:.2]); >>sigma=std(msft(:,4)); >>mu=mean(msft(:,4))-.5*sigma^2; T=length(msft); >>r=simsec(mu,sigma,T); >>disp([mean(msft(:,4)) mean(r)]); >>disp([std(msft(:,4)) std(r)]); >>disp([skewness(msft(:,4)) skewness(r)]); >>disp([kurtosis(msft(:,4)) kurtosis(r)]); >>subplot(2,1,2); hist(r,[-.2:.01:.2]);

Compare simulated to actual  Mean, standard deviation, skewness match well  Kurtosis (extreme events) does not match well  Actual has much more mass in the tails (fat tails)  This is extremely important for option pricing!  CLT fails when tails are “too” fat

Modelling Volatility  How to make tales fatter?  Add jumps to log normal distribution to make tails fatter  Jumps also help with modeling default  Make volatility predictable:  Stochastic volatility, governed by state variable  ARCH process (2003 Nobel prize, Rob Engle)

Jumps  R(t)=exp(µ+σ*X(t)+J(t))  J(t)=J 1 with p 1, J 2 with p 2, 0 with 1- p 1 -p 2 >>nlow=sum(msft(:,4)<-.1); >>nhigh=sum(msft(:,4)>.1); >>[T a]=size(msft); >>p1=nlow/T; p2=nhigh/T; >>J1=-.15; J2=.15;

Simulating Jumps function r=simsecJ(mu,sigma,J1,J2,p1,p2,T); x=randn(T,1); y=rand(T,1); for t=1:T; if y(t)<p1; J(t)=J1; elseif y(t)<p1+p2; J(t)=J2; else J(t)=0; end; r(t)=exp(mu+sigma*x(t)+J(t))-1; end;

Simulating Jumps >>r=simsecJ(mu,sigma,J1,J2,p1,p2,T); >>disp([mean(msft(:,4)) mean(r)]); >>disp([std(msft(:,4)) std(r)]); >>disp([skewness(msft(:,4)) skewness(r)]); >>disp([kurtosis(msft(:,4)) kurtosis(r)]); >>subplot(2,1,2); hist(r,[-.2:.01:.2]); %Note that kurtosis of simulated now matches actual

Stochastic Volatility  Suppose volatility was not constant, but changed through time and was predictable  This is very realistic, volatility tends to be much higher during recessions than expansions; high volatility tends to predict high volatility  That is sigma is replaced by sigma(t)=f(Z(t)) where Z(t) is a random variable

Moving Average  When we have a long time series of data we can calculate the local average a few points around each point in time, this is called a moving average  We will write code to calculate a moving average and use it to analyze stochastic volatility (to be used later as well)

Moving Average >>T1=floor(T/7); ma=zeros(T1,2); >>for i=1:T1; in=(i-1)*7+1:(i-1)*7+7; ma(i,1)=std(msft(in,4)); ma(i,2)=mean(msft(in,4).^2); for j=1:7; t=(i-1)*7+j; ma(i,2)=ma(i,2)+(msft(t,4)^2)/7; end; >>disp(corrcoef(ma(:,1),ma(:,2)));

>>subplot(3,1,1); plot(ma(:,1)); >>subplot(3,1,2); plot(ma(:,2)); >>WN=exp(randn(T1,1)); subplot(3,1,3); plot(WN);

regress()  regcoef=regress(Y,X) regresses vector time series Y on multiple time series in X  regcoef contains the regression coefficients  Y must be Tx1, X must be TxN where N is the number of regressors  If you want a constant in your regression, first column of X must be all 1’s  ie y(t)=A+B*x(t), than Y=[y(1); y(2); … y(T)], X=[1 x(1); 1 x(2); … 1 x(T)]  [a1 a2]=regress(Y,X) gives coefficients in a1, and 95% bounds in a2  [a1 a2 a3 a4 a5]=regress(Y,X) gives coefficients in a1, 95% bounds in a2, R 2 in a5(1)

No predictability in WN >>X=[ones(T1-1,1) WN(1:T1-1,1)]; >>Y=WN(2:T1,1); >>[regcoef sterr a3 a4 rsq]=regress(Y,X); >>disp([regcoef sterr]);  Note regcoef(2) is close to zero and sterr(2,:) is not significant disp(rsq(1));  Note, R 2 is close to zero

Predictability in Volatility >>X=[ones(T1-1,1) ma(1:T1-1,2)]; >>Y=ma(2:T1,2); >>[regcoef sterr a3 a4 rsq]=regress(Y,X); >>disp([regcoef sterr]); %Note regcoef(2) is positive and significant! >>disp(rsq(1)); %Note, R 2 is 14.86%! %Even with a simple linear model we get %predictability! Can you think of better models?

Scatter Plot >>subplot(2,1,1); plot(WN(1:T1-1,1),WN(2:T1,1),'.'); >>subplot(2,1,2); plot(ma(1:T1-1,2),ma(2:T1,2),'.');

Discrete, Markov volatility  sigma(t)=.015 or.025 (daily)  When sigma(t)=.015, it will be.015 with probability.9 tomorrow, and will be.025 with probability.1 tomorrow  When sigma(t)=.025, it will be.025 with probability.9 tomorrow, and will be.015 with probability.1 tomorrow  Transition probability matrix: [.9.1;.1.9]  This is a 2-state Markov process, it is predictable, when sigma(t) is high, it is likely to stay high

AR(1) Volatility  Let Z(t) be a normal rv  Let W(t)=ρ S W(t-1)+σ S Z(t)  This is called an AR(1) process, as you can see it is predictable, W(t) is expected to be high when W(t-1) is high  Let σ(t)=µ S +W(t)  Do you see any problems with this process?  If σ S =0 than σ(t)=µ S so constant vol  If ρ S =0 than σ(t) is i.i.d. and there is no persistence in vol

Simulating Stochastic Vol function r=simsecSV(mu,muS,J1,J2,p1,p2,rho,sigmaS,T); x=randn(T,1); y=rand(T,1); z=randn(T+1,1); W(1)=0; J=zeros(T,1); r=zeros(T,1); for t=1:T; W(t+1)=rho*W(t)+sigmaS*z(t+1); sigma(t)=abs(muS+W(t)); if y(t)<p1; J(t)=J1; elseif y(t)<p1+p2; J(t)=J2; else J(t)=0; end; r(t)=exp(mu+sigma(t)*x(t)+J(t))-1; end;

Moving Average of Simulated sigmaS=.0025; rho=.96; r=simsecSV(mu,sigma,J1,J2,p1,p2,rho,sigmaS,T); T1=floor(T/7); masim=zeros(T1,2); for i=1:T1; in=(i-1)*7+1:(i-1)*7+7; masim(i,1)=std(r(in,1)); masim(i,2)=mean(r(in,1).^2); for j=1:7; t=(i-1)*7+j; masim(i,2)=masim(i,2)+(r(t,1)^2)/7; end;

>>X=[ones(T1-1,1) masim(1:T1-1,1)]; Y=masim(2:T1,1); >>[regcoef sterr a3 a4 rsq]=regress(Y,X); >>disp([regcoef sterr]); disp(rsq(1)); >>subplot(2,1,1); plot(ma(:,1)) >>subplot(2,1,2); plot(masim(:,1));

Optional Homework (2)  Use the function from Homework (1) to simulate Microsoft daily returns for a period of a year many times, over and over again  Each time record the total return for the year  This is called Monte-Carlo simulation  How likely is it that Microsoft loses 30% in one year? How likely is it to lose 40%?  Separate the worst 5% of years from the next 95%. What is the value lost at the 5% break? This is called Value at Risk, it is a commonly used risk measure  How sensitive is Value at Risk to jump parameters? Jump events are quite rare, do you think they are easy to estimate?

Optional Homework (3)  Extend the model by adding stochastic volatility, try both the discrete Markov and the AR(1) process (AR(1) case done in class in file simsecSV.m)  How does this change kurtosis and likelyhood of tail events?  Plot a time series of squared Microsoft returns and squared simulated returns (with and without stochastic volatility)  Does it look like high times are followed by high times in the data? In the model with no stochastic vol? In the model with stochastic vol?  Do you see any problems with the AR(1) formulation for volatility?  Does Value at Risk change during high volatility and low volatility times?