How to use the astromodels.Log_uniform_prior 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 / bayesian / tutorial_material.py View on Github external
def get_bayesian_analysis_object_simple_likelihood():
    minus_log_L = Simple()

    minus_log_L.mu.set_uninformative_prior(Log_uniform_prior)

    # Instance a plugin (in this case a special one for illustrative purposes)
    plugin = CustomLikelihoodLike("custom")
    # Set the log likelihood function explicitly. This is not needed for any other
    # plugin
    plugin.set_minus_log_likelihood(minus_log_L)

    # Make the data list (in this case just one dataset)
    data = DataList(plugin)

    src = PointSource("test", ra=0.0, dec=0.0, spectral_shape=minus_log_L)
    model = Model(src)

    bayes = BayesianAnalysisWrap(model, data, verbose=False)

    return bayes, model
github threeML / threeML / threeML / bayesian / tutorial_material.py View on Github external
def get_bayesian_analysis_object_complex_likelihood():
    minus_log_L = Complex()

    minus_log_L.mu.set_uninformative_prior(Log_uniform_prior)

    # Instance a plugin (in this case a special one for illustrative purposes)
    plugin = CustomLikelihoodLike("custom")
    # Set the log likelihood function explicitly. This is not needed for any other
    # plugin
    plugin.set_minus_log_likelihood(minus_log_L)

    # Make the data list (in this case just one dataset)
    data = DataList(plugin)

    src = PointSource("test", ra=0.0, dec=0.0, spectral_shape=minus_log_L)
    model = Model(src)

    bayes = BayesianAnalysisWrap(model, data, verbose=False)

    return bayes, model