Creating a new variable

Hi.
I am trying to create a new variable in an already existing model.
I tried writing “welfareloss = (1/2)*((outputgap)+(inflation-inflationq))” under "Definition of Modelbase Variables in Terms of Original Model Variables " and
declaring “welfareloss” under “var”.

Do you know what I might have done wrong? or have forgot to do any thing else in order to create the variable and estimate it??

Thanks!

Hi, It would be easier to answer if you provide a mod file… But are you using a mod file or a GUI?

Best,
Stéphane.

modfile dynare.txt (20.1 KB)

I have attached the modfile as a txt.-file.

and I am using the mod-file

You are missing a semicolon at the end of the line you added.

I added the semicolon. But then I get following message from MatLab:

dynare CA_BMZ12.mod

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Using 64-bit preprocessor
Starting Dynare (version 4.5.4).
Starting preprocessing of the model file …
ERROR: CA_BMZ12.mod: line 224, cols 1-8: Unknown symbol: interest
ERROR: CA_BMZ12.mod: line 225, cols 1-10: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 226, cols 1-9: Unknown symbol: inflation
ERROR: CA_BMZ12.mod: line 226, cols 19-28: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 226, cols 30-43: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 226, cols 45-58: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 226, cols 60-73: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 227, cols 1-6: Unknown symbol: output
ERROR: CA_BMZ12.mod: line 228, cols 1-9: Unknown symbol: outputgap
ERROR: CA_BMZ12.mod: line 229, cols 21-29: Unknown symbol: outputgap
ERROR: CA_BMZ12.mod: line 229, cols 33-41: Unknown symbol: inflation
ERROR: CA_BMZ12.mod: line 229, cols 43-52: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 238, cols 1-8: Unknown symbol: interest
ERROR: CA_BMZ12.mod: line 238, cols 26-37: Unknown symbol: interest
ERROR: CA_BMZ12.mod: line 239, cols 26-37: Unknown symbol: interest
ERROR: CA_BMZ12.mod: line 240, cols 26-37: Unknown symbol: interest
ERROR: CA_BMZ12.mod: line 241, cols 26-37: Unknown symbol: interest
ERROR: CA_BMZ12.mod: line 242, cols 25-34: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 243, cols 26-39: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 244, cols 26-39: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 245, cols 26-39: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 246, cols 26-39: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 247, cols 26-39: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 248, cols 26-39: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 249, cols 26-39: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 250, cols 26-39: Unknown symbol: inflationq
ERROR: CA_BMZ12.mod: line 251, cols 24-32: Unknown symbol: outputgap
ERROR: CA_BMZ12.mod: line 252, cols 26-38: Unknown symbol: outputgap
ERROR: CA_BMZ12.mod: line 253, cols 26-38: Unknown symbol: outputgap
ERROR: CA_BMZ12.mod: line 254, cols 26-38: Unknown symbol: outputgap
ERROR: CA_BMZ12.mod: line 255, cols 26-38: Unknown symbol: outputgap
ERROR: CA_BMZ12.mod: line 256, cols 26-38: Unknown symbol: outputgap
ERROR: CA_BMZ12.mod: line 257, cols 26-38: Unknown symbol: outputgap
ERROR: CA_BMZ12.mod: line 258, cols 26-38: Unknown symbol: outputgap
ERROR: CA_BMZ12.mod: line 259, cols 26-38: Unknown symbol: outputgap
ERROR: CA_BMZ12.mod: line 260, cols 25-30: Unknown symbol: output
ERROR: CA_BMZ12.mod: line 261, cols 27-36: Unknown symbol: output
ERROR: CA_BMZ12.mod: line 262, cols 27-36: Unknown symbol: output
ERROR: CA_BMZ12.mod: line 263, cols 27-36: Unknown symbol: output
ERROR: CA_BMZ12.mod: line 264, cols 27-36: Unknown symbol: output
ERROR: CA_BMZ12.mod: line 265, cols 27-36: Unknown symbol: output
ERROR: CA_BMZ12.mod: line 266, cols 27-36: Unknown symbol: output
ERROR: CA_BMZ12.mod: line 267, cols 27-36: Unknown symbol: output
ERROR: CA_BMZ12.mod: line 268, cols 27-36: Unknown symbol: output

Error using dynare (line 217)
DYNARE: preprocessing failed

Please provide the mod-file and the all other files needed to run it.

CA_BMZ12.m (53.3 KB)
CA_BMZ12.mod (20.1 KB)

CA_BMZ12_dynamic.m (48.6 KB)
CA_BMZ12_results.mat (260.2 KB)

CA_BMZ12_set_auxiliary_variables.m (476 Bytes)
CA_BMZ12_static.m (17.7 KB)

Sorry. I was only allowed to upload two files at the same time.

You are missing the policy_param.mat