Commit 9c41ec2e authored by Alberto Ramos's avatar Alberto Ramos

Bug corrected in multiple dispatch for chiexp

parent bcc8dafb
using ADerrors
# Input of uwreal's
a = uwreal(rand(1000), 1)
b = uwreal([1.0, 0.1], 2)
a = uwreal(rand(1000), "White noise")
b = uwreal([1.0, 0.1], "Var with error")
p = cobs([1.0, 2.0], [1.0 0.1;
0.1 2.0], [3, 4])
0.1 2.0], "Parameters")
# Most common operations.
# You might add something else if
......@@ -58,7 +58,7 @@ y = [0.0802273592699947
-0.05174734852593241
0.1384913891139784
-0.05211234898997283]
dt = cobs(y, sig, [100+n for n in 1:npt])
dt = cobs(y, sig, "Fit data")
chisq(p, d) = sum( (d .- p[1]) .^ 2 ./ dx .^2 )
xp = [sum(value.(dt) ./ dx)/sum(1.0 ./ dx)]
(fitp, csqexp) = fit_error(chisq, xp, dt)
......
......@@ -204,13 +204,13 @@ chiexp(chisq::Function,
xp::Vector{Float64},
data::Vector{uwreal};
W::Vector{Float64} = Vector{Float64}()) =
chiexp(chisq, xp, data, Dict{Int64,Vector{Float64}}(), W)
chiexp(chisq, xp, data, Dict{Int64,Vector{Float64}}(), W=W)
chiexp(chisq::Function,
xp::Vector{Float64},
data::Vector{uwreal},
wpm::Dict{String,Vector{Float64}};
W::Vector{Float64} = Vector{Float64}()) =
chiexp(chisq, xp, data, dict_names_to_id(wpm), W)
chiexp(chisq, xp, data, dict_names_to_id(wpm), W=W)
......
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