"gpanterov Panterov" <gpanterov@gmail.com> wrote in message <hpqf7s$qiv$1@fred.mathworks.com>...
> Hi All,
> I would be grateful if someone can address the problem I've been struggling with. So far neither Python nor Matlab have been able to help and I am beginning to loose hope....
>
> I am trying to maximize a loglikelihood for a bivariate Poisson distribution at a few hundred points in time and obtain some outofsample predictions at each point. The problem has quite a few variables (which I suspect could be part of the problem?).
>
> The Log likelihood is :
>
> L=sum(lambda + y1.*log(lambda)  log(factorial(y1))  mu + y2.*log(mu)  log(factorial(y2)));
>
> Where lambda and mu are the means of the two variables and depend on the parameters of interest.
>
> I have attempted this with fminunc and fminsearch but unsuccessfully so far.
> [x,fval,exitflag]=fminunc(@(k) likelihood(k,y1,y2,X1,X2),k0,options);
>
> k is a vector and consists of 72 parameters whose estimates I need to find. y1 and y2 are the two Poisson variables with 3000 elements each.
>
> What is the problem?
> Well, whatever estimates I obtain seem to be extremely fragile. For example a simple sorting of the dataset causes a complete reversal of the results. The estimates seem to be extremely sensitive to the sample size as well as to the initial guess. Including the gradient of the likelihood only seems to burden the algorithm and the estimates are often identical to the initial guess. I tried resetting the TolX, TolFun, MaxFunEvals etc.. but to no avail. I often get the error message "Optimization terminated at the initial point" or "Line search cannot find an acceptable point..."
>
> Am I wrong in my approach? Is Matlab ill equipped to handle such a problem? Perhaps I should try with a different solver? Or maybe I could improve the likelihood?
>
I might point out that if you will repeatedly compute the
log of the factorial of the same vectors, each of length
3000 elements, this will make for very slow running code.
Is matlab illequipped? No more so than any other
tool on a nasty problem. More importantly, you show
no place where the likelihood function depends on k,
i.e., the parameters that you are optimizing over.
John
