G0025 Error, Procedure in Code

I seem to have an issue that wasn't occurring before. I have a procedure in the same file (on the bottom). I call the procedure  via:

{est_bmat} = filter(tru_sig2e,tru_sig2v);

the code for the procedure itself is:

proc filter(sig2e,sig2v);
local beta_mat, H_t,Q,R,F,itr,beta_ll,p_ll,ii,p_tl,eta_tl,
f_tl, Kt, beta_tt,P_tt,beta_tl;

Q = sig2e^2;
R = sig2v^2;
F = eye(1);

beta_ll = 0;
p_ll = 100* eye(1);

BETA_MAT = zeros(t,1);
do until itr>t;
beta_tl = F*beta_ll;
P_tl = F*P_ll*F' + Q;
H_t = xmat[itr,1];

eta_tl = ymat[itr,1] - (H_t*beta_tl);
f_tl = H_t*P_tl*H_t' + R;

beta_tt = beta_tl + (P_tl*H_t'*inv(f_tl))*eta_tl;
P_tt = P_tl - P_tl *H_t'*inv(f_tl)*H_t*P_tl;

BETA_MAT[itr,1] = beta_tt;

beta_ll = beta_tt;
P_ll = P_tt;

itr = itr + 1;


It returns a G0025 : Undefined symbol: 'filter'

However, it did not always return this error and now other similarly constructed files/procedures are not working properly.


5 Answers


The first thing I would check is the "Advanced Settings" which can be found from the main GAUSS menu Tools->Preferences->Advanced (or gauss->Preferences->Advanced on Mac). Make sure that both 'Autoload' and 'Autodelete' are on. If they are unchecked, GAUSS will not look forward in the file for references and you would have to place any calls to a procedure after you define the procedure. If those options are on, you should be able to place the procedure call and definition anywhere in the file and it will find it.


Thanks for the quick reply. Yes those are both checked on. But it is still not calling the procedure correctly. It also does not help if I move the procedure to the top of the file.


Try running just that procedure to make sure it will compile. You can do this by highlighting the entire procedure, then right-click and select "run selected text". If this brings up any errors, we can deal with those. If not, at the GAUSS command prompt enter the function name, filter, without any arguments and see if you still get an 'undefined symbols' error, if it just says that you did not pass it enough arguments.


Thanks for the suggestion. Typing the name of the procedure into the command box returns the same "undefined symbol" error.

Following your suggestion, my procedure does not compile correctly.

I believe the problem is below. I'm passing in a vector of inputs to the procedure via "prmtr." Each of these get defined into a local scalar. I want to define matrices out of these scalars like what I have below but this is where the "syntax error" is. Below, Q, M0, M1, and M2 are matrices of these scalar inputs. Are they defined incorrectly? Any input would be greatly appreciated!


proc filter(prmtr);

Q={sig2d siggu 0, siggu sig2g sigdu, 0 sigdu sig2u};

M0={gm0, ((1-d1)*A) };
M1={0, (d1) };
M2={1 1 0 0, (B2*(gm1-d1)) 0 (B2 -B1) };


Since GAUSS allows you set some matrix elements as character data, you cannot use a variable inside of an assignment like this:

Q = { sigd, 2, 3, };

Instead use the either the vertical concatenation operator (|) or the horizontal concatenation operator (~). For example:

a = 1;
c = 3;
x = a | 2 | c;

will assign x to be a column vector:

x = 2

or to create a row vector:

a = 1;
c = 3;
x = a ~ 2 ~ c;

The above code will assign x to be equal to:

1 2 3

You can use expressions between the concatenation operators which it looks like you will want to do

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