VariableArgsFitter#

class stellarphot.transit_fitting.VariableArgsFitter[source]#

Bases: LevMarLSQFitter

A callable class that can be used to fit functions with arbitrary number of positional parameters. This is a modified version of the astropy.modeling.fitting.LevMarLSQFitter fitter.

Methods Summary

__call__(model, *args[, weights, maxiter, ...])

Fit data to this model.

Methods Documentation

__call__(model, *args, weights=None, maxiter=100, acc=1e-07, epsilon=1.4901161193847656e-08, estimate_jacobian=False)[source]#

Fit data to this model.

Parameters:
modelFittableModel

model to fit to x, y, z

xarray

input coordinates

yarray

input coordinates

zarray, optional

input coordinates

weightsarray, optional

Weights for fitting. For data with Gaussian uncertainties, the weights should be 1/sigma.

Changed in version 5.3: Calculate parameter covariances while accounting for weights as “absolute” inverse uncertainties. To recover the old behavior, choose weights=None.

maxiterint

maximum number of iterations

accfloat

Relative error desired in the approximate solution

epsilonfloat

A suitable step length for the forward-difference approximation of the Jacobian (if model.fjac=None). If epsfcn is less than the machine precision, it is assumed that the relative errors in the functions are of the order of the machine precision.

estimate_jacobianbool

If False (default) and if the model has a fit_deriv method, it will be used. Otherwise the Jacobian will be estimated. If True, the Jacobian will be estimated in any case.

equivalencieslist or None, optional, keyword-only

List of additional equivalencies that are should be applied in case x, y and/or z have units. Default is None.

filter_non_finitebool, optional

Whether or not to filter data with non-finite values. Default is False

inplacebool, optional

If False (the default), a copy of the model with the fitted parameters set will be returned. If True, the returned model will be the same instance as the model passed in, and the parameter values will be changed inplace.

Returns:
fitted_modelFittableModel

If inplace is False (the default), this is a copy of the input model with parameters set by the fitter. If inplace is True, this is the same model as the input model, with parameters updated to be those set by the fitter.