Page 1 of 1

Weak exogeneity and Impulse responses for an asymmetric ECM

Posted: Thu Apr 18, 2013 5:44 pm
by cu_student
Hi,
I am estimating an asymmetric ECM between domestic and farm-gate prices of a commodity.I am not using a vector model here. The preliminary tests of unit root and co-integration suggest that both series are I(1) and co-integrated. According to theory and market structure, domestic prices are exogenous. Price flows from domestic to farm-gate and not the other way around. Assuming domestic prices are weakly exogenous, I ran the ECM (not vector) by segmenting the variables into positive and negative in STATA and got the following result:
Δfgpt = –84.206 – 0.312 ECT+t-1 – 0.857 ECT–t-1 + 0.362 Δdom+t + 0.426 Δdom–t – 0.107 Δdom+t-1 – 0.026 Δdom–t-1 + 0.065 Δfgp+t-1 + 0.179 Δfgp–t-1 +128.984 D

where fgpt is the farm gate price and D is a seasonal dummy. Co-efficient of ECT- is greater than ECT+ which suggests that decreases in domestic prices are transmitted faster to farm gate than increases in the long-run. These results are consistent with theory and practice. I have two questions:

1) Weak exogenity: How do I run a weak-exogeneity test for each price series "fgp" and "dom". I used a likelihood ratio test in STATA which suggests that "dom" prices are endogenous, which is against theory. I want to double check this in RATS. I dont have CATS by the way.

2) Impulse response: My question is how does "fgp" respond to positive and negative shocks in "dom". According to my Asymmetric ECM results, I expect that impulse responses to be asymmetric, that is positive shocks would be more persistent than negative shocks. I did not know how to estimate impulse responses on a non-VAR environment, so I tried the following code, assuming a VAR model but its not doing the trick.

Here the variables domd1minus = negative changes in dom prices and domd1plus = positive changes in dom prices and dfgp = differences of farm gate price

Code: Select all

SYSTEM(MODEL=example1)
VAR DOMD1PLUS DOMD1MINUS DFGP
LAGS 1
DET Constant
END(SYSTEM)
ESTIMATE(OUTSIGMA=S,RESIDUALS=RESIDS)

NONLIN g31 g32
DEC FRML[RECT] G_FORM
FRML G_FORM = || 1. , 0. , 0. | 0. , 1. , 0. | g31, g32, 1. ||
COM g31=g32=0.0
CVMODEL(b=g_form, method=bfgs,pmethod=genetic, factor=G) %sigma

COMPUTE FLIPPER =||1.0,-1.0,1.0||
COMPUTE  F=S*%diag(FLIPPER)

declare rectangular[series] impulses(3,3)
IMPULSE(MODEL=example1, result=impulses, decomp=F) * 7 *
set r1 1 12 = impulses(3,1)/impulses(3,3)(1)
set r2 1 12 = impulses(3,2)/ impulses(3,3)(1)

com implabels = || 'Positive Shock','Negative Shock'||
GRAPH(HEADER='Response of Farm gate prices to a one-unit shock in Domestic prices ',KEY=upright,patterns, $
number=1, klabels=implabels,) 2
# r1 ; # r2
I must be making some mistake with both the weak exogeneity tests and impulse responses. And should i assume shocks are exogenous as "dom" is exogneous?

Any help and guidance would be greatly appreciated.
Thanks

Re: Weak exogeneity and Impulse responses for an asymmetric

Posted: Fri Apr 19, 2013 11:27 am
by TomDoan
cu_student wrote:Hi,
I am estimating an asymmetric ECM between domestic and farm-gate prices of a commodity.I am not using a vector model here. The preliminary tests of unit root and co-integration suggest that both series are I(1) and co-integrated. According to theory and market structure, domestic prices are exogenous. Price flows from domestic to farm-gate and not the other way around. Assuming domestic prices are weakly exogenous, I ran the ECM (not vector) by segmenting the variables into positive and negative in STATA and got the following result:
Δfgpt = –84.206 – 0.312 ECT+t-1 – 0.857 ECT–t-1 + 0.362 Δdom+t + 0.426 Δdom–t – 0.107 Δdom+t-1 – 0.026 Δdom–t-1 + 0.065 Δfgp+t-1 + 0.179 Δfgp–t-1 +128.984 D

where fgpt is the farm gate price and D is a seasonal dummy. Co-efficient of ECT- is greater than ECT+ which suggests that decreases in domestic prices are transmitted faster to farm gate than increases in the long-run. These results are consistent with theory and practice. I have two questions:

