Applying a Gaussian plume model to PyMC mcmc modelling

Hi Jason,

You can loop in PyMC, but it’s often better to try to first think about whether another approach is possible. Could you post some code that shows the model you are trying to implement, even if it’s just numpy/pandas instead of PyMC? I’m not familiar with a guassian plume model, but from a quick google search it looks like it’s just a function of spatial coordinates. If that’s the case, you don’t need to loop at all, you can just directly do the computations on the vectors of coordinate data. If you have something like this equation:

C(x, y, z) = \frac{Q}{U} \frac{1}{2 \pi \sigma_y \sigma_z} \exp(-\frac{y^2}{2\sigma_y^2})\left [ \exp(-\frac{(z - H)^2}{2\sigma_z^2} + \exp(-\frac{(z + H)^2}{2\sigma_z^2})) \right ]

Then you can just add the coordinate columns to your model as pm.MutableData, define random variables/parameters, and just type in this formula directly without any loops, using vectors in place of variables x, y, and z.