Skip to content

Commit

Permalink
fix: correct variance calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
fjebaker committed May 8, 2024
1 parent b38142d commit 14efcdd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions src/datasets/spectrum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ end

function make_objective_variance(::ContiguouslyBinned, dataset::Spectrum)
check_units_warning(dataset.units)
if dataset.error_statistics == ErrorStatistics.Poisson
@. dataset.errors .^ 2
else
dataset.errors
end
dataset.errors .^ 2
end

function make_model_domain(::ContiguouslyBinned, dataset::Spectrum)
Expand Down
6 changes: 1 addition & 5 deletions src/plotting-recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ end
make_objective(data_layout, dataset),
make_objective_variance(data_layout, dataset),
)
_yerr = if error_statistic(dataset) == ErrorStatistics.Poisson
sqrt.(rateerror)
else
rateerror
end
_yerr = sqrt.(rateerror)
yerr --> _yerr
xerr --> bin_widths(dataset) ./ 2
markerstrokecolor --> :auto
Expand Down

0 comments on commit 14efcdd

Please sign in to comment.