starred.optim package
Submodules
starred.optim.inference_base module
- class starred.optim.inference_base.FisherCovariance(parameter_class, differentiable_class, diagonal_only=False)[source]
Bases:
object- Parameters:
diagonal_only – bool, if you are confident your parameters are not correlated: you can save space by calculating the diagonal of the hessian only.
- compute_fisher_information(recompute=False)[source]
- Parameters:
recompute – bool, redo? default False
- property covariance_matrix
- draw_samples(num_samples=10000, seed=None)[source]
Draw samples from the multivariate Gaussian distribution defined by the best fit values and the covariance
- Parameters:
num_samples – int, number of samples to draw
seed – int, seed for the random number generator
- Returns:
array of shape (num_samples, num_parameters)
- property fisher_matrix
- class starred.optim.inference_base.InferenceBase(loss_class, param_class)[source]
Bases:
objectClass that defines wraps the loss function, and computes first and second order derivatives.
- Parameters:
loss_class – Loss instance
param_class – Parameters instance
- log_likelihood(args)[source]
Log Likelihood function to be maximised. :param args: list or array of paramers
- property parameters
Returns the parameters.
starred.optim.optimization module
- class starred.optim.optimization.Optimizer(loss_class, param_class, method='BFGS')[source]
Bases:
InferenceBaseClass that handles optimization tasks, i.e., finding best-fit point estimates of parameters It currently handles a subset of scipy.optimize.minimize routines, using first and second order derivatives when required.
- property loss_history
Returns the loss history.
- minimize(restart_from_init=True, **kwargs_optimiser)[source]
Minimizes the loss function and returns the best fit.
- property param_history
Returns the parameter history.
starred.optim.sampling module
- class starred.optim.sampling.Sampler(loss_class, param_class, sampler='emcee')[source]
Bases:
InferenceBase
Module contents
This subpackage contains optimization and sampling functions