Dear Authors and Developers,
We have been using Stan (MATLAB interface) for training our models. We find it very easy to write and optimize the log posterior.
However, We find the ‘iter’ parameter unconfigurable for the optimizers (BFGS and L-BFGS) and is always set to a default 2000. Is there something we can do to increase over this default value, as we would really like more iterations for convergence in our recent applications.
I am trying to change the number of iterations here to 5000:
op = stan(‘file’, ‘FLDCRF_opportunity3.stan’, ‘method’, ‘optimize’, ‘data’, dat, ‘algorithm’, ‘bfgs’, ‘iter’, 5000, ‘verbose’,true);
But, it looks like this parameter ‘iter’ is only valid for sampling, and the BFGS optimization stops after 2000 iterations by default, whether or not an optima. I tried editing the ‘stan.m’ file as well as below:
"
p = inputParser;
p.KeepUnmatched= true;
p.FunctionName = ‘stan’;
p.addParamValue(‘fit’,[],@(x) isa(x,‘StanFit’) || isa(x,‘StanModel’));
p.addParamValue(‘method’,‘optimize’);
p.addParamValue(‘iter’, 5000,@(x) isscalar(x) && (x>0));
p.addParamValue(‘warmup’,[],@(x) isscalar(x) && (x>0));
p.addParamValue(‘refresh’,[],@(x) isscalar(x) && (x>0));
p.addParamValue(‘algorithm’,’’);
"
with the same result. Is it possible to run more than 2000 iterations?
Looking forward to your response.
Thanks and Regards,
Satyajit