Failure to maximise simulated likelihood
Show older comments
Hi all,
I am trying to translate a large piece of code from Ox (where it is working) to Matlab and face two issues that I would immensely appreciate your advice on (having worked to solve them for a week with no success).
- Model: Vector autoregressive model where one variable is censored and kinked; call the underlying variable the latent one. The user can choose whether or not this variable appears on the right-hand side in the model (or just on the LHS).
- Estimation: If there are no latent variables on the right-hand side (RHS), the exact likelihood is available. Otherwise, and that's the main case of interest, I employ a simulated likelihood a la Lee (1999).
2 issues arise when the latent variable does appear on the RHS; otherwise everything works fine
1. Maximising the likelihood does not lead to convergence; in particular, the parameter values relating to the latent lags typically remain stuck at or close to the starting value.
- I've used fminunc with various options, typically the exit flag value is 5, indicating that the first-order optimality measure is above the function tolerance (in fact, it is far too high).
- I've changed the starting values, used multistart, etc.
- Using patternsearch gets closer to the values I obtain in Ox, but the basic problem remains.
2. When estimating the Hessian matrix based on the simulated likelihood function I've coded and what I treat as the true parameter values (from Ox), using the function "hessian" from the DERIVEST package, a few elements are equal to NaN. Accordingly, I can't implement typical statistical testing procedures. I wonder whether this is indicative of some deeper problem.
- Further notes
- Matlab version: R2017b.
- When evaluating the (simulated) likelihood at the 'true' parameter values, I get the right likelihood value; so the problem doesn't seem to be the likelihood as such.
- When estimating a model without latent lags on the right-hand side but enabling the use of the simulated likelihood for testing purposes, I get the same result (albeit more slowly, of course) as with the exact likelihood. So it doesn't seem to be the case that maximising the simulated likelihood is the problem as such either.
I'm aware that this is not the typical question that can provide a specific error message or similar, but would be all the more grateful for any advice!
Best wishes, Lukas
Answers (1)
Alan Weiss
on 6 Aug 2018
0 votes
While your problem is quite involved, and I don't understand some of what you ask, I wonder whether you might do better by using larger-than-default finite differences.
I apologize if this suggestion is off base.
Alan Weiss
MATLAB mathematical toolbox documentation
3 Comments
Lukas Freund
on 6 Aug 2018
Alan Weiss
on 6 Aug 2018
I didn't mean to imply that you weren't clear, just that I don't understand what you are talking about (latent variables are beyond me).
One other thought occurs to me. Have you tried fmincon instead of fminunc? You don't need any constraints to use fmincon, and it has a wider variety of algorithms and options that you can tweak. I'd start by trying the default 'interior-point' algorithm, and if that doesn't work better, try some other algorithms or options (such as Hessian options).
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Lukas Freund
on 9 Aug 2018
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!