Skip to content

Commit

Permalink
Update curve_fit.jl to not send big floats to beta_inc_inv (#245)
Browse files Browse the repository at this point in the history
* Update curve_fit.jl to not send big floats to beta_inc_inv

* Update src/curve_fit.jl

* Update src/curve_fit.jl
  • Loading branch information
pkofod authored Oct 3, 2023
1 parent d0aeeaa commit 393a5ad
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 @@ -299,7 +299,7 @@ function margin_error(fit::LsqFitResult, alpha=0.05; rtol::Real=NaN, atol::Real=
# rtol : relative tolerance for approximate comparisson to 0.0 in negativity check
std_errors = stderror(fit; rtol=rtol, atol=atol)
dist = TDist(dof(fit))
critical_values = quantile(dist, 1 - alpha / 2)
critical_values = eltype(coef(fit))(quantile(dist, Float64(1 - alpha / 2)))
# scale standard errors by quantile of the student-t distribution (critical values)
return std_errors * critical_values
end
Expand Down

0 comments on commit 393a5ad

Please sign in to comment.