pint.fitter.ModelState

class pint.fitter.ModelState(fitter, model)[source]

Bases: object

Record a model state and cache calculations

This class keeps track of a particular model state and all the associated matrices - design matrices, singular value decompositions, what have you - that are needed to compute a step and evaluate the quality of the fit.

These objects should be regarded as immutable but lazily evaluated.

Methods

predicted_chi2(step, lambda_)

Predict the chi2 after taking a step based on the linear approximation

take_step(step, lambda_)

Return a new state moved by lambda_*step.

take_step_model(step[, lambda_])

Make a new model reflecting the new parameters.

Attributes

chi2

covariance_matrix

parameter_covariance_matrix

resids

step

predicted_chi2(step, lambda_)[source]

Predict the chi2 after taking a step based on the linear approximation

take_step_model(step, lambda_=1)[source]

Make a new model reflecting the new parameters.

take_step(step, lambda_)[source]

Return a new state moved by lambda_*step.