operand missing

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];

/* direct estimates from long-horizon regressions */
   sumre = zeros(rows(lhs),1);
      j = 1;
      do while j<=K;
         auxr = (rho^(j-1))*shiftr(lhs[.,1]',-j,0)';
         sumre = sumre+auxr;
      j = j+1;
      endo;
   sumre = trimr(sumre,0,K);
  
   sumd = zeros(rows(lhs),1);
      j = 1;
      do while j<=K;
         auxd = (rho^(j-1))*shiftr(lhs[.,2]',-j,0)';
         sumd = sumd+auxd;
      j = j+1;
      endo;
   sumd = trimr(sumd,0,K);
   dpk = lagn(dp,-K);
   dpk = (rho^K)*trimr(dpk,0,K);
   dp1 = trimr(dp,0,K); 
  {t,b,ehat,seb_w,seb_nw,tstatb_w,tstatb_nw,pvalues_w,pvalues_nw,r2,ar2} = olsgmmpm(sumre,dp1,K+1,1);
   b_lrkd[K,1] = b[2,1];
   t_lrkd[K,1] = tstatb_nw[2,1];
   {t,b,ehat,seb_w,seb_nw,tstatb_w,tstatb_nw,pvalues_w,pvalues_nw,r2,ar2} = olsgmmpm(sumd,dp1,K+1,1);
   b_ldkd[K,1] = b[2,1];
   t_ldkd[K,1] = tstatb_nw[2,1];
   {t,b,ehat,seb_w,seb_nw,tstatb_w,tstatb_nw,pvalues_w,pvalues_nw,r2,ar2} = olsgmmpm(dpk,dp1,K+1,1);
   b_ldpkd[K,1] = b[2,1];
   t_ldpkd[K,1] = tstatb_nw[2,1];
  identkd[K,1] = b_lrkd[K,1]-b_ldkd[K,1]+b_ldpkd[K,1];
K=K+1;
endo;
auxk = seqa(1,1,Ku);
"long-run coefficients"; auxk~b_lrk~b_ldk~b_ldpk;
"identity sum"; auxk~identk;
"t-stats for long-run coefficients. Null hypthesis: b_l=0"; auxk~t_lrk1~t_ldk1~t_ldpk1;
"t-stats for long-run coefficients. Null hypthesis: b_l=1,-1"; auxk~t_lrk2~t_ldk2~t_ldpk2;
"direct long-run coefficients"; auxk~b_lrkd~b_ldkd~b_ldpkd;
"identity sum"; auxk~identkd;

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.

aptech

1,773

Your Answer

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.


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy