Commit 9b8e1a3d authored by Alessandro 's avatar Alessandro

print residue contribution for each ensemble in fit_routine

parent 7d0ff853
......@@ -387,6 +387,7 @@ function fit_routine(model::Function, xdata::Array{<:Real}, ydata::Array{uwreal}
yval = value.(ydata)
yer = err.(ydata)
if !correlated_fit
chisq = gen_chisq(model, xdata, yer)
fit = curve_fit(model, xdata, yval, 1.0 ./ yer.^2, fill(0.5, param))
......@@ -401,6 +402,12 @@ function fit_routine(model::Function, xdata::Array{<:Real}, ydata::Array{uwreal}
end
chi2_fit_res = sum(fit.resid.^2 )
println("\n")
for i in 1:length(fit.resid)
println((fit.resid[i])^2)
end
println("\n")
println("chi2 from fit residual = ", chi2_fit_res)
println("chi2 from chi2 function = ", chisq(coef(fit), ydata))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment