Ramsey Optimal Policy Problem

Dear Prof. Pfeifer,

I am trying to estimate a Ramsey and i keep running into the error “Unable to perform assignment because the left and right sides have a different number of elements”. The model works fine with stoch_simul, but when i try the Ramsey policy it doesn’t. I have attached the steady state m file, the recursive solver file (I use fsolve) and and the _steadystate file.

Regards M.O
RamseyOPT.m (10.6 KB)
Ramsey.mod (19.1 KB)
Ramsey_ss.m (5.8 KB)

I have trouble running your code. You are calling Ramsey.m in the steady state file. But that is the name of the mod-file which is not allowed and there is no other file with that name.

Sorry, I forgot to change it. I have uploaded the corrected version of my steady state file Ramsey_steadystate.m (5.0 KB)

You have parameters like R_ss in your steady state file that are empty matrices. In the loop at the end, you are trying to assign those empty arrays to an entry in the vector. That cannot work.

I will look into this. Thank you