Page 1 of 2

ROBUSTERRORS

Posted: Sat Dec 19, 2020 4:39 am
by ac_1
Hi Tom,

LINREG has a ROBUSTERRORS option, is there an equivalent for BOXJENK and for STWISE? If not how do I calculate them?

Thanks,
Amarjit

Re: ROBUSTERRORS

Posted: Sat Dec 19, 2020 12:57 pm
by TomDoan
STWISE actually has the standard HAC standard error calculations; it's just not documented. BOXJENK does not.

Re: ROBUSTERRORS

Posted: Sat Dec 19, 2020 1:51 pm
by ac_1
So STWISE computes Heteroskedasticity and autocorrelation-consistent (HAC) estimators by default, no option? Why does BOXJENK not?

Re: ROBUSTERRORS

Posted: Sat Dec 19, 2020 3:06 pm
by TomDoan
STWISE has the usual set of options for HAC (ROBUSTERRORS, LAGS, LWINDOW. etc.).

BOXJENK is a much broader instruction which can estimate using methods other than least squares.

Re: ROBUSTERRORS

Posted: Sun Dec 20, 2020 2:50 am
by ac_1
Many Thanks. Gujarati has the matrix approach to CLRM, estimation via OLS and illustrative example. Please can you provide a reference for ARIMA numerical calculation by-hand - I am aware there may be optimisation of a log-likelihood function.

Re: ROBUSTERRORS

Posted: Sun Dec 20, 2020 5:55 pm
by TomDoan
Use the DERIVES option on BOXJENK, and do the sandwich covariance calculation:

boxjenk(constant,ar=1,ma=1,derives=dd) spread 1961:4 2008:1
mcov / %resids
# dd
compute xxrobust=%xx*%cmom*%xx

where xxrobust will be the adjusted covariance matrix. That version of MCOV does the Eicker-White type of adjustment. A HAC adjustment really doesn't make sense since the residuals aren't supposed to be autocorrelated in the first place.

Re: ROBUSTERRORS

Posted: Mon Dec 21, 2020 1:43 pm
by ac_1
Many Thanks. Here's an example using data from Greene, comparing adjusted SE, T-stat and Signif for the constant term only, please check.

Code: Select all

*
* Greene, Econometric Analysis, 7th Edition
* Example cut out of final draft.
*
open data tablef22-1.txt
calendar(m) 1990
data(format=prn,org=columns) 1990:1 1994:12 date y
*
* Center the series over the entire span of data
diff(center) y / yc
*
boxjenk(constant,ar=1,ma=1,derives=dd) yc
mcov / %resids
# dd
compute xxrobust=%xx*%cmom*%xx
*
disp ""
disp "CONSTANT Coeff " #.######### %beta(1)
disp "CONSTANT Std Error " #.######### %stderrs(1)
comp tstat = %beta(1) / %STDERRS(1)
disp "CONSTANT T-stat " #.######### tstat
comp pvalue = 2.0 * %TCDF(-abs(tstat),%nobs-3.0)
disp "CONSTANT Signif " #.######### pvalue
*
disp ""
disp "CONSTANT Coeff " #.######### %beta(1)
disp "CONSTANT SCC Std Error " #.######### xxrobust(1,1)
comp scctstat = %beta(1)/xxrobust(1,1)
disp "CONSTANT SCC T-stat " #.######### scctstat
comp sccpvalue = 2.0 * %TCDF(-abs(scctstat),%nobs-3.0)
disp "CONSTANT SCC Signif " #.######### sccpvalue
*
is there a reference for step-by-step ARIMA numerical calculation by-hand?

Re: ROBUSTERRORS

Posted: Mon Dec 21, 2020 2:01 pm
by TomDoan
XXROBUST is the robust covariance matrix so the standard errors are the square roots of the diagonal elements, not the diagonal elements themselves.

That's the standard calculation for Eicker-White standard errors in non-linear least squares.

Re: ROBUSTERRORS

Posted: Mon Dec 21, 2020 2:30 pm
by ac_1
Sorry.

Code: Select all

*
disp ""
disp "CONSTANT Coeff " #.######### %beta(1)
disp "CONSTANT SCC Std Error " #.######### (xxrobust(1,1))**0.5
comp scctstat = %beta(1)/(xxrobust(1,1))**0.5
disp "CONSTANT SCC T-stat " #.######### scctstat
comp sccpvalue = 2.0 * %TCDF(-abs(scctstat),%nobs-3.0)
disp "CONSTANT SCC Signif " #.######### sccpvalue
*

Re: ROBUSTERRORS

Posted: Mon Dec 21, 2020 2:38 pm
by TomDoan
That looks correct, though you probably would be better off using %TTEST rather than monkeying around with %TCDF:

https://estima.com/ratshelp/functionlist.html#ttest

Note also that %NDF will have the T-k so you don't have to hard-code the degrees of freedom adjustment.

Re: ROBUSTERRORS

Posted: Thu Dec 24, 2020 2:11 am
by ac_1
Comparing BOXJENK with manual calculation of Eicker-White SE's and LINREG(ROBUSTERRORS) I get different results, the main being for the constant. Why?
Also, are the Eicker-White SE's still relevant if I use MAXL (which does slow down estimation in recursive/rolling regressions) with BOXJENK?

Code: Select all

*
* Greene, Econometric Analysis, 7th Edition
* Example cut out of final draft.
*
open data tablef22-1.txt
calendar(m) 1990
data(format=prn,org=columns) 1990:1 1994:12 date y
*
* Center the series over the entire span of data
diff(center) y / yc
*
*
boxjenk(constant,ar=6,derives=dd) yc
*
*  Eicker-White SE's
*
mcov / %resids
# dd
compute xxrobust=%xx*%cmom*%xx
do i = 1, %nreg
   comp tStat = %beta(i)/xxrobust(i,i)**0.5
   comp pValue = %ttest(-abs(tStat),%ndf)
   disp "tStat " # i  #.#########  tStat "pValue" # i  #.######### pValue
end do i


linreg(robusterrors) y
# constant y{1 to 6}


Re: ROBUSTERRORS

Posted: Thu Dec 24, 2020 8:50 am
by TomDoan

Re: ROBUSTERRORS

Posted: Thu Dec 24, 2020 11:31 am
by ac_1
Apologies:

Code: Select all

linreg(robusterrors) yc
# constant yc{1 to 6}
I will have a read...

Re: ROBUSTERRORS

Posted: Sat Dec 26, 2020 5:02 am
by ac_1
I have had a read and I remain unclear. BOXJENK is estimating by LS Gauss-Newton. LINREG is estimating by Least Squares. The Eicker-White SE's are similar, the main difference being in the constant Coeff. Can I get the same results using BOXJENK and LINREG, and if so how?

Re: ROBUSTERRORS

Posted: Sat Dec 26, 2020 10:19 am
by TomDoan
ac_1 wrote:I have had a read and I remain unclear. BOXJENK is estimating by LS Gauss-Newton. LINREG is estimating by Least Squares. The Eicker-White SE's are similar, the main difference being in the constant Coeff. Can I get the same results using BOXJENK and LINREG, and if so how?
There are different ways of handling the intercept/mean which is what is described in the paragraph from the User's Guide. BOXJENK uses one way (the more natural way for the types of models it does); LINREG another. If you're doing conditional least squares for an AR model in BOXJENK (rather than maximum likelihood), it produces identical models, just with different parametrizations of the constant/mean.