%garchex.m clear all; gmmdata; size(rawdata) pause data = rawdata(:,2); %use real, value-weighted return %suppose we want to estimate an ARMA(1,1) model with no conditional mean arp = 1; maq = 1; cflag = 0; result = arma(data,arp,maq,cflag) pause %let's assume this data follows an AR(1) process with GARCH(1,1) volatility spec = garchset('R', 1, 'P', 1, 'Q', 1); garchfit(spec,data) pause %suppose now we think that lagged dividend yield predicts returns - we %should include this in the conditional mean specification (ARMAX) %we'll use an affine factor model where the factors correspond to %Fama-French factors and the return corresponds to a portfolio of clear all; garchff; ret = rawdata(:,1); factors = rawdata(:,2:4); spec = garchset('P', 1, 'Q', 1); garchfit(spec,ret,factors)