markusfritsch / pdynmc

Dynamic linear panel estimation based on linear and nonlinear moment conditions
4 stars 3 forks source link

max number of lags for dependent variable #6

Closed dazhwu closed 2 years ago

dazhwu commented 2 years ago

Hi,

I am reading your code. In the code included at the end, the middle part is from your function named variable.fct. The output of the code is:

print(ti.temp) [1] 1 1 1 1 print(tend.temp) [1] 5 6 7 8

Maybe my understanding is wrong. But y_1 doesn't seem to satisfy the restriction that the maximum number of lags is 6.

-----------------#code

Time=10 lagTerms=5 T.mcDiff=6

code from variable.fct

ti.temp <- rep(1, times = Time - lagTerms - 1) + if (Time - lagTerms - 1 - T.mcDiff > 0){ c(rep(0, times = T.mcDiff - lagTerms), 1:(Time - T.mcDiff - 1)) } else { rep(0, times = Time - lagTerms - 1) }

tend.temp <- lagTerms:(Time - 2)

########################################### print(ti.temp) print(tend.temp)

markusfritsch commented 2 years ago

Dear dazhwu,

I am not entirely sure, if I understand your issue correctly. The required number of time periods in the internal functions should be ok. At some points the labelling could probably be improved. If this was not the main intent behind your question, it would be helpful, if you could provide more details or a short example.

Best regards Markus