help with horzcat error
Show older comments
Hello,
nobs = length(hpc);
x = log(gdp);
n = log(hpc);
c = log(cy);
x = x-x(1);
n = n-n(1);
dx = x(2:nobs)-x(1:nobs-1);
dn = n(2:nobs)-alpha*n(1:nobs-1);
x = [dn,dx,c]; %the ordering of the variables
I declared my variables like above. gdp and hpc are nonstationary. They enter into the VAR as first difference but CY(consumption to output ratio) is stationary in level so I do not need to take the first difference of that. The problem is that when I run it, I got the error in below.
Which dataset? ("help ir" shows 12 options)
Error using horzcat
Dimensions of matrices being concatenated are not consistent.
Error in ir (line 267)
x = [dn,dx,c]; %the ordering of the variables
However, If I take the first difference of the CY as well, it runs perfectly. I mean x = [dn,dx,dc]; %the ordering of the variables. So is anyone can help me to solve my issue?
Lastly, the size of my data:
sx =
44 1
sn =
44 1
sc =
44 1
Best, Aysegul
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!