Dynare olg code error

dynare olg2
Starting Dynare (version 5.2).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
ERROR: olg2.mod: line 43, cols 1-10: C_y is not a parameter

olg2.mod: line 43, cols 1-10 is the beginning of my initial value setting.Is there a problem with my initial value setting?

Please upload your mod-file.

I have uploaded it, please check it, thank you

Could you please upload the file and not just the text. Crucial information gets lost otherwise. You can see that there are all the multiplications missing, which makes it unable to work with.

olg2.MOD (1.1 KB)

Thank you :slight_smile: So one issue is that the section including the initial values is called initval; and not how you called it initival;.
When you change this Dynare know to used the given initial values. There is another mistake in that you set y=Ak^alpha;. It does not really work like this but anyway should be y=A*k^alpha;. The reason it does not work like this is that A and k are not defined yet as initial values and thus, Dynare assumes zero for them. You should recheck your steady state computation, maybe you can derive it analytically.

Thank you for your patient response. Do you mean that I need to manually calculate the steady-state value and then assign the steady-state value to the initial value? I am a beginner,I only know a little.

Yes, exactly. You cannot just set random variables, the steady state of a model is a crucial aspect.
I suggest you have a look at the amazing resources posted by Willi Mutschler from the Dynare team on Youtube, where he explains how to calculate a steady state and ways to implement it in Dynare.

https://www.youtube.com/playlist?list=PLiN_C6lGtCc8bhPOuE781GTgeOqtMA5Bi

ok,thank you so much :grinning: