Thanks Sven.
I wrapped the computation loop in a function and put the function inside
the mle command, and it is ok.
Alecos Papadopoulos PhD
Athens University of Economics and Business
web:
alecospapadopoulos.wordpress.com/
scholar:https://g.co/kgs/BqH2YU
On 2/10/2021 11:21, Sven Schreiber wrote:
> Am 02.10.2021 um 07:47 schrieb Alecos Papadopoulos:
>> Good morning.
>>
>> I have a likelihood computed by applying quadrature twice, in a
>> double-sum way. I can compute the inner sum and then use an index
>> loop to compute the outer sum and the whole likelihood.
>>
>> My questions are
>>
>> a) Can I include a loop inside an mle command? My impression is, "no".
> You're probably right (still would be useful just to try it). But you
> could wrap the loop in a function which you then call inside the MLE
> block. I don't see why that wouldn't work, and it would probably be
> cleaner anyway. An example for a user-defined function that is called
> inside 'mle' is in section 26.8 of the guide: the 'score' function
there.
>>
>> b) If I write the computation of the likelihood in a user-defined
>> function, can I include this function in an mle command?
> Yes - see in that guide chapter the example with the ln_zip_prob
> function.
>
> hth,
>
> sven
>
> _______________________________________________
> 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/