G0165 : Type mismatch or missing arguments Argument 2, found MATRIX , expected ??? (19) 'Argument 2, found MATRIX , expected ??? (19)'

Hi,

I have tried running the below code, but got this error, G0165 : Type mismatch or missing arguments Argument 2, found MATRIX , expected ??? (19) 'Argument 2, found MATRIX , expected ??? (19)' . Tq

 

z = y~x;
clear y,x;
parnames = XVAR;
output on;
" POISSON MAXIMUM LIKELIHOOD using Maxlik and ghmnl1.src";
" Dataset ";;Data;
" Nr of observations ";;n;
" Nr of times data is read ";;nror;
" Nr of obs. read last chew ";;rest;
" Dependent variable ";;$yvar;
" Parameters (Variables) names ";
$parnames';
"";
output off;

/* Analytical derivatives and hessian.
Can delete if instead use numerical derivatives
*/

_max_HessProc = &pohess; @ analytical hessian provided in hgcount.src @
_max_GradProc= &pogrd; @ analytical gradient provided in hgcount.src @

/* Setting various parameters for maxlik.
These are generally ones that over-ride the default values in maxlik.
for default values and descriptions see the maxlik manual
or the Gauss code in maxlik.src
*/

_max_Parnames = xvar; @ Parameter names which here = variable names @
_mlditer = 40; @ Not sure @
_max_Algorithm = 4; @ Newton Raphson = 4 BFGS = 2 (def) @
_max_MaxIters = 250; @ maximum number of iterations @
_mlmtime = 1e+5; @ Not sure 1e+5 = default @
_max_CovPar = 3; @ Method to compute covariance matrix @
@ 3 = heteroskedastic-consistent estimate @
_max_GradTol = 0.00001; @ Convergence tolerance for gradient of coeffs @
__output = 0; @ Minimal output. Use for Unix without X-windows @

start = (0.01*rndn(k,1)); @ start values for coeffs here randomly chosen @

/* Call maxlik.
Arguments are
data = the name of the Gauss data set (or matrix if data in matrix)
yvar|xvar = the variables to be selected from the Gauss data set
polli = procedure to compute log-likelihood (in ghcount.src)
start = starting values of the parameters
*/
output on;
{bp,phi0,grdp,covp,retcode} = maxlikmt(data,yvar|xvar,&polli,start);

/* Print the results from maxlik */
call maxlikmtprt(bp,phi0,grdp,covp,retcode);
output off;

f1 = close(f1);

1 Answer



0



The problem here is that the likelihood function required by maxlikMT takes different parameter inputs than the likelihood for maxlik. This code is set up to use maxlik and will not work for maxlikMT without some modification. If you change maxlikmt to maxlik and change maxlikmtprt to maxlikprt, the code should run without problem.

aptech

1,773

Your Answer

1 Answer

0

The problem here is that the likelihood function required by maxlikMT takes different parameter inputs than the likelihood for maxlik. This code is set up to use maxlik and will not work for maxlikMT without some modification. If you change maxlikmt to maxlik and change maxlikmtprt to maxlikprt, the code should run without problem.


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.