ROBUSTERRORS

Econometrics questions and discussions

ROBUSTERRORS

Unread postby ac_1 » Sat Dec 19, 2020 5:39 am

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
ac_1
 
Posts: 201
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

Re: ROBUSTERRORS

Unread postby TomDoan » Sat Dec 19, 2020 1:57 pm

STWISE actually has the standard HAC standard error calculations; it's just not documented. BOXJENK does not.
TomDoan
 
Posts: 7240
Joined: Wed Nov 01, 2006 5:36 pm

Re: ROBUSTERRORS

Unread postby ac_1 » Sat Dec 19, 2020 2:51 pm

So STWISE computes Heteroskedasticity and autocorrelation-consistent (HAC) estimators by default, no option? Why does BOXJENK not?
ac_1
 
Posts: 201
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

Re: ROBUSTERRORS

Unread postby TomDoan » Sat Dec 19, 2020 4:06 pm

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.
TomDoan
 
Posts: 7240
Joined: Wed Nov 01, 2006 5:36 pm

Re: ROBUSTERRORS

Unread postby ac_1 » Sun Dec 20, 2020 3:50 am

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.
ac_1
 
Posts: 201
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

Re: ROBUSTERRORS

Unread postby TomDoan » Sun Dec 20, 2020 6:55 pm

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.
TomDoan
 
Posts: 7240
Joined: Wed Nov 01, 2006 5:36 pm

Re: ROBUSTERRORS

Unread postby ac_1 » Mon Dec 21, 2020 2:43 pm

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?
ac_1
 
Posts: 201
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

Re: ROBUSTERRORS

Unread postby TomDoan » Mon Dec 21, 2020 3:01 pm

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.
TomDoan
 
Posts: 7240
Joined: Wed Nov 01, 2006 5:36 pm

Re: ROBUSTERRORS

Unread postby ac_1 » Mon Dec 21, 2020 3:30 pm

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
*
ac_1
 
Posts: 201
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

Re: ROBUSTERRORS

Unread postby TomDoan » Mon Dec 21, 2020 3:38 pm

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.
TomDoan
 
Posts: 7240
Joined: Wed Nov 01, 2006 5:36 pm

Re: ROBUSTERRORS

Unread postby ac_1 » Thu Dec 24, 2020 3:11 am

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}

ac_1
 
Posts: 201
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

Re: ROBUSTERRORS

Unread postby TomDoan » Thu Dec 24, 2020 9:50 am

TomDoan
 
Posts: 7240
Joined: Wed Nov 01, 2006 5:36 pm

Re: ROBUSTERRORS

Unread postby ac_1 » Thu Dec 24, 2020 12:31 pm

Apologies:

Code: Select all
linreg(robusterrors) yc
# constant yc{1 to 6}


I will have a read...
ac_1
 
Posts: 201
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

Re: ROBUSTERRORS

Unread postby ac_1 » Sat Dec 26, 2020 6:02 am

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?
ac_1
 
Posts: 201
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

Re: ROBUSTERRORS

Unread postby TomDoan » Sat Dec 26, 2020 11:19 am

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.
TomDoan
 
Posts: 7240
Joined: Wed Nov 01, 2006 5:36 pm

Next

Return to General Econometrics

Who is online

Users browsing this forum: Google [Bot] and 1 guest