Computes bayesian average of data. For a given fit function, it explores choices of fit intervals, assigning each a weight. Then it does the weighted average and assigns a systematic. See https://arxiv.org/abs/2008.01069
The function takes as input the fit intervals to explore.
`tmin_array` is an array of integers with the lower bounds on the fit intervals to explore, ***ordered from lower to higher***.
`tmax_array` is an array of integers with the upper bounds on the fit intervals to explore, ***ordered from lower to higher***.
`k` is the number of parameters of the fit function to use.
You can also use as input two fit functions, and two values of `k`, one for each function.
You can also use as input two fit functions, and two values of `k`, one for each function. Then, for each fit interval choice, the function explores the two fit functions. This means that for each fit interval choice you get two results: one for the first fit funcction, and another for the second.
The method returns two objects: first, the weighted average as an uwreal object, with mean value and statistichal error. The second object returned is the systematic error coming from the fit interval variation.
```@example
...
...
@@ -324,7 +330,7 @@ The method returns two objects: first, the weighted average as an uwreal object,
function bayesian_av(fun::Function,y::Array{uwreal},tmin_array::Array{Int64},tmax_array::Array{Int64},k::Int64;wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}},Nothing}=nothing)
function bayesian_av(fun::Function,y::Array{uwreal},tmin_array::Array{Int64},tmax_array::Array{Int64},k::Int64,pl::Bool=false;wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}},Nothing}=nothing)
weight_model=Array{Float64,1}()
AIC=Array{Float64,1}()
...
...
@@ -381,11 +387,27 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
function bayesian_av(fun1::Function,fun2::Function,y::Array{uwreal},tmin_array::Array{Int64},tmax_array::Array{Int64},k1::Int64,k2::Int64;wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}},Nothing}=nothing)
function bayesian_av(fun1::Function,fun2::Function,y::Array{uwreal},tmin_array::Array{Int64},tmax_array::Array{Int64},k1::Int64,k2::Int64,pl::Bool=false;wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}},Nothing}=nothing)
weight_model=Array{Float64,1}()
AIC=Array{Float64,1}()
...
...
@@ -440,7 +462,23 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra