Parameter combinations and hypothesis testing after TVAR and TVECM models in tsdyn

61 views
Skip to first unread message

Francis Tsiboe

unread,
Apr 13, 2018, 10:35:11 PM4/13/18
to tsdyn

Hello all,
I am currently estimating TVECM and TVAR models for food markets in Ghana.
After estimating the models i an interested in combing parameters withing and across thresholds for the same market pairs.
I would also want the standard errors of the parameter combinations.
Would anyone have any idea on how I could possibly accomplish this?
Thank you very much,

Francis

Matthieu S

unread,
Apr 13, 2018, 10:50:18 PM4/13/18
to ts...@googlegroups.com, shapb...@gmail.com
Hi Francis

It is not very clear to me what you mean by "combining parameters"? What do you want to do exactly?

Why don't you provide us with a minimal self-reproducible example (see google for best approach) and we help yo ubluiding on that?

Matthieu


--
You received this message because you are subscribed to the Google Groups "tsdyn" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tsdyn+unsubscribe@googlegroups.com.
To post to this group, send email to ts...@googlegroups.com.
Visit this group at https://groups.google.com/group/tsdyn.
For more options, visit https://groups.google.com/d/optout.

Francis Tsiboe

unread,
Apr 13, 2018, 11:58:15 PM4/13/18
to tsdyn
Hello Matthieu

Thanks in advance for your help, and the prompt feedback.
thanks for the hard work you put in developing tsdyn; I love the package.

My issue is demonstrated in the example below;

data(zeroyld)
data<-zeroyld

tv<-TVECM(data, nthresh=2,lag=1, ngridBeta=20, ngridTh=30, plot=TRUE,trim=0.05, common="All")

#Using the above TVECM as an example i calculated the point estimates for;

ECT1<-tv$coefficients$Bdown[2,"ECT"]-tv$coefficients$Bdown[1,"ECT"]  # this gives me the total adjustment in the lower regiem

Adj1<-log(1-0.9)/log(1-ECT1)                                         # this gives me the average period of adjustment within 90% of the longrun relationship in the lower regiem

#However i am stuck on how to get a standard error for 

Thanks 




On Friday, April 13, 2018 at 9:50:18 PM UTC-5, Matthieu Stigler wrote:
Hi Francis

It is not very clear to me what you mean by "combining parameters"? What do you want to do exactly?

Why don't you provide us with a minimal self-reproducible example (see google for best approach) and we help yo ubluiding on that?

Matthieu

2018-04-13 19:10 GMT-07:00 Francis Tsiboe <shapb...@gmail.com>:

Hello all,
I am currently estimating TVECM and TVAR models for food markets in Ghana.
After estimating the models i an interested in combing parameters withing and across thresholds for the same market pairs.
I would also want the standard errors of the parameter combinations.
Would anyone have any idea on how I could possibly accomplish this?
Thank you very much,

Francis

--
You received this message because you are subscribed to the Google Groups "tsdyn" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tsdyn+un...@googlegroups.com.

Matthieu S

unread,
Apr 14, 2018, 12:01:27 AM4/14/18
to ts...@googlegroups.com, shapb...@gmail.com
Hi

I see, so you want to make inference on linear and non-linear combinations of the parameters! I can think of two ways to do this:
-You could use the delta method for this. For the linear case, there are some functions available in R, maybe linearHypothesis from package car?
-You could use the bootstrap. There are function TVAR.boot() and TVECM.boot() that should make this relatively easy.

Best,
Matthieu


To unsubscribe from this group and stop receiving emails from it, send an email to tsdyn+unsubscribe@googlegroups.com.

Francis Tsiboe

unread,
Apr 14, 2018, 1:52:13 AM4/14/18
to tsdyn
Yes Matthieu you right;  i want to make inference on linear and non-linear combinations of the parameters.
Can you please check my updated code from my previous post to see if am on the right track.

rm(list=ls(all=TRUE))
library("tsDyn")
data(zeroyld)
data<-zeroyld

tv<-TVECM(data, nthresh=2,lag=1, ngridBeta=20, ngridTh=30, plot=TRUE,trim=0.05, common="All")

#Using the above TVECM as an example i calculated the point estimates for;

ECT1<-tv$coefficients$Bdown[2,"ECT"]-tv$coefficients$Bdown[1,"ECT"]  # this gives me the total adjustment in the lower regiem

Adj1<-log(1-0.9)/log(1-ECT1)                                         # this gives me the average period of adjustment within 90% of the longrun relationship in the lower regiem


#Bootstrap for the TVECM above to get the SD for ECT1 and Adj1

output.sim<-data.frame(Sim.ECT1=NA,Sim.Adj1=NA)

for(i in 1:5){
  Sim.dat<-TVECM.boot(TVECMobject=tv, show.parMat = FALSE, check = TRUE)
  
  Sim.tv<-TVECM(Sim.dat, nthresh=2,lag=1, ngridBeta=20, ngridTh=30, plot=TRUE,trim=0.05, common="All")
  
  Sim.ECT1<-Sim.tv$coefficients$Bdown[2,"ECT"]-Sim.tv$coefficients$Bdown[1,"ECT"]
  
  Sim.Adj1<-log(1-0.9)/log(1-(Sim.tv$coefficients$Bdown[2,"ECT"]-Sim.tv$coefficients$Bdown[1,"ECT"]))
  
  output.sim<-rbind(output.sim,data.frame(Sim.ECT1=Sim.ECT1,Sim.Adj1=Sim.Adj1))
}

sd(output.sim$Sim.ECT1,na.rm = T)   ## Standard deviation for ECT1
sd(output.sim$Sim.Adj1,na.rm = T)     ## Standard deviation for Adj1

Would you recommend i use the model degrees of freedom (DOF)  or regime specific DOF to get the SE's

Best

Matthieu S

unread,
Apr 14, 2018, 1:54:29 AM4/14/18
to ts...@googlegroups.com, Francis Tsiboe
that sounds good, note that:

- don't use check=TRUE, would return the original series
-y'll use a much higher number of bootstrap replications, right?
- you should look at the different types of bootstrappping procedure, using the bootstrap sd is not necesarily the bets one

Matthieu


To unsubscribe from this group and stop receiving emails from it, send an email to tsdyn+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages