Maximum Likelihood estimation of survival model: type mismatch or missing argument

Hi

I am trying to estimate a simple survival model using maximum likelihood technique. However, I am getting the following message

G0165 : Type mismatch or missing arguments [maxutil.src, line 634]

Additional information

Currently active call:

File maxutil.src, line 634, in _max
omat = parnms~x1~relgrad1;

Traceback:

File maxlik.src, line 547, in maxlik
{ x,f,g,h,retcode,Lmlfhess,Lmlitdta,Lmlcpvcp,Lmlhsvcp,_max_dat,
File 02 activity generation v2.gss, line 124, in <main>
{ x,f,g,cov,retcode } = maxprt(maxlik(dataset,0,&lhz,bb));

 

I have been using GAUSS for quite some time now, but have not been run into such an error before. I would appreciate if you could provide some insight on the matter.

Regards

Annesha

 

2 Answers



0



accepted

Problem

Most likely what is happening is that parnms on line 634 of maxutil.src

omat = parnms~x1~relgrad1;

is a string array. You can verify that the matrix horizontal concatenation operator will cause this error with a simple example:

// Create a simple, 2x1 string array
sa = "alpha" $| "beta";

// Create a 2x1 matrix
mat = { 1, 2 };

// Reproduce 'type mismatch or missing argument' error
tmp = sa ~ mat;

In this case, it is a "type mismatch" as the matrix horizontal concatenation operator, ~, only works with matrices.

Resolution

The parnm variable from the error report will be set with the contents of the _max_ParNames global control variable if it is set. So, most likely _max_ParNames is a string array and that is causing the problem.

You can convert a string array to a character vector (a matrix containing text) with the function satocv like this:

// Set to example string array
_max_ParNames = "alpha" $| "beta";

// Convert to a character vector
_max_ParNames = satocv(_max_ParNames);

aptech

1,773


0



Thank you so much - this is very helpful.

 

 

Your Answer

2 Answers

0
accepted

Problem

Most likely what is happening is that parnms on line 634 of maxutil.src

omat = parnms~x1~relgrad1;

is a string array. You can verify that the matrix horizontal concatenation operator will cause this error with a simple example:

// Create a simple, 2x1 string array
sa = "alpha" $| "beta";

// Create a 2x1 matrix
mat = { 1, 2 };

// Reproduce 'type mismatch or missing argument' error
tmp = sa ~ mat;

In this case, it is a "type mismatch" as the matrix horizontal concatenation operator, ~, only works with matrices.

Resolution

The parnm variable from the error report will be set with the contents of the _max_ParNames global control variable if it is set. So, most likely _max_ParNames is a string array and that is causing the problem.

You can convert a string array to a character vector (a matrix containing text) with the function satocv like this:

// Set to example string array
_max_ParNames = "alpha" $| "beta";

// Convert to a character vector
_max_ParNames = satocv(_max_ParNames);

0

Thank you so much - this is very helpful.

 

 


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.