Commit 600369da authored by Antonino D'Anna's avatar Antonino D'Anna

corrected a typo in fit_routine line: 1097

parent 293a68d5
......@@ -1113,10 +1113,10 @@ function fit_routine(model::Function, xdata::Array{<:Real}, ydata::Array{uwreal}
#covar_inv = inv(get_covariance(ydata))
#covar_inv = (covar_inv + covar_inv')/2
#covar_inv = inv(Symmetric(get_covariance(ydata)))
chisq(par, dat) = gen_chisq_correlated(model, xdata, covar_inv, par, dat)
fit = curve_fit(model, xdata, yval, covar_inv, fill(0.5, param))
chisq(par, dat) = gen_chisq_correlated(model, xdata, inv_cov, par, dat)
fit = curve_fit(model, xdata, yval, inv_cov, fill(0.5, param))
#println(chisq(coef(fit), ydata))
(upar, chi_exp) = isnothing(wpm) ? fit_error(chisq, coef(fit), ydata, W=covar_inv) : fit_error(chisq, coef(fit), ydata, wpm, W=covar_inv)
(upar, chi_exp) = isnothing(wpm) ? fit_error(chisq, coef(fit), ydata, W=inv_cov) : fit_error(chisq, coef(fit), ydata, wpm, W=inv_cov)
end
chi2_fit_res = sum(fit.resid.^2 )
# compute and print single point contribution to chi2
......@@ -1389,7 +1389,7 @@ function gen_chisq(f::Function, x::Array{<:Real}, err::Vector{Float64}) #constra
end
function gen_chisq_correlated(f::Function, x::Array{<:Real}, covar_inv::Matrix, par, dat )
chi2 = 0.0
#delta = dat - f(x, par)
#delta = dat - ffit_routine(x, par)
#chi2 = (reshape(delta, 1,:) * covar_inv * delta )[1]
for i in eachindex(dat)
for j in eachindex(dat)
......
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