From c446f101ee755a308d7e993434a1fb4331838b6c Mon Sep 17 00:00:00 2001 From: Patrick Kofod Mogensen Date: Tue, 3 Oct 2023 12:27:51 +0200 Subject: [PATCH] Update src/curve_fit.jl --- src/curve_fit.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/curve_fit.jl b/src/curve_fit.jl index c6b934f..c4a6155 100755 --- a/src/curve_fit.jl +++ b/src/curve_fit.jl @@ -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