Understanding mutating functions correctly

This depends on what β is — if it is an array, then β = M.Fit.β should be sufficient to make sure they are the same, except that you create new one with

β = β + Jinv * U

(In the future, please include a self-contained MWE, which should make it much easier to help you.)

2 Likes