Open JoaoHaddad opened 2 years ago
Hi - this occurs whenever there's a numeric problem when evaluating the hessian in the neighborhood of the mode for that particular parameter. In that case, the diagonal element of the inversed Hessian is replaced with 4*max(x, 1) where x is the mode of the parameter.
Hard to say what could have caused the numeric problems here - could you possibly upload everything needed to reproduce your results, and look into the issue?
Best Jaromir
On Wed, Jul 20, 2022 at 4:21 AM JoaoHaddad @.***> wrote:
Hi, a possible silly question:
Why does the function estimate generates some parameter's PosterStd equal to 4?
[image: image] https://user-images.githubusercontent.com/109638844/179882055-8093ce85-b4f1-46a6-aaa3-fde4731725eb.png
— Reply to this email directly, view it on GitHub https://github.com/IRIS-Solutions-Team/IRIS-Toolbox/issues/331, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCVKKWXF3XISNYUKWRQCMLVU5PDTANCNFSM54B56F5A . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hi
The std reported should be, in theory, based on the inverse of the Hessian (i.e. the matrix of second derivatives of the posterior density w.r.t to parameters) at the optimum. However, because the Hessian returned from the Optimization Tbx has usually all sorts of numeric problems (because it's a very crude approximation based mostly on consecutive updates from Jacobians only, i.e. first derivatives) and is rarely invertible, we instead compute partial second derivatives (individually for each parameter, keeping the other parameters fixed) in IrisT as a crude measure of the parameter estimate variability.
Here, sometimes, the second derivative has a negative sign - a situation occurring when there is a strong cross-correlation between the estimates of individual parameters. In that case, a placeholder value of 4*max(x, 1) is inserted instead.
Also a couple of observations:
If you specify the lower and upper bounds for each parameter in your E struct, you don't have to add the uniform distribution - it's absolutely equivalent, and only slows down the progress. You can therefore drop the loop lines 79-81.
In linear models, you don't have to request the recomputation of the steady state in each estimation iteration. The first-order solution of linear models is independent of their steady state. You can therefore drop the 'sstate', true option from estimation.
I would strongly discourage you from using beta distributions (or gamma, for that matter, too) as priors. If you think of priors as a sort of penalty function that we use to force the parameters to stay close to our preferred values, what matters is the shape of the log density of the prior. Try to plot the log density of your prior, and ask if this is really what you want (it may be, but mostly not)
For instance, do
f = distribution.Beta.fromMeanStd(0.05,0.005); x = 0.05 : 0.001 : 0.95; figure(); plot(x, f.logPdf(x));
Mostly, the normal distribution (which implies a quadratic shape in terms of its log density) combined with lower and upper bounds (=truncation) is the best option to translate our priors to numerical representation.
Best Jaromir
On Wed, Jul 20, 2022 at 4:33 PM JoaoHaddad @.***> wrote:
Modelo.zip https://github.com/IRIS-Solutions-Team/IRIS-Toolbox/files/9150767/Modelo.zip
Hi Jaromir,
There it is.
Thanks for the answer, João
— Reply to this email directly, view it on GitHub https://github.com/IRIS-Solutions-Team/IRIS-Toolbox/issues/331#issuecomment-1190364877, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCVKKUKCQPVGXLGBCZMVATVVAE4FANCNFSM54B56F5A . You are receiving this because you commented.Message ID: @.***>
Hi, a possible silly question:
Why does the function estimate generates some parameter's PosterStd equal to 4?