ellipse¶
Assuming that the likelihood of the fit follows a gaussian distribution (Central Limit Theorem), and therefore the log-likelihood is characterized by a quadratic form around the minimum, this script finds this quadratic form, and parametrizes (ellipsoidal) sections of constant likelihood.
-
SMEFT19.ellipse.
load
(filename)[source]¶ Loads a ellipse saved in a .yaml file to a python dictionary.
- Arguments
filename: Path to the .yaml file where the shape of the ellipse has been saved by the save method.
- Returns
- A python dictionary containing:
bf: np.array with the point in parameter space with the best fit.
v: np.matrix containing the orientation of the axes of the ellipsoid.
d: np.array containing the principal axes of the ellipsoid.
L: Log-likelihood at the best fit point.
[name: Name of the fit.]
[fit: Scenario used in the fit.]
-
SMEFT19.ellipse.
minimum
(fit, x0)[source]¶ Finds the minimum of the fit function and approximates its neighbourhood by an ellipsoid.
- Arguments
fit: function that takes one point in parameter space and returns its negative log-likelihhod. Example: -SMEFTglob.likelihood_global(x, scenarios.scVI).
x0: list or np.array containing an initial guess.
- Returns
bf: np.array with the point in parameter space with the best fit.
v: Unitary matrix containing the axes of the ellipse.
d: diagonal matrix containing the inverse of the squares of the semiaxes.
Lmin: Log-likelihood at the best fit point.
-
SMEFT19.ellipse.
notablepoints
(fin, fout, fit)[source]¶ Finds the extrema of the ellipse, the intersection with the coordinate axis and the closest and furthest point from the origin.
- Arguments
fin: Path to .yaml file containing the information about the ellipse.
fout: Path to .tex file to save a table with the coordinates of the notable points.
fit: Function used in the minimization.
-
SMEFT19.ellipse.
parametrize
(x, bf, v, d, nsigmas=1)[source]¶ Maps points on the unit hypersphere to points on the ellipsoid of constant likelihood.
- Arguments
x: np.array containing a point in the surface of the unit n-hypersphere.
bf: np.array with the point in parameter space with the best fit.
v: np.matrix containing the orientation of the axes of the ellipsoid.
d: np.array containing the principal axes of the ellipsoid.
[nsigmas: significance of the isoprobability hypersurface with respect to the best fit.]
- Returns
xe: Projection of the point x in the ellipsoid of equal probability
-
SMEFT19.ellipse.
save
(bf, v, d, L, filename, name=None, fit=None)[source]¶ Saves the results of the minimization in a .yaml file.
- Arguments
bf: np.array with the point in parameter space with the best fit.
v: np.matrix containing the orientation of the axes of the ellipsoid.
d: np.array containing the principal axes of the ellipsoid
filename: Path to the .yaml file where the shape of the ellipse will be saved.
L: Log-likelihood at the best fit point.
[name: Descriptive name of the fit.]
[fit: scenario used to fit the data.]