It executes a fit of the `ydata` with the fit function `model`.
# parameters
- `npar::Int64`: number of fit parameters.
- `wpm`: Windows parameter that ADerrors uses to computes the errors. This is used both when computing the error of the data and when computing the covariance matrix through `ADerrors.cov`
- `corr::Bool`: if `true` (default) it exectues the correlated fit, this flag is overridden if `W` is passed as a `Vector`. When `corr=true`, and `W` is not given, it computes the covarinace matrix through `ADerrors.cov`, then it is inverted and symmetrized.
- `W::VecOrMat{Float64}`: Weight matrix/vector. When given, the flag `corr` is overridden. If `W` is a `Vector` the fit is perfomed uncorrelated,otherwise is correlated.
- `wpm`: Windows parameter that ADerrors uses to computes the errors.
This is used both when computing the error of the data and when computing the covariance matrix through `ADerrors.cov`
- `corr::Bool`: if `true` (default) it exectues the correlated fit, this flag is overridden if `W` is passed as a `Vector`.
When `corr=true`, and `W` is not given, it computes the covarinace matrix through `ADerrors.cov`, then it is inverted and symmetrized.
- `W::AbstractVecOrMat{Float64}`: Weight matrix/vector. When given, the flag `corr` is overridden.
If `W` is a `Vector` the fit is perfomed uncorrelated,otherwise is correlated.
- `guess::Vector{Float64}`: Initial guess used in the fit routine.
- `logfile`: handle to a logfile. If `nothing`, no log will be written. It can be `IO` file or a custom log structure that has an overloading for `print()` and `println()`.
- `logfile`: handle to a logfile. If `nothing`, no log will be written.
It can be `IO` file or a custom log structure that has an overloading for `print()` and `println()`.
- `C::AbstractMatrix`: covariance matrix used to compute W.
If W is computed by using a different covariance matrix that what given by ADerrors, it is advised to pass it to the function
to have a better chiexp and pvalue. If W and C are not given but the fit is correlated, then C is computed using ADerrors
# Returns
It returns a NamedTuple with names:
...
...
@@ -1261,9 +1273,10 @@ function fit_routine(model::Function,