MatthieuStigler / tsDyn

tsDyn
tsdyn.googlecode.com
34 stars 20 forks source link

Wrong number of lags for startVal in VECM.sim #4

Closed bixiou closed 5 years ago

bixiou commented 6 years ago

Function VECM.sim requires a matrix of starting values of dimension nBp instead of nB(p+1), where p is the number of lags. In lines 227-230 of TVECM.sim.R, 'p' should be replaced by 'p+1'. Also, there is a confusion between rows and columns. Here are the corrected lines.

    if(all(dim(as.matrix(starting))==c(p+1,nB)))
      y[seq_len(p+1),]<-starting
    else
    stop("Bad specification of starting values. Should have nrow = lag+1 and ncol = number of variables")
MatthieuStigler commented 5 years ago

I see, I made a few changes anyway, could you please create a reproducible example? Thanks!

bixiou commented 5 years ago

Sorry it's been a while I totally forgot this issue and where I encountered it.

MatthieuStigler commented 5 years ago

no problem, my fault for not getting back earlier. Anyway, there;s anew version coming soon with another code. I'll close and if you encounter the problem again, please let me know!