Is it possible to loop from a .m to give different inputs to the estimation function?
I am using the estimation function for forecasting, and I would like to know if it is possible to loop over the inputs for ‘datafile’ and ‘nobs’ since for each point of the forecast I want to give it a different data set for the forecast.
Hi Stepan, thanks for replying, I was reviewing the manual and I understand that it receives integers. My need is to assign that value outside Dynare. I tried it with a macroprocessor and it works for the database but not for the input nobs:
The error message is not surprising… It means you are trying to pass a string value to the nobs option ("spag") which is not allowed. I really don’t understand why you try to use the macro processor here… You can directly pass a range of integers to the nobs option. Except if you want to change the database for each value of nobs (if you need to work with a real time dataset). Is this what you want?
Also, you cannot pass the value of a macro variable as you do when calling dynare. It should be something like: