Hi everyone,
I'm using LmFit to find some best-fit parameters. Let's call them A and B. I can easily find the best-fit A and B using lmfit, but things get tricky once emcee comes into play. Because of some prior information and assumptions in my model, it is more statistically robust to explore a posterior probability distribution
corner plot of A vs (A+B) rather than A vs B. I notice in the example provided by the documentation, the authors use res.flatchain for the data input to create the corner plot, but unfortunately I read (
here) that flatchain returns values for
only the parameters that vary! Here is their code:
>>> mini = lmfit.Minimizer(lnprob, mi.params)
>>> res = mini.emcee(burn=300, steps=600, thin=10, params=mi.params)
>>> import corner
>>> corner.corner(res.flatchain, labels=res.var_names, truths=list(res.params.valuesdict().values()))
The crux of my issue is this: I want to expand the flatchain object to contain values for non-varying, 'expr' parameters so I may create a corner plot that explores posterior probability distributions not for A and B, but for A and (A+B). I tried to dig into the weeds to understand what kind of object flatchain is... but then I started seeing things about pandas, so I decided to turn here.
I'll be very thankful for any help I can get!
Respectfully,
Nick Cemenenkoff