WIP: bugfixes for GST with penalties in objective functions #528
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@coreyostrove reported bugs in fitting GST models where the objective function contains penalty terms. Quoting from an email:
Running a notebook that Corey sent me, I got the following error. The stacktrace isn't shown, but the error indeed happens when adding penalty terms to the Jacobian, inside simplerlm.py::simplish_leastsq and/or customlm.py::custom_lstsq.

I was able to correct the error above by adding input handling to vec_to_stdmx, casting non-numpy objects to ndarrays. (Currently the only change in this PR.) Of course, we really need to find the functions that are calling vec_to_stdmx with this invalid input. The full extent of such functions is unknown (to me) at time of opening this PR. It at least includes
objectivefns.py::_spam_penalty_jac_fill
.Opening this PR at @coreyostrove's request. CC: @pcwysoc.