Background
Let me first start off by saying I ackownledge find_MAP
is not recomended. I’m using the function to prove a point in a paper.
I want to compare models fit through MAP and full Bayesian inference for a heirarchical partially pooled non-linear regression model. I find the map by performing
with model:
maps = pm.find_MAP(method="powell", maxeval=50000)
Upon termination, the log-likelihood is approximately 2250. However, when I evaluate the log probability with model.logp(maps)
, I get a different log-likelihood value.
Upon inspection, model.test_point
and what is returned from find_MAP
have different keys.
Here is the return from model.test_point
dict_keys(['log_CL', 'betas_CL_1', 'betas_CL_2', 'betas_CL_3', 'z_CL', 's_CL_log__', 'log_alpha_log_ke_z', 'betas_ke_1', 'betas_ke_2', 'betas_ke_3', 'z_ke', 's_ke_log__', 'betas_ka_1', 'betas_ka_2', 'betas_ka_3', 'z_ka', 's_ka_log__', 'delay_mu_logodds__', 'delay_kappa_log__', 'delays_logodds__', 'sigma_log__'])
and here is the return from find_MAP
dict_keys(['log_CL', 'betas_CL_1', 'betas_CL_2', 'betas_CL_3', 'z_CL', 's_CL_log__', 'log_alpha_log_ke_z', 'betas_ke_1', 'betas_ke_2', 'betas_ke_3', 'z_ke', 's_ke_log__', 'betas_ka_1', 'betas_ka_2', 'betas_ka_3', 'z_ka', 's_ka_log__', 'delay_mu_logodds__', 'delay_kappa_log__', 'delays_logodds__', 'sigma_log__', 's_CL', 'logit_alpha', 'log_ke', 's_ke', 'log_ka', 's_ka', 'delay_mu', 'delay_kappa', 'delays', 'y_est', 'sigma'])
It looks like find_MAP
is using random variables on the bounded and unbounded scale. For instance, delay_mu
has a Beta prior. In the test point, we see the logodds of that parameter, but in the find_MAP
result we see both delay_mu_logodds__
and delay_mu
.
Question
- Is
find_MAP
attempting to optimize parmameters on the bounded and un bounded scale? - Is this intended functionality, and if not how can I rectify this?