I am estimating a linear feedback model with sequential instruments using the GAUSS programme EXPEND from Frank Windmeijer I get the following error message:
D:\gauss\expendnmJKR.prg(99) : error G0462 : Negative trim value Currently active call: makezi  D:\gauss\expendnmJKR.prg Stack trace: makezi called from D:\gauss\expendnmJKR.prg, line 149 makezz called from D:\gauss\expendnmJKR.prg, line 1041
The lines 149 and 1041 in expendnmJKR.prg contain:
149: z = makezi(yx,year,ji); 1041: w = invpd(makezz);
Could anyone tell me, what this error means and how it possibly can be solved?
Thanks in advance
P.S.: GAUSS 13.0.2 build 2940
It appears that on line 99 in file expendnmJKR.prg is a call to the GAUSS function trimr. This function takes 3 inputs. The first argument is a matrix to be "trimmed". The second argument is how many rows to trim, or remove from the top of the matrix. The third argument is how many rows to remove from the bottom of the matrix.
Either the second or third argument to trimr is negative. The error means that the program is trying to remove a negative number of rows from a matrix.
The fastest way to see what is going on is probably to stick a breakpoint on that call to trimr, then run the debugger to that point and see which value is negative. Then you can look backwards and see what went wrong.