This has been a recurring problem for me, so I'll have to address it here. I'm trying to build a non-linear optimization problem using optim or fsolve, and I need certain variables as fixed parameters.
So by f(a;b), I mean a function that defines b as given, and immovable for the optimization. Evidently matlab has a way to define b as just a parameter set & only allow a to be moved in the optimization; in R this doesn't seem to apply in the same way as matlab. Both optim & fsolve require that I specify the initial values of both a & b, and they calculate the results shifting b as well as a.
If anyone could let me know of a good way out of this that would be much appreciated. Thank you!