G0159 : Wrong number of parameters


I'm trying to use the maxlik function to maximize a likelihood procedure that I have written for a simple time-varying parameter model. It's returning me the wrong number of parameters error. I'm able to use the optmum procedure just fine. I know my model is identified. Does the input data matrix need to be of specific format?

x0 = 0.8|0.4;

{x,f,g,c,ret} = maxlik(ymat,0,&ln_lik,x0);
{xout,fout,gout,cout} = optmum(&ln_lik,x0);


Currently active call:

File maxutil.src, line 2912, in lik_fcn
a0 = ll(x,z);

File maxutil.src, line 2912, in _max_rdd
a0 = ll(x,z);
File maxutil.src, line 423, in _max
vof = _max_rdd(lfct,0,x0,0,0,0,LLoutput,Lmaxlag,dataset,vindx,row,
File maxlik.src, line 547, in maxlik
{ x,f,g,h,retcode,Lmlfhess,Lmlitdta,Lmlcpvcp,Lmlhsvcp,_max_dat,

1 Answer


The error G0159: Wrong number of parameters means that the wrong number of inputs are being passed to a GAUSS procedure. In this case, the error message is tell us that this is occurring on line 2912 of maxutil.src and the the code on that line is:

a0 = ll(x, z);

The rest of the error message shows us the line and file number of all of the function calls that took us to this particular line. From this it appears that ll is a pointer to your likelihood function.

Based upon this, I would suspect that your likelihood procedure takes more than two inputs or fewer than one input. If this does not clear things up, could you post your likelihood procedure?

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