threeML.minimizer.tutorial_material module

class threeML.minimizer.tutorial_material.Complex(**kwargs)[source]

Bases: Simple

description :

A convex log likelihood with multiple minima

latex : n.a.

parameters :

k :

desc : normalization initial value : 1.0 fix : yes

mu :

desc : parameter initial value : 5.0 min : 1.0 max : 100

evaluate(x, k, mu)[source]
static info()
class threeML.minimizer.tutorial_material.CustomLikelihoodLike(name)[source]

Bases: PluginPrototype

get_log_like()[source]

Return the value of the log-likelihood with the current values for the parameters

get_number_of_data_points()[source]

This returns the number of data points that are used to evaluate the likelihood. For binned measurements, this is the number of active bins used in the fit. For unbinned measurements, this would be the number of photons/particles that are evaluated on the likelihood

inner_fit()

Return the value of the log-likelihood with the current values for the parameters

set_minus_log_likelihood(likelihood_function)[source]
set_model(likelihood_model_instance)[source]

Set the model to be used in the joint minimization. Must be a LikelihoodModel instance.

class threeML.minimizer.tutorial_material.JointLikelihoodWrap(likelihood_model: Model, data_list: DataList, verbose: bool = False, record: bool = True)[source]

Bases: JointLikelihood

fit(*args, **kwargs)[source]

Perform a fit of the current likelihood model on the datasets

Parameters:

quiet – If True, print the results (default), otherwise do not print anything

:param compute_covariance:If True (default), compute and display the errors and the correlation matrix. :param n_samples: Number of samples to scan the likelihood. :return: a dictionary with the results on the parameters, and the values of the likelihood at the minimum

for each dataset and the total one.

class threeML.minimizer.tutorial_material.Simple(**kwargs)[source]

Bases: Function1D

description :

A convex log likelihood

latex : n.a.

parameters :

k :

desc : normalization initial value : 1.0 fix : yes

mu :

desc : parameter initial value : 5.0 min : 1.0 max : 100

evaluate(x, k, mu)[source]
static info()
jump_tracking()[source]
reset_tracking()[source]
start_tracking()[source]
stop_tracking()[source]
threeML.minimizer.tutorial_material.get_callback(jl)[source]
threeML.minimizer.tutorial_material.get_joint_likelihood_object_complex_likelihood()[source]
threeML.minimizer.tutorial_material.get_joint_likelihood_object_simple_likelihood()[source]
threeML.minimizer.tutorial_material.plot_likelihood_function(jl, fig=None)[source]
threeML.minimizer.tutorial_material.plot_minimizer_path(jl, points=False)[source]
Parameters:

jl (JointLikelihood) –

Returns: