STAT Financial Time Series

Similar documents
Volatility. Gerald P. Dwyer. February Clemson University

STAT Financial Time Series

STAT Financial Time Series

13. Estimation and Extensions in the ARCH model. MA6622, Ernesto Mordecki, CityU, HK, References for this Lecture:

6. The econometrics of Financial Markets: Empirical Analysis of Financial Time Series. MA6622, Ernesto Mordecki, CityU, HK, 2006.

Empirical Market Microstructure Analysis (EMMA)

The autocorrelation and autocovariance functions - helpful tools in the modelling problem

GARCH Models. Eduardo Rossi University of Pavia. December Rossi GARCH Financial Econometrics / 50

GARCH processes probabilistic properties (Part 1)

Lecture 6: Univariate Volatility Modelling: ARCH and GARCH Models

FE570 Financial Markets and Trading. Stevens Institute of Technology

THE UNIVERSITY OF CHICAGO Graduate School of Business Business 41202, Spring Quarter 2003, Mr. Ruey S. Tsay

Econ 423 Lecture Notes: Additional Topics in Time Series 1

Review Session: Econometrics - CLEFIN (20192)

Symmetric btw positive & negative prior returns. where c is referred to as risk premium, which is expected to be positive.

Introduction to ARMA and GARCH processes

Multivariate GARCH models.

Nonstationary time series models

4. MA(2) +drift: y t = µ + ɛ t + θ 1 ɛ t 1 + θ 2 ɛ t 2. Mean: where θ(l) = 1 + θ 1 L + θ 2 L 2. Therefore,

Lecture 14: Conditional Heteroscedasticity Bus 41910, Time Series Analysis, Mr. R. Tsay

ARCH and GARCH Processes

ECONOMICS 7200 MODERN TIME SERIES ANALYSIS Econometric Theory and Applications

MAT 3379 (Winter 2016) FINAL EXAM (SOLUTIONS)

Nonlinear Time Series Modeling

Multivariate Time Series: VAR(p) Processes and Models

GARCH Models Estimation and Inference

MEI Exam Review. June 7, 2002

Arma-Arch Modeling Of The Returns Of First Bank Of Nigeria

Dynamic Time Series Regression: A Panacea for Spurious Correlations

Univariate Volatility Modeling

MODELING INFLATION RATES IN NIGERIA: BOX-JENKINS APPROACH. I. U. Moffat and A. E. David Department of Mathematics & Statistics, University of Uyo, Uyo

Marcel Dettling. Applied Time Series Analysis SS 2013 Week 05. ETH Zürich, March 18, Institute for Data Analysis and Process Design

Modelling using ARMA processes

Nonlinear time series

Diagnostic Test for GARCH Models Based on Absolute Residual Autocorrelations

STAT 443 Final Exam Review. 1 Basic Definitions. 2 Statistical Tests. L A TEXer: W. Kong

University of Oxford. Statistical Methods Autocorrelation. Identification and Estimation

Comprehensive Examination Quantitative Methods Spring, 2018

Lecture 1 Intro to Spatial and Temporal Data

Stationary Time Series, Conditional Heteroscedasticity, Random Walk, Test for a Unit Root, Endogenity, Causality and IV Estimation

STAT Financial Time Series

Problem Set 1 Solution Sketches Time Series Analysis Spring 2010

Econometrics. Week 4. Fall Institute of Economic Studies Faculty of Social Sciences Charles University in Prague

α i ξ t i, where ξ t i.i.d. (0, 1),

Time Series I Time Domain Methods

Introduction and Single Predictor Regression. Correlation

Lecture 1: Fundamental concepts in Time Series Analysis (part 2)

Financial Econometrics

Correlation and Regression

Study Sheet. December 10, The course PDF has been updated (6/11). Read the new one.

Time Series 2. Robert Almgren. Sept. 21, 2009

GARCH Models Estimation and Inference

Stat 5102 Final Exam May 14, 2015

Chapter 3. ARIMA Models. 3.1 Autoregressive Moving Average Models

Quick Review on Linear Multiple Regression

If we want to analyze experimental or simulated data we might encounter the following tasks:

3. ARMA Modeling. Now: Important class of stationary processes

MAT 3379 (Winter 2016) FINAL EXAM (PRACTICE)

Autoregressive Moving Average (ARMA) Models and their Practical Applications

Lecture 3: Autoregressive Moving Average (ARMA) Models and their Practical Applications

Biostatistics 380 Multiple Regression 1. Multiple Regression

Time Series Analysis -- An Introduction -- AMS 586

MODELLING TIME SERIES WITH CONDITIONAL HETEROSCEDASTICITY

Gaussian Copula Regression Application

Applied Regression Analysis

Part III Example Sheet 1 - Solutions YC/Lent 2015 Comments and corrections should be ed to

July 31, 2009 / Ben Kedem Symposium

Qualifying Exam CS 661: System Simulation Summer 2013 Prof. Marvin K. Nakayama

Circle the single best answer for each multiple choice question. Your choice should be made clearly.

ECON3327: Financial Econometrics, Spring 2016

Estimation of extreme value dependence: application to Australian spot electricity prices. Nadezda Frolova

End-Semester Examination MA 373 : Statistical Analysis on Financial Data

Applied time-series analysis

GMM - Generalized method of moments

1 Time Series Concepts and Challenges

APPLIED ECONOMETRIC TIME SERIES 4TH EDITION

Problem set 1 - Solutions

The Bootstrap: Theory and Applications. Biing-Shen Kuo National Chengchi University

DEPARTMENT OF ECONOMICS

Econ 623 Econometrics II Topic 2: Stationary Time Series

Homework 2. For the homework, be sure to give full explanations where required and to turn in any relevant plots.

Interval Estimation for AR(1) and GARCH(1,1) Models

Lecture 16: State Space Model and Kalman Filter Bus 41910, Time Series Analysis, Mr. R. Tsay

Chapter 12: An introduction to Time Series Analysis. Chapter 12: An introduction to Time Series Analysis

Stochastic Processes: I. consider bowl of worms model for oscilloscope experiment:

Econometric Forecasting

5 Transfer function modelling

Time Series Analysis. James D. Hamilton PRINCETON UNIVERSITY PRESS PRINCETON, NEW JERSEY

Lecture 2: Univariate Time Series

Time Series Modeling of Financial Data. Prof. Daniel P. Palomar

13. Time Series Analysis: Asymptotics Weakly Dependent and Random Walk Process. Strict Exogeneity

Appendix 1 Model Selection: GARCH Models. Parameter estimates and summary statistics for models of the form: 1 if ɛt i < 0 0 otherwise

Linear Regression. In this lecture we will study a particular type of regression model: the linear regression model

Econometrics I: Univariate Time Series Econometrics (1)

EASTERN MEDITERRANEAN UNIVERSITY ECON 604, FALL 2007 DEPARTMENT OF ECONOMICS MEHMET BALCILAR ARIMA MODELS: IDENTIFICATION

ARIMA Modelling and Forecasting

A Non-Parametric Approach of Heteroskedasticity Robust Estimation of Vector-Autoregressive (VAR) Models

Circle a single answer for each multiple choice question. Your choice should be made clearly.

Risk Forecasting with GARCH, Skewed t Distributions, and Multiple Timescales

Reading Assignment. Serial Correlation and Heteroskedasticity. Chapters 12 and 11. Kennedy: Chapter 8. AREC-ECON 535 Lec F1 1

Transcription:

STAT 6104 - Financial Time Series Chapter 9 - Heteroskedasticity Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 1 / 43

Agenda 1 Introduction 2 AutoRegressive Conditional Heteroskedastic Model (ARCH) 3 Genearlized ARCH (GARCH) model 4 Estimation and Testing for ARCH 5 Foreign exchange rates example Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 2 / 43

Introduction Heteroskedasticity = non-constant variance Regression Context: where Y = Xβ + e, w 1 0 0 Var(e) = σ 2 0 w 2 0...... 0 0 w n Generalized least squares is used instead of ordinary least squares to account for the heterogenity of e Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 3 / 43

Introduction Variation is small for a number of successive periods of time and large for some other successive periods Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 4 / 43

Heteroskedasticity in time series e.g. log Assets price series {Y t }, i.e. Y t = log(p t ), where P t = asset price at time t Usually, X t = Y t = ɛ t is a good model i.e. Y t ARIMA(0, 1, 0) Empirically, ɛ t is found to have different variance over time Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 5 / 43

Stylized facts for log asset series X t In reality 1 X t is heavy-tailed (probability of taking a very small/large value is high) 2 {X t } is not serially correlated 3 {X 2 t } is serially correlated 4 Volatility cluster: large (small) changes in {X t } tend to be followed by large (small) changes Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 6 / 43

Agenda 1 Introduction 2 AutoRegressive Conditional Heteroskedastic Model (ARCH) 3 Genearlized ARCH (GARCH) model 4 Estimation and Testing for ARCH 5 Foreign exchange rates example Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 7 / 43

AutoRegressive Conditional Heteroskedastic Model (ARCH) A very popular model for volatility Model: ARCH(p) X t = σ t ɛ t, ɛ iid N (0, 1) p σt 2 = α 0 + α i Xt i 2 Meaning of conditional heteroskedastic model Let F t 1 = σ(x t 1, X t 2,...) be the σ-field (information) generated by all past information up to time t 1 i=1 E[X 2 t F t 1 ] = σ 2 t E[ɛ 2 t F t 1 ] = σ 2 t = α 0 + p α i Xt i 2 i=1 Conditional variance depends on previous values of X 2 t s Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 8 / 43

AutoRegressive Conditional Heteroskedastic Model (ARCH) ARCH(p) model: X t = σ t ɛ t, ɛ iid N (0, 1) p σt 2 = α 0 + α i Xt i 2 i=1 Restriction for the parameter set (α 0, α 1,..., α p ) α i 0, i = 0, 1,..., p Variance must be positive α 1 +... α p < 1 Must sure σ 2 t is stationary, otherwise σ 2 t explodes Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 9 / 43

Example 9.1 (Cont ) As α 1 < 1 and n Xt 2 n = α 0 α j 1 ɛ2 t ɛ 2 t j j=1 X t is causal but nonlinear and we have two methods to find E[X 2 t ] 1 E[X 2 t ] = α 0 j=0 αj 1 (E[ɛ 2 t ] = 1, t) 2 Take expectation on both sides on X 2 t = ɛ 2 t (α 0 + α 1 X 2 t 1), then E[X 2 t ] = α0 1 α 1 E[X 2 t ] = α 0 E[ɛ 2 t ] + α 1 E[X 2 t 1] as E[Xt 2 ] = E[Xk 2 ] for all pairs of t, k Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 10 / 43

Example 9.1 (Cont ) Properties of ARCH(1) X t is causal and non-linear E[X t ] = E{E(X t F t 1 )} = E[σ t E{ɛ t F t 1 }] = 0 Var(X t ) = E[X 2 t ] = α 0 1 α 1 Cov(X t+h, X t ) = E[X t+h X t ] = E[E{X t+h X t F t 1 }] = E[X t E{X t+h F t 1 }] = 0 E[X 2 t F t 1 ] = σ 2 t = α 0 + α 1 X 2 t 1 E[X 2 t ] = α 0 1 α 1 Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 11 / 43

Example 9.1 (Cont ) Relation between ARCH(1) and AR(1) ARCH : X t = σ t ɛ t, σ 2 t = α 0 + α 1 X 2 t 1 Rewrite Xt 2 = σt 2 + Xt 2 σt 2 = α 0 + α 1 Xt 1 2 + σt 2 (1 ɛ 2 t ) = α 0 + α 1 X 2 t 1 + ν t If X t ARCH(1), then X 2 t AR(1) with sequence ν t = σ 2 t (1 ɛ 2 t ) Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 12 / 43

Example 9.1 (Cont ) Properties of ν t = σ 2 t (1 ɛ 2 t ) E[ν t ] = E[E{σ 2 t (1 ɛ 2 t ) F t 1 }] = E[σ 2 t ]E[1 ɛ 2 t ] = 0 Var(ν t ) = E[ν 2 t ] = E[σ 4 t (1 ɛ 2 t ) 2 ] = 2E[σ 4 t ] (ɛ t N (0, 1) E[σ 4 t ] = 3) Cov(ν t, ν t+h ) = E[E{σt 2 σt+h(1 2 ɛ 2 t )(1 ɛ 2 t+h) F t+h 1 }] = 0 Thus, {ν t } is indeed a white noise. Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 13 / 43

Example 9.1 (Cont ) ARCH : X t = σ t ɛ t, σt 2 = α 0 + α 1 Xt 1 2 AR(1) representation: Xt 2 = α 0 + α 1 Xt 2 2 + ν t, where ν t = σt 2 (1 ɛ 2 t ). As Xt 2 = σt 2 ɛ 2 t σt 2, (E[ɛ 2 t ] = 1) The AR(1) representation can be regarded as the description of the convolution of the variance of the process {X t } The correlation structure of Xt 2 model follows the same calculation of AR(1) Var(Xt 2 ) = Var(ν t) 1 α1 2, Cov(Xt 2, Xt+h) 2 = α h 1 Var(ν t) 1 α1 2, Corr(Xt 2, Xt+h) 2 = α h 1 Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 14 / 43

Example 9.1 (Cont ) To completely determine the covariance strcuture of {X 2 t } it remains to compute Var(ν t ) = 2E[σ 2 t ] Square both sides of σt 2 = α 0 + α 1 Xt 1 2 and take expectation E[σ 2 t ] = α 2 0 + 2α 0 α 1 E[X 2 t 1] + α 2 + 1E[X 4 t 1] = α0 2 α 0 + 2α 0 α 1 3α 1 α 1E[σ 2 t 4 ] 1 = α0 2(1 + α 1) (1 α 1 )(1 3α1 2) Note that the 4 th moment E[σ 2 t ] exists only if α 2 1 < 1 3 Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 15 / 43

The Usefulness of ARCH(1) Model Stylized fact 1: X t is heavy-tailed Usually the heavier the tail, the larger the 4 th moment E[X 4 t ] = E[σ 4 t ]E[ɛ 4 t ] = 3α 0 (1 + α 1 ) (1 α 1 )(1 3α 2 1 ) For larger α 0 and small α 1, E[X 4 t ] can be very large In practice, the α 1 found is around 0.9 in many financial time series Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 16 / 43

The Usefulness of ARCH(1) Model Stylized fact 2: Correlated structure {X t } is not serially correlated {X 2 t } is non-negatively serially correlated This means Cov(X t, X t+h ) = 0, for h 0 Corr(X 2 t, X 2 t+h ) = α h 1 > 0 as α 1 > 0 by assumption Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 17 / 43

The Usefulness of ARCH(1) Model Stylized fact 3: Volatility cluster Large (small) changes in {X t } tend to be followed by large (small) changes Well explained by the equation σ 2 t = α 0 + α 1 X 2 t 1, as α 1 > 0 Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 18 / 43

Agenda 1 Introduction 2 AutoRegressive Conditional Heteroskedastic Model (ARCH) 3 Genearlized ARCH (GARCH) model 4 Estimation and Testing for ARCH 5 Foreign exchange rates example Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 19 / 43

Genearlized ARCH (GARCH) model GARHC(p, q) model X t = σ t ɛ t, ɛ t N (0, 1) σt 2 = p α 0 + β i σt i 2 + i=1 Parameter set: (α 0, α 1,..., α q, β 1,..., β p ) - more flexibility for modelling Constraints α 1 +... + α q + β 1 +... + β p < 1 q α j Xt j 2 j=1 α j 0, j = 0,..., q, β i 0, i = 1,..., p, Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 20 / 43

GARCH Example 9.2: GARCH(1,1) is the most commonly used GARCH model in practice X t = σ t ɛ t, σ 2 t α 0 + α 1 X 2 t 1 + β 1 σ 2 t 1 Condition to ARMA(1,1) model: X 2 t = σ 2 t + X 2 t σ 2 t = α 0 + α 1 X 2 t 1 + β 1 σ 2 t 1 + X 2 t σ 2 t = α 0 + α 1 X 2 t 1 β 1 (X 2 t 1 σ 2 t 1) + β 1 X 2 t 1 + X 2 t σ 2 t = α 0 + (α 1 + β 1 )X 2 t 1 + ν t β 1 ν t 1, ARMA(1, 1)with white noise {ν t }, where ν t = X 2 t σ 2 t = σ 2 t (ɛ 2 t 1) Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 21 / 43

GARCH and ARMA models In general, we have Theorem 1 If X t is a GARCH(p,q) process, then Xt 2 is an ARMA(m,p) process with noise ν t = σt 2 (ɛ 2 t 1), where m = max{p, q} Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 22 / 43

I-GARCH model For GARCH model with σt 2 = α 0 + α 1 Xt 1 2 + β 1σt 1 2 one necessary condition is to be stationary, α 1 + β 1 < 1 In practice, α 1 + β 1 1 is observed in many real datasets When α 1 + β 1 = 1, the process in non-stationary and is known as Integrated GARCH (I-GARCH) process. Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 23 / 43

I-GARCH model E[σ 2 t+1 F t 1 ] = E[α 0 + α 1 X 2 t + β 1 σ 2 t F t 1 ] = α 0 + (α 1 + β 1 )σ 2 t = α 0 + σ 2 t E[σ 2 t+1 F t 1 ] = E[E{σ 2 t+2 F t } F t 1 ] = E[α 0 + σ 2 t+1 F t 1 ] Similarly, = 2α 0 + σ 2 t E[σ 2 t+j F t 1 ] = jα 0 + σ 2 t Thus, I-GARCH in non-stationary The volatility is persistent: For any j > 0, E[σ 2 t+j F t 1 ] depends on σ 2 t For GARCH with α 1 + β 1 = 1, E[σt+j 2 F t 1 ] depends on σt 2 through ρ j σt 2 which dminishes. Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 24 / 43

Further generalization of GARCH model t-garch Use t-distribution instead of Normal for noise sequence ɛ t Capture more heavy-tail features e-garch Use the exponential function to model the asymmetry Others: n-garch, GARCH.M,... Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 25 / 43

Agenda 1 Introduction 2 AutoRegressive Conditional Heteroskedastic Model (ARCH) 3 Genearlized ARCH (GARCH) model 4 Estimation and Testing for ARCH 5 Foreign exchange rates example Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 26 / 43

Estimation and Testing for ARCH ARCH: X t = σ t ɛ t, Conditional probability density: σ 2 t = α 0 + α 1 X 2 t 1 +... + α px 2 t p f (x t F t 1 ) = 1 2πσt 2 e 1 2σ t 2 xt 2 Given σ 2 t, we have X 2 t N (0, σ 2 t ) Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 27 / 43

Estimation and Testing for ARCH Likelihood of ARCH(p): f (x n,..., x 1 x 0 ) = f (x n x n 1,... x 0 )... f (x 2 x 1, x 0 )f (x 1 x 0 ) log{f (x n,..., x 1 x 0 )} = log f (x t F t 1 ) = n n 2 log(2π) + 1 2 log σ2 t 1 2 Substitute σt 2 = α + p i=1 α ixt 1 2, the MLE can be obtained by maximizing the log-likelihood numerically. t=1 n xt 2 σ 2 t=1 t Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 28 / 43

Estimation and Testing for ARCH Likelihood of GARCH(p,q): In fact, the same argument holds: log{f (x n,..., x 1 x 0 )} = n n 2 log(2π) + 1 2 log σ2 t 1 2 t=1 The only difference is that σ 2 t is not observed explicitly Use recursion to obtain the approximate version of σ 2 t, σ 2 t σ 2 1 = α 0 σ 2 2 = α 0 + α 1 X 2 1 + β 1 σ 2 1 σ 2 3 = α 0 + α 1 X 2 2 + α 2 X 2 1 + β 1 σ 2 2 + β 2 σ 2 1. σ t 2 = q p α 0 + α i Xn i 2 + β j σ n j 2 i=1 j=1 n xt 2 σ 2 t=1 t Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 29 / 43

Testing for GARCH model To select the order p for ARCH model Use the AR representation and use (P)ACF plot to identify p More difficult for GARCH GARCH(p, q) corresponds to ARMA(p, q), m = max{p, q}. Information on q is lost Difficult to detect the order of ARMA using (P)ACF plot Use AIC/BIC Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 30 / 43

Testing for GARCH model Goodness of fit Protmanteau test for residuals: n Q = n(n + 2) r 2 (j)/(n j) j=1 r(j) is the ACF of the residuals of the GARCH model Q χ 2 n m m is the number of parameters in the model Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 31 / 43

Testing for GARCH model Testing for heterogeneity Lagrange multiplier test (LM) Theorem 2 If X t ARCH(p), then for the fitted regression equation p ˆX t 2 = α 0 + ˆα i Xt i 2 then R 2 satisfies nr 2 χ 2 p. Under H 0 : No heterogeneity, if H 0 is rejected, X t is heteroskedastic. i=1 Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 32 / 43

