error in gauss

I got this error when i run my modified  program (seo and shin program). I dont have a nested procedure in this line and i dont know how to fix it? 

the error is: 

Line 256 in C:\Users\fayrouz\Desktop\prog modifié Fairouz.prg
Nested procedure definition G0155
Line 256 in C:\Users\fayrouz\Desktop\prog modifié Fairouz.prg
Syntax error G0008 : 'proc weight(n,t,de,w,t0)'
Closing: C:\Users\fayrouz\Desktop\prog modifié Fairouz.prg

the program(invest003 is downloaded from  https://sites.google.com/site/myunghseo/programs

 

the line 256 in the program is: 

proc weight(n,t,de,w,t0); // with given residuals
local v,vbar,i,dei,wi,iv;

v = 0; // scalar
vbar = 0;

for i (1,n,1);
dei = de[(i-1)*(t-t0+1)+1:i*(t-t0+1),.]; // (t-2)x1
wi = w[(i-1)*(t-t0+1)+1:i*(t-t0+1),.]'dei; // m x 1
v = v + wi*wi'; // mxm
vbar = vbar + wi; // mx1

endfor;
if rank(v/n-(vbar/n)*(vbar/n)') == cols(w);
iv = inv(v/n-(vbar/n)*(vbar/n)'); // mxm
else; "error 2";
iv = invswp(v/n-(vbar/n)*(vbar/n)');
endif;

retp(iv); endp;

proc weight1(n,t,w,t0); //analytic
local m,v,i,j,wi,wj,iv;

m = cols(w); // number of moments
v = zeros(m+2,m+2);

for i (1,n,1);
wi = zeros(t-t0+3,m+2);
wi[2:t-t0+2,2:m+1] = w[(i-1)*(t-t0+1)+1:i*(t-t0+1),.];

for j (1,t-t0+2,1);
wj = wi[j,.]'-wi[j+1,.]';
v = v + wj*wj'; // mxm
endfor;
endfor;

v = v[2:(m+1),2:(m+1)];
if rank(v/n) == cols(w);
iv = inv(v/n); // mxm
else; "error";
iv = invswp(v/n);
endif;

retp(iv); endp;

4 Answers



0



I have downloaded the invest03 program and can run it without getting the error that you are reporting.

  1. There is no error in the section of code that you have posted. You should be able to run it.
  2. Based upon the fact that your error output references the file prog modifié Fairouz.prg, it appears that you have modified the initial program and the error is in your modifications. We need to see the code that you modified to help you find the problem.

aptech

1,338


0



Can you give me a contact mail to send you the modified program?



0



Please e-mail support@aptech.com

aptech

1,338


0



Mail is already sent.

Your Answer


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 30 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy