I made a simple cosine fit to some data:
NonlinearModelFit[
Data[[1;;]] /. a_Around :> a["Value"],
{
A Cos[ω x + ϕ] + c,
{-π <= ϕ <= +π}
},
{{A, -0.0017}, {ω, 400}, {c, 0.01}, {ϕ}}, x,
VarianceEstimatorFunction->(1&),
Weights -> (1/(Data[[1;;,2]] /. a_Around :> a["Uncertainty"])^2),
ConfidenceLevel->0.95, MaxIterations->10000
];
I can provide the data if necessary. The fit seems to converge successfully and the plotted result makes sense, along with the resultant fit parameters. However I do get the error message/warning:
NonlinearModelFit::acceptlev: Solved to acceptable level.
Firstly, what does this mean? How can I remove this (improve my fitting routine)? Does it have any impact on the actual results on the fit.
I have one suspicion that it is because the fit is converging near a fit constraint boundary.
I'm using Mathematica 12, so possibly why some users haven't seen this error message before and also why I couldn't find any results when I searched the error message.
The data:
{{33322.984, Around[0.007816405492811665, 0.00027463653231123993]},
{33322.988, Around[0.010073344779686584, 0.0007117756195902295]},
{33322.991, Around[0.010108725016292291, 0.0009945416303385364]},
{33322.992, Around[0.008967820799845302, 0.0013022059402730695]},
{33322.994, Around[0.00802865952165009, 0.0012786303668924815]},
{33322.997, Around[0.0068887219740959, 0.0007474404408052571]},
{33323., Around[0.008130289312875589, 0.00022863757915000962]},
{33323.003, Around[0.009914276423570985, 0.00030355873713380484]},
{33323.006, Around[0.010214891502463226, 0.001117808525551174]},
{33323.008, Around[0.009013144046862024, 0.0011652145970101099]},
{33323.009, Around[0.008126883089375795, 0.0013667571907391915]},
{33323.012, Around[0.0068149354267696815, 0.0009386542257803183]},
{33323.016, Around[0.008337596520600767, 0.00020742323701885597]}}
NonlinearModelFit
(IPOPT) - the message is described here as "This indicates that the algorithm did not converge to the ''desired'' tolerances, but that it was able to obtain a point satisfying the ''acceptable'' tolerance level as specified by acceptable-* options. This may happen if the desired tolerances are too small for the current problem.". (Note that I didn't look into whether Mathematica sets the relevant options explicitly, or whether they are left at their default) $\endgroup$