1) Weak exogenity: How do I run a weak-exogeneity test for each price series "fgp" and "dom". I used a likelihood ratio test in STATA which suggests that "dom" prices are endogenous, which is against theory. I want to double check this in RATS. I dont have CATS by the way.
With the + and - versions of the variables?
cu_student wrote: 2) Impulse response: My question is how does "fgp" respond to positive and negative shocks in "dom". According to my Asymmetric ECM results, I expect that impulse responses to be asymmetric, that is positive shocks would be more persistent than negative shocks. I did not know how to estimate impulse responses on a non-VAR environment, so I tried the following code, assuming a VAR model but its not doing the trick.

Here the variables domd1minus = negative changes in dom prices and domd1plus = positive changes in dom prices and dfgp = differences of farm gate price

Code: Select all

SYSTEM(MODEL=example1)
VAR DOMD1PLUS DOMD1MINUS DFGP
LAGS 1
DET Constant
END(SYSTEM)
ESTIMATE(OUTSIGMA=S,RESIDUALS=RESIDS)

NONLIN g31 g32
DEC FRML[RECT] G_FORM
FRML G_FORM = || 1. , 0. , 0. | 0. , 1. , 0. | g31, g32, 1. ||
COM g31=g32=0.0
CVMODEL(b=g_form, method=bfgs,pmethod=genetic, factor=G) %sigma

COMPUTE FLIPPER =||1.0,-1.0,1.0||
COMPUTE  F=S*%diag(FLIPPER)

declare rectangular[series] impulses(3,3)
IMPULSE(MODEL=example1, result=impulses, decomp=F) * 7 *
set r1 1 12 = impulses(3,1)/impulses(3,3)(1)
set r2 1 12 = impulses(3,2)/ impulses(3,3)(1)

com implabels = || 'Positive Shock','Negative Shock'||
GRAPH(HEADER='Response of Farm gate prices to a one-unit shock in Domestic prices ',KEY=upright,patterns, $
number=1, klabels=implabels,) 2
# r1 ; # r2
I must be making some mistake with both the weak exogeneity tests and impulse responses. And should i assume shocks are exogenous as "dom" is exogneous?

Any help and guidance would be greatly appreciated.
Thanks
There is no simple way to compute impulse responses in a non-linear model like this. In a linear model, the responses are linear in the size and independent of the initial conditions, while in (effectively any) non-linear model neither of those is true, so you have to somehow average across "typical" values. There's a discussion about that in http://www.estima.com/forum/viewtopic.php?f=30&t=1809.

Re: Weak exogeneity and Impulse responses for an asymmetric

Posted: Fri Apr 19, 2013 4:21 pm
by cu_student
Thanks Tom for the reply.

How do I test for weak exogeniety without the + and - segmentation. A weak exogeneity test thats only for "fgp" and "dom" series of the form

Δfgpt = ∝0 + ∝1 ECT t-1 + ∝2 Δdomt + ∝3 Δdomt-1 + ∝4 Δfgpt-1
Δdomt = β0 + β1 ECT t-1 + β2 Δfgpt + β3 Δfgpt-1 + β4 Δdomt-1

I will read-up on the impulse response and get back to you.
Thanks again.

Re: Weak exogeneity and Impulse responses for an asymmetric

Posted: Fri Apr 19, 2013 5:23 pm
by TomDoan
cu_student wrote:Thanks Tom for the reply.

How do I test for weak exogeniety without the + and - segmentation. A weak exogeneity test thats only for "fgp" and "dom" series of the form

Δfgpt = ∝0 + ∝1 ECT t-1 + ∝2 Δdomt + ∝3 Δdomt-1 + ∝4 Δfgpt-1
Δdomt = β0 + β1 ECT t-1 + β2 Δfgpt + β3 Δfgpt-1 + β4 Δdomt-1

I will read-up on the impulse response and get back to you.
Thanks again.
What do you mean by "weak exogeneity"? For what parameters? In the context of a VECM, that usually means weakly exogenous for estimation of the cointegrating relation, but that doesn't look like what you're trying to test.

Re: Weak exogeneity and Impulse responses for an asymmetric

Posted: Fri Apr 19, 2013 6:22 pm
by cu_student
Thats right. This is not in the context of VECM.

According to Enders, Applied Econometric Time series 3ed, pg. 407, if a variable does not respond to the discrepancy from the long-run equilibrium relationship, it is weakly exogenous. In other words, if the speed of adjustment parameter (co-efficient of ECT) is zero, the variable is weakly exogenous. Thats the definition.

In my case, I have 2 price series: farm gate (fgp) and domestic (dom). I estimated a single equation ECM, by assuming that domestic prices are weakly exogenous, in other words, domestic prices do not respond to any discrepancy from the long-run relationship. I have already shown the results in my first message. Now, I want to statistically test this assumption. If domestic prices are not weakly exogenous, then it means there is some feedback from farm gate prices to domestic prices, which in theory is not possible in my study.

Thanks Tom for all the help. I could forward my data for you if you want. This is an important test for my study. I hope there is a procedure in RATS to test this.

Re: Weak exogeneity and Impulse responses for an asymmetric

Posted: Fri Apr 19, 2013 7:25 pm
by TomDoan
cu_student wrote:Thats right. This is not in the context of VECM.

According to Enders, Applied Econometric Time series 3ed, pg. 407, if a variable does not respond to the discrepancy from the long-run equilibrium relationship, it is weakly exogenous. In other words, if the speed of adjustment parameter (co-efficient of ECT) is zero, the variable is weakly exogenous. Thats the definition.
Actually, that's not the "definition" of weakly exogenous. A full statement about weak exogeneity always includes the set of parameters for which inference can be made conditional on the exogenous variable. What you are describing is, in fact, weak exogeneity for the parameters in the cointegrating vector---it means that the convergence to the long-run equilibrium is done entirely through the other variable.
cu_student wrote:In my case, I have 2 price series: farm gate (fgp) and domestic (dom). I estimated a single equation ECM, by assuming that domestic prices are weakly exogenous, in other words, domestic prices do not respond to any discrepancy from the long-run relationship. I have already shown the results in my first message. Now, I want to statistically test this assumption. If domestic prices are not weakly exogenous, then it means there is some feedback from farm gate prices to domestic prices, which in theory is not possible in my study.
In your model, there could be feedback from farm gate prices to domestic prices even if there domestic prices are weakly exogenous as defined above since they could enter into the short-term model (the lagged differences). If you want to test lack of feedback, you would need to run the regression of change in dom on the lagged ECT, lagged changes of dom and fgdp and do a joint test on the ECT and the lagged changes. Don't include current fgdp in that. This is basically a Granger causality test.

Re: Weak exogeneity and Impulse responses for an asymmetric

Posted: Tue Apr 23, 2013 10:48 pm
by cu_student
Thanks for your reply Tom. This is really helping me.

In regards to weak exogeneity, I ran these feedback tests/Granger causality tests as you suggested:

Δfgpt = ∝0 + ∝1 ECT t-1 + ∝2 Δdomt-1 + ∝3 Δfgpt-1 and did a joint test: ∝1= ∝2 =0 and the p-value was 0.036. and ∝1 was significant (p-value=0.01)
Δdomt = β0 + β1 ECT t-1 + β2 Δfgpt-1 + β3 Δdomt-1 and did a joint test: β1 = β2 = 0 and the p-value was 0.1275 and β1 was insignificant (p-value=0.87)

This mean that there is no feedback from farm gate prices to domestic prices. Does this also mean that the convergence to the long-run equilibrium is done entirely by farm-gate prices?

In regards to impulse response, I am still unclear about how I could estimate non-linear IRFs in my case. Most of the posts in the forum are vector based models.
However, I tried to run this code..

Code: Select all

LINREG FGP / RESID
# Constant dom

DIFF DOM / DDOM
DIFF FGP / DFGP

set DOMD1PLUS = DDOM>= 0.0
set DOMDIMINUS = DDOM<0.0

SYSTEM(MODEL=example1)
VAR DOMD1PLUS DOMD1MINUS DFGP
LAGS 1
DET Constant RESID{1}
END(SYSTEM)
ESTIMATE(OUTSIGMA=S,RESIDUALS=RESIDS)

* GIRF starting in 2006:10 for a one s.d. shock to Dom correlated with FG
* using the estimated covariance matrix. (2006:10 has values for both
* rates which are close to the average for the full period).
*
compute ndraws=5000
compute baseentry=2006:10
compute nsteps   =10
*
dec vect[series] fshocks(3) girf(5)
dec series[vect] bishocks
dec vect ishocks
*
smpl baseentry baseentry+(nsteps-1)
do i=1,5
   set girf(i) = 0.0
end do i
*
compute fsigma=%psdfactor(S,||1,2,3||)
*
do draw=1,ndraws
   gset bishocks = %ranmvnormal(fsigma)
   set fshocks(1) = bishocks(t)(1)
   set fshocks(2) = bishocks(t)(2)
   forecast(paths,model=example1,results=basesims)
   # fshocks
   compute ishock=fsigma(3,3)
   compute ishocks=inv(fsigma)*bishocks(baseentry)
   compute ishocks(2)=ishock/fsigma(2,2)
   compute bishocks(baseentry)=fsigma*ishocks
   compute fshocks(1)(baseentry)=bishocks(baseentry)(1)
   compute fshocks(2)(baseentry)=bishocks(baseentry)(2)
   forecast(paths,model=example1,results=sims)
   # fshocks
   do i=1,5
      set girf(i) = girf(i)+(sims(i)-basesims(i))
   end do i
end do draw
*
do i=1,5
   set girf(i) = girf(i)/ndraws
end do i

