I'm using Eviews to optimize a threshold autoregressive model with a GARCH structure in the error term. The threshold effect is only in the mean equation; the variance equation doesn't have the threshold effect and is just a normal GARCH. The equation (simplified) is as follows:
yt = a0 + b1 * yt-1 + b2 * yt-2 + et for yt-1<thresh
and yt = a1 + b3 * yt-1 + b4 * yt-2 + et for yt-1>thresh
ht = a3 + b5 * et^2 + b6 * ht-1, where ht is the variance of et.
The problem is, when "thresh" is a given value, I can get convergence from MLE optimization; if I let "thresh" be a parameter to be estimated within the system, the system doesn't converge (Failure to improve objective (non-zero gradients)...). Currently, I'm estimating "thresh" using the Eviews built-in threshold regression without the GARCH effect, and feeding the estimated "thresh" value to the system mentioned above. I wonder whether this will greatly bias the estimation results. Moreover, whether it is possible in principle to have "thresh" estimated simultaneously with other parameters in the above-mentioned equations.
My optimization codes are as follows:
Code: Select all
subroutine dtarch(series logl, vector beta, series dep, group regs, series thresh, scalar sigma0)
series et = dep - (beta(1) + beta(2)*regs(1) + beta(3)*regs(2))*(thresh<beta(10))-(beta(4)+beta(5)*regs(1)+beta(6)*regs(2))*(thresh>=beta(10)) 'residual from SETAR
series ht=sigma0^2 'define the initial residual variance value
for !n=1 to 172 'forecast residual variance for GARCH
series ht(!n)=(beta(7)+beta(8)*et(!n-1)^2+beta(9)*ht(!n-1))
next
logl = @log((1/ht^0.5)*@dnorm(et/ht^0.5)) 'construct logliklihood equation
endsub
series LL_1
vector(10) coef_1
group xs_1 d_total_in_gdp(-1) d_total_in_gdp(-2) 'Group the autoregressive right hand variables
scalar sigma0_1=@stdev(setar_resid1) 'define the inital residual variance as the unconditonal variance of the SETAR residual
series d_total_in_gdp_lag=d_total_in_gdp(-1) 'threshold variable
optimize(ml=1, hess=bfgs,finalh=mlhess, trust=2, noerr) dtarch(LL_1, coef_1, d_total_in_gdp, xs_1, d_total_in_gdp_lag, sigma0_1) 'optimization using ML
vector MLSE = @sqrt(@getmaindiagonal(-@inverse(mlhess)))
Looking forward to your suggestions. Many thanks!