- `vp[3]`: The autocorrelation function ``\Gamma(t)`` is summed up a point where its error ``\delta\Gamma(t)`` is a factor `vp[3]` times larger than the signal.
It computes the chi square of a fit. `model` is assumed to be of the type f(xdata,par).
If `W::Vector` the chisquare is computed for an uncorrelated fit
An additional fourth parameter `vp[4]`, tells ADerrors to add a tail to the error with ``\tau_{exp} = wpm[4]``.
If `W::Matrix` the chisquare is computed for a correlated fit
Negative values of `wpm[1:4]` are ignored and only one component of `wpm[1:3]` needs to be positive.
If the flag `covar`is set to true, `fit_routine` takes into account covariances between x and y for each data point.
function fit_routine(model::Function,xdata::Array{<:Real},ydata::Array{uwreal},param::Int64=3;info::Bool=false,wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}},Nothing}=nothing,
function get_chi(model::Function,x::Vector,par,data,W::Array{Float64,2})
- `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.
- `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()`.
function fit_routine(model::Vector{Function},xdata::Vector{Array{Float64,N}}whereN,ydata::Vector{Array{uwreal,N}}whereN,param::Int64;wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}},Nothing}=nothing,
function fit_routine(model::Vector{Function},xdata::Vector{Array{Float64,N}}whereN,ydata::Vector{Array{uwreal,N}}whereN,param::Int64;wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}},Nothing}=nothing,