I am using emcee in order to analyze some data, related to the SN 1a. Before tackling the real data, I started with simulated data. The results I obtained appear to be good:
Now, I want to calculate the posteriors of some quantities, such as
f(q,j) = j - q^2
using the posteriors I have obtained for q and j. Can anyone help me?
If you have raw posterior samples of j and q, e.g., two numpy arrays
j
andq
, then computing elementwise on those arrays will yield the corresponding samples for the desired variable. In your example,f = j - q**2
.I know options to capture samples of transformed variables of interest directly in the sampler exist in other samplers (Stan, PyMC3). Maybe someone who knows emcee (not me) knows how to do this.