com implabels = ||'Positive Shock','Negative Shock'||
GRAPH(HEADER='Response of Farm gate prices to shocks in domestic prices',KEY=upright,patterns, $
number=1, klabels=implabels) 2
# girf(3) ; # girf(2)
The code runs well. But there must be plenty of mistakes in there. Any guidance would be helpful.

Re: Weak exogeneity and Impulse responses for an asymmetric

Posted: Wed Apr 24, 2013 11:01 am
by TomDoan
cu_student wrote:Thanks for your reply Tom. This is really helping me.

In regards to weak exogeneity, I ran these feedback tests/Granger causality tests as you suggested:

Δfgpt = ∝0 + ∝1 ECT t-1 + ∝2 Δdomt-1 + ∝3 Δfgpt-1 and did a joint test: ∝1= ∝2 =0 and the p-value was 0.036. and ∝1 was significant (p-value=0.01)
Δdomt = β0 + β1 ECT t-1 + β2 Δfgpt-1 + β3 Δdomt-1 and did a joint test: β1 = β2 = 0 and the p-value was 0.1275 and β1 was insignificant (p-value=0.87)

This mean that there is no feedback from farm gate prices to domestic prices. Does this also mean that the convergence to the long-run equilibrium is done entirely by farm-gate prices?
That's correct.
cu_student wrote: In regards to impulse response, I am still unclear about how I could estimate non-linear IRFs in my case. Most of the posts in the forum are vector based models.
However, I tried to run this code..
...

The code runs well. But there must be plenty of mistakes in there. Any guidance would be helpful.
You can't split the dependent variable up into positive and negative parts like that---the left side has to be the actual variables, while the right side has the + and - versions.

Re: Weak exogeneity and Impulse responses for an asymmetric

Posted: Wed Apr 24, 2013 12:10 pm
by cu_student
Thanks so much for your help with the weak exogeneity test.

I ran this model with the segmented variables on the right hand side.

Code: Select all

SYSTEM(MODEL=example1)
VAR DFGP
LAGS 1
DET Constant DOMD1PLUS DOMD1MINUS dummy ECTPLUS ECTMINUS
END(SYSTEM)
ESTIMATE(OUTSIGMA=S)
This is the asymmetric ECM that I had estimated before (Results in the first post) . %sigma is 1X1. Now, should i proceed with the GIRF code with fsigma being a 1X1 matrix? or do I need to create a placeholder equation, as the shocks are on the exogenous variables DOMD1PLUS and DOMD1MINUS. Thanks again for all the help. I am new to RATS and any help would be greatly appreciated.

Re: Weak exogeneity and Impulse responses for an asymmetric

Posted: Wed Apr 24, 2013 1:11 pm
by TomDoan
You still need a multiple equation system in order to simulate the responses---the effect of a shock to the domestic price isn't a one-and-done since the domestic price process has its own dynamics.

Re: Weak exogeneity and Impulse responses for an asymmetric

Posted: Wed Apr 24, 2013 2:12 pm
by cu_student
Ok. I understand. I estimated a SUR, with 2 equations. One with farm-gate prices and the other with domestic prices.

Code: Select all

linreg(define=eq1) DFGP
# constant ECTPLUS ECTMINUS  DOMD1PLUS DOMD1MINUS DFGP{1} dummy 
linreg(define=eq2) DDOM
# constant DDOM{1 TO 2}
sur(outsigma=v) 2
# eq1 ; # eq2
*
group asymecm eq1 eq2

In eq2, I have included only the lags of Δdom using AIC, as I have already tested for feedback, I have not added Δfgp or the ECTs.

Now, could responses be simulated on this system?

Re: Weak exogeneity and Impulse responses for an asymmetric

Posted: Thu Apr 25, 2013 9:31 am
by TomDoan
cu_student wrote:Ok. I understand. I estimated a SUR, with 2 equations. One with farm-gate prices and the other with domestic prices.

Code: Select all

linreg(define=eq1) DFGP
# constant ECTPLUS ECTMINUS  DOMD1PLUS DOMD1MINUS DFGP{1} dummy 
linreg(define=eq2) DDOM
# constant DDOM{1 TO 2}
sur(outsigma=v) 2
# eq1 ; # eq2
*
group asymecm eq1 eq2

In eq2, I have included only the lags of Δdom using AIC, as I have already tested for feedback, I have not added Δfgp or the ECTs.

Now, could responses be simulated on this system?
Why do you now have current ECT and DOMD1 variables on the first equation? I would recommend writing this using the standard dynamics---first difference on the right side, only lags of ECT and first differences on the right. In order to simulate it, you need add definitional identities for the derived variables (ECTPLUS, ECTMINUS, DOMD1PLUS and DOMD1MINUS) as is done in the Balke-Fomby example that was linked earlier.