'Fit data to this model.
Parameters
model : `~astropy.modeling.FittableModel`
model to fit to x, y, z
x : array
input coordinates
y : array
input coordinates
z : array (optional)
input coordinates
weights : array (optional)
weights
kwargs : dict
optional keyword arguments to be passed to the optimizer or the statistic
verblevel : int
0-silent
1-print summary upon completion,
2-print summary after each iteration
maxiter : int
maximum number of iterations
epsilon : float
the step size for finite-difference derivative estimates
acc : float
Requested accuracy
Returns
model_copy : `~astropy.modeling.FittableModel`
a copy of the input model with parameters set by the fitter'

@fitter_unit_support
def __call__(self, model, x, y, z=None, weights=None, **kwargs):

    model_copy = _validate_model(model, self._opt_method.supported_constraints)
    farg = _convert_input(x, y, z)
    farg = ((model_copy, weights) + farg)
    (p0, _) = _model_to_fit_params(model_copy)
    (fitparams, self.fit_info) = self._opt_method(self.objective_function, p0, farg, **kwargs)
    _fitter_to_model_params(model_copy, fitparams)
    return model_copy
