I Am getting the following error with fitting with FOCEI. Kindly explain the error and give the solution how to resolve the same.
Warning: Terminated early due to NaN in gradient.
└ @ Optim /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Optim/V8ZEC/src/multivariate/optimize/optimize.jl:98
ERROR: cannot assign a value to imported variable StatsAPI.fit from module Main
The warning is not necessary a problem. The optimiser just got inte a bad place of the parameter space and often finds its way out of there just fine. The problem here is that you’re trying to overwrite the fit function with the fit result when you call fit = fit(.....). Try simply using a different name to assign the fit output to.
You cannot have a variable named fit and a function named fit in the same scope. The fit name is already taken by the StatsAPI package to define a function that is exported and available in your Main scope. So you need to avoid using this name for variables.