Matrix-based predictions and complex variables

Hi again,

I think I have resolved the issue. The scan function iterates over the first dimension, whereas my synthesised observation iterates over the third. Changing this in the observation resulted in correct inference of the values for mass1 (10), mass2 (20), and the standard deviation of additive noise (100). Lovely stuff, thank you for all the pointers.

In my original post, I mentioned I would like to extend this into using complex values in calculating the likelihood function (Z = jwm), however, I only require absolute values for Z i.e. ‘mu’. Despite this, it would seem that NUTS does not accept complex number use on account of gradient issues. Admittedly, I need to read up on this a bit more but I did see this post “Using PyMC3 in a model with complex variables inside” that seems to suggest this is a no-go as I have found.

Using Metropolis does navigate this issue for the toy example chosen. I do wonder though if you had any thoughts on a work-around whereby I use complex numbers but only take the absolute value - such that the NUTS sampler could be used. Something like this perhaps - Using a “black box” likelihood function?

Many thanks once again.
:slight_smile:

1 Like