How to use the astromodels.core.parameter.Parameter function in astromodels

To help you get started, we’ve selected a few astromodels examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github threeML / threeML / threeML / analysis_results.py View on Github external
def get_equal_tailed_interval(self,parameter,cl=0.68):
        """

        returns the equal tailed interval for the parameter

        :param parameter_path: path of the parameter or parameter instance
        :param cl: credible interval to obtain
        :return: (low bound, high bound)
        """

        if isinstance(parameter,Parameter):


            path = parameter.path

        else:

            path = parameter



        variates = self.get_variates(path)

        return variates.equal_tail_interval(cl)
github threeML / threeML / threeML / plugins / SpectrumLike.py View on Github external
self._back_count_errors,
        ) = self._count_errors_initialization()

        # Initialize a mask that selects all the data.
        # We will initially use the quality mask for the PHA file
        # and set any quality greater than 0 to False. We want to save
        # the native quality so that we can warn the user if they decide to
        # select channels that were flagged as bad.

        self._mask = np.asarray(np.ones(self._observed_spectrum.n_channels), np.bool)

        # Now create the nuisance parameter for the effective area correction, which is fixed
        # by default. This factor multiplies the model so that it can account for calibration uncertainties on the
        # global effective area. By default it is limited to stay within 20%

        self._nuisance_parameter = Parameter(
            "cons_%s" % name,
            1.0,
            min_value=0.8,
            max_value=1.2,
            delta=0.05,
            free=False,
            desc="Effective area correction for %s" % name,
        )

        nuisance_parameters = collections.OrderedDict()
        nuisance_parameters[self._nuisance_parameter.name] = self._nuisance_parameter

        # if we have a background model we are going
        # to link all those parameters to new nuisance parameters

        if self._background_plugin is not None: