#Courtesy of Dr Malvina Marchese (Bayes Business School) for BCPM0021 2022-23 academic year# series logret=dlog(adj_close) logret.ipolate goodret2 equation eq02.arch(tdist) goodret2 eq02.forecast(e, g, forcsmpl="1/29/2021 3/31/2021") goodret2f @garch volmodel2 'extract the estimated degree of freedom from the garch model above scalar dfM=eq02.c(4) 'compute the 99% quantile for a t with the above degrees of freedom scalar quantileM= @qtdist(0.001,dfM) 'VaR for the outofsample period vector VaRmodel2= volmodels2*quantileM