edges_cal.modelling.ModelFit
- class edges_cal.modelling.ModelFit(model: FixedLinearModel, ydata: ndarray, weights: ndarray | float = 1.0)[source]
A class representing a fit of model to data.
- Parameters:
model (edges_cal.modelling.FixedLinearModel) – The evaluatable model to fit to the data.
ydata (numpy.ndarray) – The values of the measured data.
weights (numpy.ndarray | float) – The weight of the measured data at each point. This corresponds to the variance of the measurement (not the standard deviation). This is appropriate if the weights represent the number of measurements going into each piece of data.
- Raises:
ValueError – If model_type is not str, or a subclass of
Model
.
Methods
__init__
(model, ydata[, weights])Method generated by attrs for class ModelFit.
evaluate
([x])Evaluate the best-fit model.
get_sample
([size])Generate a random sample from the posterior distribution.
The weighted chi^2 divided by the degrees of freedom.
The weighted root-mean-square of the residuals.
Attributes
The number of degrees of freedom of the fit.
A model that has parameters set based on the best fit to this data.
The Hessian matrix of the linear parameters.
The best-fit model parameters.
The Covariance matrix of the parameters.
Residuals of data to model.
The chi^2 of the weighted fit.