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

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

STWISE actually has the standard HAC standard error calculations; it's just not documented. BOXJENK does not.

- TomDoan
**Posts:**7251**Joined:**Wed Nov 01, 2006 5:36 pm

So STWISE computes Heteroskedasticity and autocorrelation-consistent (HAC) estimators by default, no option? Why does BOXJENK not?

- ac_1
**Posts:**206**Joined:**Thu Apr 15, 2010 6:30 am**Location:**London, UK

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.

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

- TomDoan
**Posts:**7251**Joined:**Wed Nov 01, 2006 5:36 pm

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

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.

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:**7251**Joined:**Wed Nov 01, 2006 5:36 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.

is there a reference for step-by-step ARIMA numerical calculation by-hand?

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

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.

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

- TomDoan
**Posts:**7251**Joined:**Wed Nov 01, 2006 5:36 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:**206**Joined:**Thu Apr 15, 2010 6:30 am**Location:**London, UK

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.

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:**7251**Joined:**Wed Nov 01, 2006 5:36 pm

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?

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

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

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:**7251**Joined:**Wed Nov 01, 2006 5:36 pm

17 posts
• Page **1** of **2** • **1**, 2

Return to General Econometrics

Users browsing this forum: No registered users and 3 guests