Hi everyone,
I have a pretty straight-forward question regarding weighted least squares: I would like to do feasible GLS where heteroskedasticity is modelled as follows:
Var(u|x)=sigma^2*exp(delta0+delta1x1+delta2x2+...+deltakxk)
where x1, x2, ... , xk denote the independent variables in the model. I noticed that there is no option for feasible GLS in the stimation dialogue. Thus, I estimated the weighting function h first and then used it in the weighted regression. I'm just wondering if there is a shortcut for feasible GLS using the common model for heteroskedasticity above (I like to avoid running dummy regressions). Thanks for your reply
feasible GLS
Moderators: EViews Gareth, EViews Moderator
-
fboehlandt
- Posts: 83
- Joined: Thu Apr 15, 2010 3:54 am
Re: feasible GLS
This is not in direct response to the above question but it does refer to feasable GLS Estimation with AR(1) Errors. I have come across posts enquiring about Cochrane-Orcutt (CO) or Prais-Winston (PW) estimation. The following code should do the trick. Here the underlying assumpions:
1. serial correlation with strictly exogenous errors
2. no lagged dependent variables
The timeseries should be renamed as follows if you do not want to make changes to the code:
1. all independent variables should be grouped in 'xs' (without an intercept dummy)
2. the dependent variable should be renamed 'y'
And here the code for PW:
e3 contains the final results and coefficient estimates. The autocorrelation coefficient p can be found as slope coefficient in e2. If you prefer to use CO you may delete/edit the lines marked '<-- CO. Note that this will result in one less observation in estimation. Lastly, consider that both PW and CO do not account for heteroscedasticity and consider AR(1) errors only. Thus, I recommend consulting the forum for more up-to-date treatments in time series regression. However, PW and CO are still very popular.
1. serial correlation with strictly exogenous errors
2. no lagged dependent variables
The timeseries should be renamed as follows if you do not want to make changes to the code:
1. all independent variables should be grouped in 'xs' (without an intercept dummy)
2. the dependent variable should be renamed 'y'
And here the code for PW:
Code: Select all
group xsp
'Run OLS y c xs
equation e1.ls y c xs
e1.makeresid resid_ols
'Run OLS residuals c residuals(-1)
equation e2.ls resid_ols c resid_ols(-1)
!p = e2.@coefs(2)
'removing serial correlation form y and xs
%c = "x0"
smpl @all
series {%c} = 1
xs.add {%c}
for !i = 1 to xs.@count
%xname = xs.@seriesname(!i)
%newx = "p" + %xname
%yp = "yp"
series {%newx} = {%xname}
series {%yp} = y
smpl @first @first '<-- CO
{%newx} = {%xname}*(1 - !p^2)^(1/2) '<-- CO
{%yp} =y*(1 - !p^2)^(1/2) '<-- CO
smpl @first+1 @last
{%newx} = {%xname} - !p*{%newx}(-1) '<--CO replace: '{%newx} = {%xname} - !p*{%xname}(-1)
{%yp} = y - !p*{%yp}(-1) "<--CO replace: {%yp} = y - !p*y(-1)
xsp.add {%newx}
next
'Run OLS yp xsp (intercept in xsp)
equation e3.ls yp xsp
xs.drop {%c}
smpl @all-
fboehlandt
- Posts: 83
- Joined: Thu Apr 15, 2010 3:54 am
Re: feasible GLS
In particular, Newey-West HAC consistent estimators using the Bartlett kernel are commonly used (and easily done in Eviews). Note that HAC estimators yield the same coefficient estimates as OLS but higher/lower standard errors
Who is online
Users browsing this forum: No registered users and 2 guests
