Commit 3346c249 authored by Alessandro 's avatar Alessandro

resolving merging conflicts

parent e5a74d98
......@@ -11,12 +11,7 @@ include("juobs_obs.jl")
export read_mesons, read_mesons_correction, read_ms1, read_ms, read_md, truncate_data!, concat_data!
export get_matrix, energies, uwdot, uweigvals, uweigvecs, uweigen, invert, getall_eigvals, getall_eigvecs, hess_reduce, uwcholesky, transpose, tridiag_reduction, make_positive_def, invert_covar_matrix
<<<<<<< HEAD
export corr_obs, corr_obs_TSM, corr_sym, md_sea, md_val, plat_av, lin_fit, x_lin_fit, y_lin_fit, fit_routine, global_fit_routine, bayesian_av
export meff, mpcac, dec_const, dec_const_w, dec_const_pcvc, comp_t0
=======
export corr_obs, corr_obs_TSM, corr_sym, md_sea, md_val, plat_av, lin_fit, x_lin_fit, y_lin_fit, fit_routine, global_fit_routine, bayesian_av, pvalue
export meff, mpcac, dec_const, dec_const_pcvc, comp_t0
>>>>>>> alejandro
export meff, mpcac, dec_const, dec_const_w, dec_const_pcvc, comp_t0
end # module
......@@ -217,12 +217,8 @@ function dec_const(a0p::Vector{uwreal}, pp::Vector{uwreal}, plat::Vector{Int64},
T = length(corr_a0p)
aux = exp.((collect(1:T) .- (T)/2) .* [m for k = 1:T])
else
<<<<<<< HEAD
T = length(corr_a0p)
aux = exp.((collect(1:T) .- T/2) .* [m for k = 1:T])
=======
aux = exp.((collect(0:T-1) .- (T-1)/2) .* [m for k = 1:T])
>>>>>>> alejandro
end
R = corr_a0p .* aux ./ [((corr_pp[T-y0])^2)^(1/4) for k = 1:length(corr_a0p)]
......
......@@ -684,7 +684,6 @@ function concat_data!(data1::Vector{Vector{CData}}, data2::Vector{Vector{CData}}
data1[k][r].vcfg = vcat(data1[k][r].vcfg, data2[k][r].vcfg)
data1[k][r].re_data = vcat(data1[k][r].re_data, data2[k][r].re_data)
data1[k][r].im_data = vcat(data1[k][r].im_data, data2[k][r].im_data)
<<<<<<< HEAD
idx = sortperm(data1[k][r].vcfg)
data1[k][r].vcfg = data1[k][r].vcfg[idx]
data1[k][r].re_data = data1[k][r].re_data[idx, :]
......@@ -693,9 +692,3 @@ function concat_data!(data1::Vector{Vector{CData}}, data2::Vector{Vector{CData}}
end
return nothing
end
=======
end
end
return nothing
end
>>>>>>> alejandro
#TODO: apply_rw with gaps
<<<<<<< HEAD
function apply_rw(data::Array{Float64}, W::Matrix{Float64}; vcfg::Union{Nothing, Vector{Int32}}=nothing)
function apply_rw(data::Array{Float64}, W::Matrix{Float64}, id::Union{String, Nothing}=nothing; vcfg::Union{Nothing, Vector{Int32}}=nothing)
nc = isnothing(vcfg) ? collect(1:size(data, 1)) : vcfg
W1 = W[1, nc]
W2 = W[2, nc]
=======
function apply_rw(data::Array{Float64}, W::Matrix{Float64}, id::Union{String, Nothing}=nothing)
nc = size(data, 1)
W1 = W[1, 1:nc]
W2 = W[2, 1:nc]
>>>>>>> alejandro
if id == "J303" || id == "J303r003"
W_J303 = [1 for i in 1:length(data)]
......@@ -167,11 +160,7 @@ corr_pp = corr_obs.(data)
corr_pp_r = corr_obs.(data, rw=[rw1, rw2])
```
"""
<<<<<<< HEAD
function corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, Nothing}=nothing, L::Int64=1, info::Bool=false, idm::Union{Vector{Int64},Nothing}=nothing, nms::Int64=Int64(maximum(cdata.vcfg)))
=======
function corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, Nothing}=nothing, L::Int64=1, info::Bool=false, flag_strange::Bool=false)
>>>>>>> alejandro
function corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, Nothing}=nothing, L::Int64=1, info::Bool=false, idm::Union{Vector{Int64},Nothing}=nothing, nms::Int64=Int64(maximum(cdata.vcfg)), flag_strange::Bool=false)
real ? data = cdata.re_data ./ L^3 : data = cdata.im_data ./ L^3
nt = size(data)[2]
......@@ -185,20 +174,10 @@ function corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, No
# idm = isnothing(idm) ? collect(1:nms) : idm
obs = [uwreal(data[:, x0], cdata.id, idm, nms) for x0 = 1:nt]
else
<<<<<<< HEAD
# idm = isnothing(idm) ? collect(1:nms) : idm
data_r, W = apply_rw(data, rw)
data_r, W = apply_rw(data, rw, cdata.id)
ow = [uwreal(data_r[:, x0], cdata.id, idm, nms) for x0 = 1:nt]
W_obs = uwreal(W, cdata.id, idm, nms)
=======
if flag_strange == true
data_r, W = apply_rw(data, rw, cdata.id)
else
data_r, W = apply_rw(data, rw)
end
ow = [uwreal(data_r[:, x0], cdata.id) for x0 = 1:nt]
W_obs = uwreal(W, cdata.id)
>>>>>>> alejandro
obs = [ow[x0] / W_obs for x0 = 1:nt]
end
......@@ -212,11 +191,7 @@ function corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, No
end
#function corr_obs for R != 1
#TODO: vcfg with gaps
<<<<<<< HEAD
function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array{Float64, 2}, 1}, Nothing}=nothing, L::Int64=1, info::Bool=false, idm::Union{Vector{Int64},Nothing}=nothing, nms::Union{Int64, Nothing}=nothing)
=======
function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array{Float64, 2}, 1}, Nothing}=nothing, L::Int64=1, info::Bool=false, flag_strange::Bool=false)
>>>>>>> alejandro
function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array{Float64, 2}, 1}, Nothing}=nothing, L::Int64=1, info::Bool=false, idm::Union{Vector{Int64},Nothing}=nothing, nms::Union{Int64, Nothing}=nothing, flag_strange::Bool=false)
nr = length(cdata)
id = getfield.(cdata, :id)
vcfg = getfield.(cdata, :vcfg)
......@@ -246,11 +221,8 @@ function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array
[tmp = cat(tmp, data[k], dims=1) for k = 2:nr]
obs = [uwreal(tmp[:, x0], id[1], replica, idm, nms) for x0 = 1:nt]
else
if flag_strange == true
data_r, W = apply_rw(data, rw, id[1])
else
data_r, W = apply_rw(data, rw)
end
data_r, W = apply_rw(data, rw, id[1])
tmp = data_r[1]
tmp_W = W[1]
[tmp = cat(tmp, data_r[k], dims=1) for k = 2:nr]
......@@ -1551,7 +1523,6 @@ function get_chi2_cov(f::Function, data, C, par, Nalpha) # full + cov
return chi2
end
<<<<<<< HEAD
function get_covar(obs::Vector{uwreal}; wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing)
isnothing(wpm) ? uwerr.(obs) : [uwerr(yaux, wpm) for yaux in obs]
ens = vcat(ensembles.(obs)...)
......@@ -1588,8 +1559,6 @@ function inv_covar_multi_id(obs::Vector{uwreal}; wpm::Union{Dict{Int64,Vector{Fl
return (cov_inv' + cov_inv) / 2.
end
=======
>>>>>>> alejandro
@doc raw"""
pvalue(chisq::Function,
chi2::Float64,
......@@ -1625,13 +1594,8 @@ Q = pvalue(chisq, chi2, value.(up), y, wpm; W = 1.0 ./ err.(y) .^ 2, nmc=10000)
function pvalue(chisq::Function,
chi2::Float64,
xp::Vector{Float64},
<<<<<<< HEAD
data::Vector{uwreal};
wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing} = Dict{Int64,Vector{Float64}}(),
=======
data::Vector{uwreal},
wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing} = Dict{Int64,Vector{Float64}}();
>>>>>>> alejandro
W::Union{Vector{Float64},Array{Float64,2}} = Vector{Float64}(),
nmc::Int64 = 5000)
......@@ -1662,10 +1626,7 @@ function pvalue(chisq::Function,
Ww = zeros(Float64, m)
for i in 1:m
if (data[i].err == 0.0)
<<<<<<< HEAD
#isnothing(wpm) ? wuerr(data[i]) : uwerr(data[i], wpm)
=======
>>>>>>> alejandro
uwerr(data[i], wpm)
if (data[i].err == 0.0)
error("Zero error in fit data")
......@@ -1715,9 +1676,4 @@ function pvalue(chisq::Function,
end
return Q #uwreal([Q,dQ],"")
<<<<<<< HEAD
end
=======
end
>>>>>>> alejandro
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