The GARCH functionality in the econometric toolbox in Matlab is trying to be too clever, but can't deliver and could well be buggy. If you want to try that, here are the docs (estimate). Besides, it can only do univariate GARCH and so can't be used in Chapter 3. Kevin Sheppard's MFE toolbox is much better, while not as user friendly, it is much better written and is certainly more comprehensive. It can be downloaded here and the documentation here is quite detailed.
p = csvread('index.csv', 1, 0); y=diff(log(p))*100; y=y-mean(y); %% We multiply returns by 100 and de-mean them tarch(y,1,0,0); % ARCH(1) tarch(y,4,0,0); % ARCH(4) tarch(y,4,0,1); % GARCH(4,1) tarch(y,1,0,1); % GARCH(1,1) tarch(y,1,0,1,'STUDENTST'); % t-GARCH(1,1)
## No package for ARCH/GARCH estimation as of June 2018 ## We have a mini-package for estimating GARCH(1,1) and t-GARCH(1,1) using CSV; p = CSV.read("index.csv", nullable = false) y = diff(log.(p[:,1]))*100 y = y - mean(y) using FRFGarch; ## Ensure that the folder FRFGarch is in the folder returned when LOAD_PATH is keyed into Julia command line ## The package must be in ../FRFGarch/src/FRFGarch.jl res = GARCHfit(y, "GARCH"); println(res.par) res_t = GARCHfit(y, "t-GARCH"); println(res_t.par) ## GARCH estimation will be slightly different from other languages ## this is due to GARCHfit choosing initial conditional vol = sample vol
aparch(y,1,1,1); % APARCH(1,1) aparch(y,2,2,1); % APARCH(2,1) aparch(y,1,1,1,'STUDENTST'); % t-APARCH(1,1)
## We use the same mini-package to estimate APARCH(1,1) res_AP = GARCHfit(y, "APARCH"); println(res_AP.par) ## GARCH estimation will be slightly different from other languages ## this is due to GARCHfit choosing initial conditional vol = sample vol