Skip to content

Commit

Permalink
Update src/curve_fit.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
pkofod authored Oct 3, 2023
1 parent 6ceb70b commit c446f10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/curve_fit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ function margin_error(fit::LsqFitResult, alpha=0.05; rtol::Real=NaN, atol::Real=
# atol : absolute tolerance for approximate comparisson to 0.0 in negativity check
# rtol : relative tolerance for approximate comparisson to 0.0 in negativity check
std_errors = stderror(fit; rtol=rtol, atol=atol)
dist = TDist(Floatdof(fit))
dist = TDist(dof(fit))
critical_values = eltype(coef(ft))(quantile(dist, Float64(1 - alpha / 2)))
# scale standard errors by quantile of the student-t distribution (critical values)
return std_errors * critical_values
Expand Down

0 comments on commit c446f10

Please sign in to comment.