Parameter bounds and confidence intervals in LsqFit.jl?

HI all,

I’m trying to use LsqFit.jl to fit a model in the form of:

model(t, p) = @. p[1] * t^3 + p[2] * t + p[5]*sin(2*π*p[3]*t + p[4])

However, I need p[4] to be strictly between 0 and pi. Is it possible to do it?
In addition, is there a wat to calculate or plot the 95% confidence intervals of the fit?

If not, is there another recommended package that can deal with this effectively?

Thank you!

I don’t think LsqFit.jl supports bounded optimization. However in this case it would not be too hard to transform the parameters found by the optimization to the desired interval.

The Readme lists

confidence_interval = confint(fit; level=0.05, atol, rtol):
  • fit: result of curve_fit (a LsqFitResult type)
  • level: confidence level
  • atol: absolute tolerance for negativity check
  • rtol: relative tolerance for negativity check
    This returns confidence interval of each parameter at level significance level.

I think there are quite a few packages for optimization but I am not familiar with the ecosystem. Maybe someone else will make a recommendation.