Agenda 1 Introduction 2 AutoRegressive Conditional Heteroskedastic Model (ARCH) 3 Genearlized ARCH (GARCH) model 4 Estimation and Testing for ARCH 5 Foreign exchange rates example Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 33 / 43

Foreign exchange rates example Weekly echange rates of US dollar and British pound between 1980-1988 exchange.dat Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 34 / 43

Foreign exchange rates example Heavy tail phenomenon in the data ex.s<-scan("d://exchange.dat") dex<-diff(ex.s) hist(dex,prob=t) library(mass) lines(density(dex,width=0.03),lty=3) x<-seq(-0.1,0.1,0.01) lines(x,dnorm(x,mean(dex),sqrt(var(dex))),lty=1) leg.names<-c("kerel Density", "Normal Density") legend("topleft",leg.names,lty=c(3,1)) Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 35 / 43

Foreign exchange rates example Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 36 / 43

Foreign exchange rates example Exploratory data analysis ex.s<-scan("d://exchange.dat") dex<-diff(ex.s) par(mfrow=c(3,2)) ts.plot(ex.s) acf(ex.s) ts.plot(dex) acf(dex) ts.plot(dex*dex) acf(dex*dex) Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 37 / 43

Foreign exchange rates example Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 38 / 43

Foreign exchange rates example Test for heteroskedasticity Lagrange Multiplier test ex.s<-scan("d://exchange.dat") dex<-diff(ex.s) x1<-lag(dex); x1<-c(0,x1[1:468]) x2<-lag(x1); x2<-c(0,x2[1:468]) x3<-lag(x2); x3<-c(0,x3[1:468]) x4<-lag(x3); x4<-c(0,x4[1:468]) z1<-x1*x1; z2<-x2*x2; z3<-x3*x3; z4<-x4*x4 lm.1<-lm(dex*dex z1+z2+z3+z4) summary(lm.1) t<-470*0.04026 >1-pchisq(t,4) [1] 0.0008140926 Conclusion: p-value = 0.0081 < 0.05, the presence of heterogeneity is confirmed Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 39 / 43

Foreign exchange rates example > summary(lm.1) Call: lm(formula = dex * dex z1 + z2 + z3 + z4) Residuals: Min 1Q Median 3Q Max -0.0028480-0.0006073-0.0004331 0.0001337 0.0187001 Coefficients: Estimate Std. Error t value Pr(> t ) (Intercept) 5.113e-04 9.319e-05 5.486 6.76e-08 *** z1 4.693e-02 4.614e-02 1.017 0.30963 z2 3.328e-02 4.575e-02 0.727 0.46729 z3 1.379e-01 4.576e-02 3.013 0.00273 ** z4 1.099e-01 4.615e-02 2.381 0.01766 * --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1 Residual standard error: 0.00151 on 464 degrees of freedom Multiple R-squared: 0.04026, Adjusted R-squared: 0.03199 F-statistic: 4.866 on 4 and 464 DF, p-value: 0.0007485 Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 40 / 43

Foreign exchange rates example #install.packages(tseries)# >library(tseries) >dex.mod<-garch(dex,order=c(1,1)) >summary(dex.mod) # -------------- Call: garch(x = dex, order = c(1, 1)) Model: GARCH(1,1) Residuals: Min 1Q Median 3Q Max -4.4816-0.6675 0.0000 0.5410 4.3634 Coefficient(s): Estimate Std. Error t value Pr(> t ) a0 3.069e-05 1.356e-05 2.262 0.02369 * a1 6.638e-02 2.040e-02 3.254 0.00114 ** b1 8.932e-01 3.339e-02 26.748 < 2e-16 *** # -------------- Fitted model is: σt 2 = 3.2 10 5 + 0.89σt 1 2 + 0.067X t 1 2. Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 41 / 43

Foreign exchange rates example ex.s<-scan("d://exchange.dat") dex<-diff(ex.s) library(tseries) dex.mod<-garch(dex,order=c(1,1)) e<-dex.mod$residuals e<-e[2:469] par(mfrow=c(2,2)) ts.plot(e) acf(e) acf(e*e) qqnorm(e) Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 42 / 43

Foreign exchange rates example Chun Yip Yau (CUHK) STAT 6104:Financial Time Series 43 / 43