Procedure For Computing Likelihood Function
The user must provide a procedure for computing the log-likelihood for either one observation, or for a matrix of observations. The procedure must have two input arguments, first, a vector of parameter values, and second, one or more rows of the data matrix. The output argument is the log-likelihood for the observation or observations in the second argument evaluated at the parameters values in the first argument. Suppose that the function procedure has been named fct, the following considerations apply:
FORMAT logl=fct(x,y) INPUT x - vector of parameters of model y - one or more rows of the data set (if the data set has been transformed, or if vars /= 0, i.e., there is selection, then y is a transformed, selected observation) if __row == 1, one row of the data set if __row >= 2, if data set is stored in memory then all of the data set will be passed to FCT; if data set is stored in GAUSS data file then __row will be passed to passed to FCT. if __row <= 0, For data set is stored in memory same as __row>= 2, for GAUSS data file the maximum number of rows that will fit in memory will be computed by MAXLIK. if _max_Lag >= 1, a matrix of observations, the first is the i-_max_Lag row, and the final row is the i-th row. OUTPUT logl - the log-likelihood if __row == 1 or _max_Lag >= 1, a scalar value for a given observation, otherwise a vector of log-likelihoods.
REMARKS
If you have written the procedure such that it must compute the log-likelihood of one observation at a time then you must set __row = 1. But if you are able to write the procedure so that a vector of log-likelihoods may be returned then set __row=0; If you are getting "insufficient memory" messages when the data are being read from a GAUSS data file then either set __row ==1 or to some positive value. Also, if the data set is stored in a GAUSS data set and the selected data set will fit into memory, then MAXLIK will read it in and store it before beginning the iterations. In this case the setting of __row will follow the rules of a data set stored in memory. Significant reduction in computation time may be achieved when the data set can be stored in memory and procedure is written to compute vectors of log-probabilities.