Thanks Artur.
But this also highlights the disadvantages of a mailing list instead of
a forum, as regards search capabilities. It appears though that we do
not want to change that.
We should at least contemplate the creation of a blog or something,
which we could call "A Hack from Jack", and start collecting there these
neat gretl hacks -which often are not hacks of course, but instances of
deep familiarity with logic, programming, and gretl. I know that it is
not only Jack that has contributed such, but a blog title must be an
instant hit - and "A Hack from Jack" rhymes greatly and is never
forgotten. "Gang of Four" would be the fair title to all the guardians
of gretl, but I doubt that anybody else here believes that Andy Gill is
god. Was, unfortunately.
Over the years each gretl user has benefited from those hacks that
answered each one's few special inquiries -but if statistics are of any
worth, these "special inquiries" are not so unique. With a bit of
careful tagging it could turn into a great gretl-resource.
Thanks again for this Hack from Jack.
Alecos Papadopoulos PhD
Athens University of Economics and Business
web:
alecospapadopoulos.wordpress.com/
skype:alecos.papadopoulos
On 19/8/2020 20:15, Artur Tarassow wrote:
> Am 19.08.20 um 18:32 schrieb Alecos Papadopoulos:
>> Gretl 2020d, Windows 64-bit.
>>
>> I give the command
>>
>> matrix meancolumnsB = meanc(B)
>>
>> The matrix "meancolumnsB " is generated as a single-row matrix as
>> expected, but with "nan" in all its cells.
>>
>> I can see the matrix B ok, it is a 10000 X 9 matrix, I can
>> copy-paste it, export it in spreadsheet etc.
>>
>> What I observe is that there are 6 rows in the "B" matrix with
"nan"
>> values.
>>
>> So it appears that the meanc() function , in contrast to the mean()
>> function, cannot skip missing values?
>>
>> If this is the case can we do something about it? The matrix B
>> collects results from MLE simulations, and there are various
>> instances where we are bound to get a "nan" value (the MLE did not
>> converge, or the B may collect the elements of the Hessian but the
>> Hessian is not computable and the algorithm drops back to OPG, etc)
>>
>> Note: I also run
>>
>> matrix meanrowsB = meanr(B)
>>
>> Here, the result came out ok, with a "nan" result for the 6 rows of
>> "B" that were filled with "nan" originally. But what would
happen if
>> in some row I would have some numbers and some "nan"? Will the
>> meanr() return then a "nan" result?
>>
>
> Hi,
>
> Here is a hack from Jack. He posted it some years ago:
>
> <hansl>
> function matrix my_meanc(const matrix X)
> matrix B = ok(X)
> return sumc(B ? X : 0) ./ sumc(B)
> end function
>
> matrix A = {NA, 1; 2, 2; 1, 3}
> mA = my_meanc(A)
> mA
> </hansl>
>
> Best,
> Artur
> _______________________________________________
> Gretl-users mailing list -- gretl-users(a)gretlml.univpm.it
> To unsubscribe send an email to gretl-users-leave(a)gretlml.univpm.it
> Website:
>
https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/