One thing you can do is log-transform and use the exp or square of that parameter in the cost function (so square it before putting it into the problem). That will work for any optimizer. Or you can use the Fminbox stuff from Optim to do box-constrained BFGS.
1 Like