the errors appear when I insert the bolded part below.
"---------------------------K-year decompositions-----------------------------------";
b_lrk = zeros(Ku,1);
b_ldk = zeros(Ku,1);
b_ldpk = zeros(Ku,1);
identk = zeros(Ku,1);
t_lrk1 = zeros(Ku,1);
t_ldk1 = zeros(Ku,1);
t_ldpk1 = zeros(Ku,1);
t_lrk2 = zeros(Ku,1);
t_ldk2 = zeros(Ku,1);
t_ldpk2 = zeros(Ku,1);
b_lrkd = zeros(Ku,1);
b_ldkd = zeros(Ku,1);
b_ldpkd = zeros(Ku,1);
t_lrkd = zeros(Ku,1);
t_ldkd = zeros(Ku,1);
t_ldpkd = zeros(Ku,1);
identkd = zeros(Ku,1);
K=1;
do while K<=Ku; /* implied VAR(1) estimates */ b_lr = b_r*(1-(rho^K)*(phi^K))/(1-rho*phi); b_ld = b_d*(1-(rho^K)*(phi^K))/(1-rho*phi); b_ldp = (rho^K)*(phi^K); ident = b_lr-b_ld+b_ldp; aux1 = -K*b_r*(rho^K)*(phi^(K-1))*(1-rho*phi)+rho*b_r*(1-(rho^K)*(phi^K)); aux2 = -K*b_d*(rho^K)*(phi^(K-1))*(1-rho*phi)+rho*b_d*(1-(rho^K)*(phi^K)); aux3 = (1-rho*phi)^2; aux_br = aux1/aux3; aux_bd = aux2/aux3; jacob = ((1-(rho^K)*(phi^K))/(1-rho*phi))~0~aux_br|0~((1-(rho^K)*(phi^K))/(1-rho*phi))~aux_bd|0~0~K*(rho^K)*(phi^(K-1)); varcov = jacob*avcovb*jacob'; tstat1 = (b_lr|b_ld|b_ldp)./sqrt(diag(varcov)); tstat2 = ((b_lr-1)|(b_ld+1)|(b_ldp-1))./sqrt(diag(varcov)); b_lrk[K,1] = b_lr; b_ldk[K,1] = b_ld; b_ldpk[K,1] = b_ldp; identk[K,1] = ident; t_lrk1[K,1] = tstat1[1,1]; t_ldk1[K,1] = tstat1[2,1]; t_ldpk1[K,1] = tstat1[3,1]; t_lrk2[K,1] = tstat2[1,1]; t_ldk2[K,1] = tstat2[2,1]; t_ldpk2[K,1] = tstat2[3,1];
1 Answer
0
The problem is coming from this line:
auxd = (rho^(j-1))*shiftr(lhs[.,2]',-j,0)';
In your code, lhs does not exist. You will get the error: G0064 : Operand missing if you try to index into a variable that does not yet exist. For example:
print non_existant_var[.,1];
will give the error G0064 : Operand missing.
Your Answer
1 Answer
The problem is coming from this line:
auxd = (rho^(j-1))*shiftr(lhs[.,2]',-j,0)';
In your code, lhs does not exist. You will get the error: G0064 : Operand missing if you try to index into a variable that does not yet exist. For example:
print non_existant_var[.,1];
will give the error G0064 : Operand missing.