Commit 82d18ddd authored by Antonino's avatar Antonino

Vect->AbstractVec in fit_routine and pvalue

parent aff8cc93
...@@ -1312,7 +1312,7 @@ function fit_routine(model::Function, ...@@ -1312,7 +1312,7 @@ function fit_routine(model::Function,
[uwerr(y, wpm) for y in ydata] [uwerr(y, wpm) for y in ydata]
if length(W) ==0 if length(W) ==0
if corr if corr
C = length(C) ==0 ? ADerrors.cov(ydata,wpm) : C C = length(C) ==0 ? GammaMethod.cov_AD(ydata,wpm) : C
W = LinearAlgebra.pinv(C); W = LinearAlgebra.pinv(C);
W = (W'+W)*0.5 W = (W'+W)*0.5
else else
...@@ -1566,9 +1566,9 @@ Q = pvalue(chisq, chi2, value.(up), y, wpm; W = 1.0 ./ err.(y) .^ 2, nmc=10000) ...@@ -1566,9 +1566,9 @@ Q = pvalue(chisq, chi2, value.(up), y, wpm; W = 1.0 ./ err.(y) .^ 2, nmc=10000)
""" """
function pvalue(chisq::Function, function pvalue(chisq::Function,
chi2::Float64, chi2::Float64,
xp::Vector{Float64}, xp::AbstractVector{Float64},
data::Vector{uwreal}, data::AbstractVector{uwreal},
W::Vector{Float64}=Vector{Float64}(); W::AbstractVector{Float64}=Vector{Float64}();
wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing} = Dict{Int64,Vector{Float64}}(), wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing} = Dict{Int64,Vector{Float64}}(),
nmc::Int64 = 5000, nmc::Int64 = 5000,
C::AbstractMatrix{Float64} = ADerrors.cov(data,wpm)) C::AbstractMatrix{Float64} = ADerrors.cov(data,wpm))
...@@ -1644,9 +1644,9 @@ end ...@@ -1644,9 +1644,9 @@ end
function pvalue(chisq::Function, function pvalue(chisq::Function,
chi2::Float64, chi2::Float64,
xp::Vector{Float64}, xp::AbstractVector{Float64},
data::Vector{uwreal}, data::AbstractVector{uwreal},
W::Array{Float64,2}; W::AbstractArray{Float64,2};
wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing} = Dict{Int64,Vector{Float64}}(), wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing} = Dict{Int64,Vector{Float64}}(),
nmc::Int64 = 5000, nmc::Int64 = 5000,
C::AbstractMatrix{Float64} = ADerrors.cov(data,wpm)) C::AbstractMatrix{Float64} = ADerrors.cov(data,wpm))
......
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