def posterior_to_xarray(self):
        """Convert posterior samples to xarray."""
        data = self.posterior
        if not isinstance(data, dict):
            raise TypeError("DictConverter.posterior is not a dictionary")

        if "log_likelihood" in data:
            warnings.warn(
                "log_likelihood found in posterior."
                " For stats functions log_likelihood needs to be in sample_stats.",
                SyntaxWarning,
            )

        return dict_to_dataset(data, library=None, coords=self.coords, dims=self.dims)
Convert posterior samples to xarray.