print(result.samples.parameter_lists[10][:]) print(result.samples.log_likelihood_list[10]) """ We can also use it to get a model instance of the `median_pdf` model, which is the model where each parameter is the value estimated from the probability distribution of parameter space. """ mp_instance = result.samples.median_pdf_instance print() print("Median PDF Model:\n") print("Centre = ", mp_instance.centre) print("Intensity = ", mp_instance.intensity) print("Sigma = ", mp_instance.sigma) """ The Probability Density Functions (PDF's) of the results can be plotted using the Emcee's visualization tool `corner.py`, which is wrapped via the `EmceePlotter` object. The PDF shows the 1D and 2D probabilities estimated for every parameter after the model-fit. The two dimensional figures can show the degeneracies between different parameters, for example how increasing $\sigma$ and decreasing the intensity $I$ can lead to similar likelihoods and probabilities. """ emcee_plotter = aplt.EmceePlotter(samples=result.samples) emcee_plotter.corner() """ The PDF figure above can be seen to have labels for all parameters, whereby sigma appears as a sigma symbol, the intensity is `I`, and centre is `x`. This is set via the config file `config/notation/label.ini`. When you write your own model-fitting code with PyAutoFit, you can update this config file so your PDF's automatically have the correct labels. we'll come back to the `Samples` objects in tutorial 6! """
""" We now pass the samples to a `EmceePlotter` which will allow us to use emcee's in-built plotting libraries to make figures. The emcee readthedocs describes fully all of the methods used below - https://emcee.readthedocs.io/en/stable/user/sampler/ The plotter wraps the `corner` method of the library `corner.py` to make corner plots of the PDF: - https://corner.readthedocs.io/en/latest/index.html In all the examples below, we use the `kwargs` of this function to pass in any of the input parameters that are described in the API docs. """ emcee_plotter = aplt.EmceePlotter(samples=samples) """ The `corner` method produces a triangle of 1D and 2D PDF's of every parameter in the model fit. """ emcee_plotter.corner( bins=20, range=None, color="k", hist_bin_factor=1, smooth=None, smooth1d=None, label_kwargs=None, titles=None, show_titles=False, title_fmt=".2f", title_kwargs=None,