# It seems, there are no problems
# with libgretl arima ... -nc
# It seems, there are problems
# with stopping rules
#***********************************************************
scalar enormous = 2*$huge
set bfgs_maxgrad enormous
open greene5_1.gdt
logs realcons
ldiff realcons
# surprisingly small
eval mean(ld_realcons)/sd(ld_realcons)
arima 1 1 1; l_realcons --nc -q
eval $coeff
lnl0 = $lnl
eval $model.roots
eval lnl0
modtest --autocorr
arima 1 1 1; l_realcons --nc --x-12-arima -q
eval $coeff
lnl1 = $lnl
printf "\nlnl difference (libgretl - x13): %g\n", lnl0 - lnl1
arima 1 1 1; 0 0 1; l_realcons --nc -q
eval $coeff
lnl0 = $lnl
eval $model.roots
eval lnl0
arima 1 1 1; 0 0 1; l_realcons --nc --x-12-arima -q
eval $coeff
lnl1 = $lnl
printf "\nlnl difference (libgretl - x13): %g\n", lnl0 - lnl1
arima 1 1 1; 1 0 0; l_realcons --nc -q
eval $coeff
lnl0 = $lnl
eval $model.roots
eval lnl0
arima 1 1 1; 1 0 0; l_realcons --nc --x-12-arima -q
eval $coeff
lnl1 = $lnl
printf "\nlnl difference (libgretl - x13): %g\n", lnl0 - lnl1
#
# ***************************************************************
#
# final gradient norm simply depends on scaling
set bfgs_maxgrad 5
set bfgs_verbskip 10000
catch arima 1 0 1; ld_realcons --nc --verbose
sld = ld_realcons/sd(ld_realcons)
catch arima 1 0 1; sld --nc --verbose