function lin_fit(x::Vector{<:Real},y::Vector{uwreal})
uwerr.(y)
function lin_fit(x::Vector{<:Real},y::Vector{uwreal};wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}},Nothing}=nothing)
isnothing(wpm)?uwerr.(y):uwerr.(y,wpm)
par=lin_fit(x,value.(y),err.(y))
chisq(p,d)=sum((d.-p[1].-p[2].*x).^2./err.(y).^2)
(fitp,csqexp)=fit_error(chisq,par,y)
fori=1:length(fitp)
uwerr(fitp[i])
isnothing(wpm)?uwerr(fitp[i]):uwerr(fitp[i],wpm)
print("\n Fit parameter: ",i,": ")
details(fitp[i])
end
...
...
@@ -252,14 +252,14 @@ The method return an array upar with the best fit parameters with their errors.
fit_routine(model, xdata, ydata, param=3)
"""
function fit_routine(model::Function,xdata::Array{<:Real},ydata::Array{uwreal},param::Int64=3;wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}},Nothing}=nothing)