Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Cornelius-G committed Nov 3, 2023
1 parent 1eb4b99 commit b3991c9
Show file tree
Hide file tree
Showing 8 changed files with 22,633 additions and 21,506 deletions.
22 changes: 22 additions & 0 deletions docs/src/advanced_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@ Pages = ["advanced_tutorial.md"]
Depth = 3
```

## Model uncertainties
The predictions for the observables can be affected by uncertainties that
dependend on the current value of the model parameters. Such uncertainties can be included
in the analysis by letting the observable functions return a tuple of numbers, where
the first number is the prediction and the second number is the absolute uncertainty on that prediction.

````julia
function xsec1(params)
coeffs = [20.12, 5.56, 325.556]
prediction = myfunc(params, coeffs)
uncertainty = 0.1 * prediction # assume a 10% uncertainty
return (prediction, uncertainty)
end
````

Note: It is possible to specify a model uncertainty only for some of the observables.
When the observable functions returns a single number, EFTfitter.jl will assume that the
model uncertainty is zero for this observable. However, please note that as soon as one observable function
returns a tuple, the runtime of the model will probably increase, as the model uncertainties then need to be evaluate in each step.
Therefore, model uncertainties should only be used when the uncertainty value is depending on the
model parameters. Constant uncertainties should just be specified in the `uncertainties` field of the measurements.

## Vector of functions for a BinnedMeasurement
When using binned measurements, a vector of functions giving the predictions
for the observable needs to be passed. It contains a function for each of bin and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,28 @@
#!md return c[1] * params.C1 + c[2] * params.C1 * params.C2+ c[3] * params.C2
#!md end


#md # ## Model uncertainties
#~The predictions for the observables can be affected by uncertainties that
#~dependend on the current value of the model parameters. Such uncertainties can be included
#~in the analysis by letting the observable functions return a tuple of numbers, where
#~the first number is the prediction and the second number is the absolute uncertainty on that prediction.
function xsec1(params)
coeffs = [20.12, 5.56, 325.556]
prediction = myfunc(params, coeffs)
uncertainty = 0.1 * prediction # assume a 10% uncertainty
return (prediction, uncertainty)
end

#~Note: It is possible to specify a model uncertainty only for some of the observables.
#~When the observable functions returns a single number, EFTfitter.jl will assume that the
#~model uncertainty is zero for this observable. However, please note that as soon as one observable function
#~returns a tuple, the runtime of the model will probably increase, as the model uncertainties then need to be evaluate in each step.
#~Therefore, model uncertainties should only be used when the uncertainty value is depending on the
#~model parameters. Constant uncertainties should just be specified in the `uncertainties` field of the measurements.



#-
#md # ## Vector of functions for a BinnedMeasurement
#~When using binned measurements, a vector of functions giving the predictions
Expand Down
19 changes: 19 additions & 0 deletions examples/advanced_tutorial/advanced_inputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@ function myfunc(params, c)
return c[1] * params.C1 + c[2] * params.C1 * params.C2+ c[3] * params.C2
end


# The predictions for the observables can be affected by uncertainties that
# dependend on the current value of the model parameters. Such uncertainties can be included
# in the analysis by letting the observable functions return a tuple of numbers, where
# the first number is the prediction and the second number is the absolute uncertainty on that prediction.
function xsec1(params)
coeffs = [20.12, 5.56, 325.556]
prediction = myfunc(params, coeffs)
uncertainty = 0.1 * prediction # assume a 10% uncertainty
return (prediction, uncertainty)
end

# Note: It is possible to specify a model uncertainty only for some of the observables.
# When the observable functions returns a single number, EFTfitter.jl will assume that the
# model uncertainty is zero for this observable. However, please note that as soon as one observable function
# returns a tuple, the runtime of the model will probably increase, as the model uncertainties then need to be evaluate in each step.
# Therefore, model uncertainties should only be used when the uncertainty value is depending on the
# model parameters. Constant uncertainties should just be specified in the `uncertainties` field of the measurements.

# When using binned measurements, a vector of functions giving the predictions
# for the observable needs to be passed. It contains a function for each of bin and
# has only the model parameters as its argument. Defining a separate function for each
Expand Down
39,002 changes: 19,997 additions & 19,005 deletions examples/notebooks/AdvancedTutorial.ipynb

Large diffs are not rendered by default.

208 changes: 104 additions & 104 deletions examples/notebooks/BLUE.ipynb

Large diffs are not rendered by default.

157 changes: 79 additions & 78 deletions examples/notebooks/EmptyTemplate.ipynb

Large diffs are not rendered by default.

4,705 changes: 2,388 additions & 2,317 deletions examples/notebooks/Tutorial.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/plotting/plot_intervals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function get_parameter_names(samples::DensitySampleVector)
return parameter_names
end


#TODO: move to BAT.jl (type piracy)
@recipe function f(
maybe_shaped_samples::DensitySampleVector,
p::Float64;
Expand Down Expand Up @@ -37,7 +37,7 @@ end
seriestype --> :path
markerstrokealpha := 0
linewidth --> 1e-20
markerstrokewidth --> 1
markerstrokewidth --> 3
markersize --> 5
markerstrokecolor --> :steelblue
linecolor := internal_color
Expand Down

0 comments on commit b3991c9

Please sign in to comment.