On Fri, 30 Sep 2011, Giuseppe Vittucci wrote:
>> I thought I could use the mle command with the related
log-L:
>> Log-L = - n/2(ln SSR/n + const)
>> where SSR could have been the output of the function
>>
>> The problem is that such function must have vectors as arguments: gamma
>> and c are vectors whose dimension can change, since they depend on the
>> number of regimes and location parameters, in turn determined by the
>> tests or the researcher.
>> So, it seems quite problematic to adapt the mle command.
>
> I don't see why.
> I guess your best strategy is to define a function like
>
> function series blah(series y, list X, matrix gamma, matrix c)
>
> which returns the term inside the double summation in eq (11) and then use
> that in computing the loglikelihood.
Yes, I thought it was a workable strategy and possibly it is.
The problem with mle is that mle seems to accept as argument of the
function only scalars (or does it accept also matrices?) and you have to
list in the second line of the command what they are), while the above
function as two vectors as argument.
You're both right and wrong.
You're wrong because you can use vectors as arguments.
You're right because the help for mle doesn't say explicitely that you can
supply a vector to the "params" keyword, and the only example in the
manual which does that is buried in a somewhat different context (special
prize for those who can find it). By the way, this holds true for the
"gmm" and "nls" commands too. It's been common knowledge among
hansl
coders so far, but, yes, it's important to mention this in the
documentation. I'll do this asap. Thanks!
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti