Multiple data groups with custom log-likelihood function

Hi Shihab

To briefly answer your first question: No, it is not possible to supply multiple data groups with user-define likelihood functions. If you handle and work with advanced discrepancy models, it is expected that you know how to implement the simple additive discrepancy model currently implemented in UQLab.

The notion of data groups can be simply addressed by providing a user-defined likelihood function that handles the provided data and intended discrepancy model.

Regarding your second question, I found two problems with your code:

  • The user-defined likelihood function should be passed as the log-likelihood function, so I am pretty sure you should change the product in line 31 to a sum.
  • The convergence problem seems to stem from -Inf being returned frequently by your user-defined likelihood function. There could be multiple reasons for this, but it seems that you are not exploiting the advantages of a likelihood formulation in the log space properly. The reason the likelihood is typically implemented in the log space is to avoid 0 output of the likelihood function that can come from underflow issues. It looks like you are just transforming the likelihood output to the log-space after evaluating everything in the standard space, which defeats the purpose.
  • What is the purpose of line 30 of LL_SHM_B? It seems like there is a lonely y(j); there.

Let me know if any of these solves your issue.

Just a sidenote: Consider vectorizing your custom likelihood function and avoid loops as much as possible to take advantage of MATLAB’s vectorization optimization. This could significantly speed up the MCMC sampler.

2 Likes