dynare issueshttps://git.dynare.org/Dynare/dynare/-/issues2019-06-19T15:38:16Zhttps://git.dynare.org/Dynare/dynare/-/issues/496Add plot function for dynSeries objects.2019-06-19T15:38:16ZStéphane Adjemianstepan@adjemian.euAdd plot function for dynSeries objects.4.4https://git.dynare.org/Dynare/dynare/-/issues/495Remove dynDate class2019-06-19T15:38:16ZStéphane Adjemianstepan@adjemian.euRemove dynDate classWe do not really need to have both `dynDate` and `dynDates` classes. Need to import some of the methods of `dynDate` class into `dynDates` class.
We do not really need to have both `dynDate` and `dynDates` classes. Need to import some of the methods of `dynDate` class into `dynDates` class.
4.4Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/494Check correctness of set_parameters used in dynare_estimation_12019-06-19T15:38:16ZJohannes PfeiferCheck correctness of set_parameters used in dynare_estimation_11. `dynare_estimation_1` contains the lines
```
if ~isempty(estim_params_)
set_parameters(xparam1);
end
```
I was wondering why not `set_all_parameters` is used, which also sets the measurement error. `set_parameters` may have its...1. `dynare_estimation_1` contains the lines
```
if ~isempty(estim_params_)
set_parameters(xparam1);
end
```
I was wondering why not `set_all_parameters` is used, which also sets the measurement error. `set_parameters` may have its justification here, but I don't see why.
2. `set_parameters` sets `M_.Sigma_e`, but in contrast to `set_all_parameters` it does not use the correlation information from calibration stored in `M_.Correlation_matrix` and `M_.Correlation_matrix_ME`. This strikes me as wrong and the file thus as buggy.
This relates also to #392
4.4https://git.dynare.org/Dynare/dynare/-/issues/493bug in @dynSeries/subsasgn.m2019-06-19T15:38:16ZMichelJuillardbug in @dynSeries/subsasgn.mUpdating a subsample of a time series results in duplication of the variables:
Example:
z = dynSeries((1:5)',dynDate('1990Q1'),'Z');
d = dynDate('1990Q2'):dynDate('1990Q4');
z(d) = z(d) + 10
This is obviously related to merge_dynSeries...Updating a subsample of a time series results in duplication of the variables:
Example:
z = dynSeries((1:5)',dynDate('1990Q1'),'Z');
d = dynDate('1990Q2'):dynDate('1990Q4');
z(d) = z(d) + 10
This is obviously related to merge_dynSeries_objects = 1; at the beginning of subsasgn.m that triggers merge() at the end of the function and which shouldn't happen in this case. I'm not sure how to fix it without breaking something else.
4.4Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/491Filter out singularity issues in sim12019-02-08T08:31:00ZJohannes PfeiferFilter out singularity issues in sim1Consider the following mod-file
```
% Basic RBC Model
% Linearization in level
%
%
%----------------------------------------------------------------
% 0. Housekeeping (close all graphic windows)
%--------------------------------------...Consider the following mod-file
```
% Basic RBC Model
% Linearization in level
%
%
%----------------------------------------------------------------
% 0. Housekeeping (close all graphic windows)
%----------------------------------------------------------------
close all;
%----------------------------------------------------------------
% 1. Defining variables & parameters;Calibration
%----------------------------------------------------------------
var ly lc lk li lh lw r lg theta;
varexo e_theta e_g;
parameters beta alpha gamma delta rho_theta rho_g;
beta = 0.99;
alpha = 0.3;
gamma = 0.5;
delta = 0.025;
rho_theta = 0.95;
rho_g = 0.9;
%----------------------------------------------------------------
% 2. Model
%----------------------------------------------------------------
model;
%Production Function
ly=theta+alpha*lk(-1)+(1-alpha)*lh;
%Consumption Euler equation
1=beta*exp(r(+1)+lc-lc(+1));
%Leisure-Consumption Tradeoff
lw-lc=(-gamma)*lh;
%Capital Accumulation
exp(lk-lk(-1)) =1-delta+exp(li-lk(-1));
%Resource constraint
exp(lc-ly)+exp(li-ly)+exp(lg-ly)=1;
%Real Wage
exp(lw)=(1-alpha)*exp(ly-lh) ;
%Return to Capital
exp(r)=alpha*exp(ly-lk(-1))+1-delta;
%Technology Shock
theta=rho_theta*theta(-1)+e_theta;
%Government Spending Shock
lg=rho_g*lg(-1)+e_g;
end;
%----------------------------------------------------------------
% 3. Initial Values & Shocks
%----------------------------------------------------------------
initval;
ly = -1.4653;
lc = -1.4758;
lk = -2.3207;
li = -6.0099;
lh = -1.0986;
lw = -0.7234;
r = 0.0101;
lg = 0;
theta = 0;
end;
steady;
check;
shocks;
var e_theta; periods 1:10;
values 0.01;
end;
%----------------------------------------------------------------
% 4. Computations
%----------------------------------------------------------------
simul(periods=200);
```
It contains a fatal mistake: the parameter `gamma` must be negative, otherwise the BK-conditions are not satisfied. Running `sim1` results in matrix singularity with almost all residuals being `NaN`. But the check for
`err = max(abs(res));`
is insensitive to NaNs. Thus, although the dynamics cannot be correctly computed, it nevertheless says that convergence is obtained. We should filter out such cases. However, I am not sure how to do this. Can there be cases where residuals with NaN appear but the estimation still converges? In this case, we should check at the end of sim1 if the solution contains NaNs and adapt the exit message. Or should we simply attach a penalty to NaN residuals?
4.4https://git.dynare.org/Dynare/dynare/-/issues/488dynDate substitution.2019-06-19T15:38:16ZStéphane Adjemianstepan@adjemian.eudynDate substitution.Users should not use dynDate or dynDates objects in a mod file (at least for basic usage: extraction of sub-samples or observations). For instance, one should be able to define a range as follows:
```
r = 1990Q1:2012Q3 ;
```
in the mod...Users should not use dynDate or dynDates objects in a mod file (at least for basic usage: extraction of sub-samples or observations). For instance, one should be able to define a range as follows:
```
r = 1990Q1:2012Q3 ;
```
in the mod file, and use `r` to define a subsample from a dynSeries object. Obviously, such a statement, interpreted as a matlab command by the preprocessor, would produce an error message in matlab. We need to convert occurences of dates by explicit calls to the dynDate constructor. For instance the previous statement should be replaced by
```
r = dynDate('1990Q1'):dynDate('2012Q3') ;
```
It is easy to find all the dates in a mod file a using regular expression of the form
```
[1-9][0-9]+([YyAa]|[Qq][1-4]|[Mm]([1-9]|[1][1-2])|[Ww]([1-9]|[1-4][0-9]|[5][1-2]))
```
The tricky part is that we do not want to replace all the occurences of dates: we do not want to replace dates written in dynare commands (`set_time` and `data`), in commented lines or blocks, in strings.
The matlab routine available [here](https://gist.github.com/stepan-a/6780885) does these substitutions (there is also an example [here](https://gist.github.com/stepan-a/6781075)). It would be faster and more elegant if the translation was done in the preprocessor (after the macroprocessing because dates can be defined using the macro language).
4.4Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/487Onlymacro preprocessor option seems to be broken2019-06-19T15:38:16ZJohannes PfeiferOnlymacro preprocessor option seems to be brokenSee http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5030
See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5030
4.4Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/480Discuss and potentially change use of aK from DsgeSmoother2019-02-08T08:31:00ZJohannes PfeiferDiscuss and potentially change use of aK from DsgeSmootherThe smoothed forecasts (filtered_K_step_ahead variables) are written into a matrix aK with size `[max(options_.filter_step_ahead) nvars nobs+max(options_.filter_step_ahead)]`
That is, instead of writing the 1:K step ahead prediction erro...The smoothed forecasts (filtered_K_step_ahead variables) are written into a matrix aK with size `[max(options_.filter_step_ahead) nvars nobs+max(options_.filter_step_ahead)]`
That is, instead of writing the 1:K step ahead prediction error made for time 1 into `aK(1,:,1)` we have a triangular structure where they are in `aK(1:K,:,1) to aK(1+K,:,1+K)`
While changing the arrangement in aK seems too much trouble, we might want to change the way aK is written into `oo_.FilteredVariablesKStepAhead` as it is currently counterintuitive. If one has 100 observations and wants 8 step ahead forecasts, `oo_.FilteredVariablesKStepAhead` is 108 instead of 100 columns long. I think we should have all forecasts made at time t arranged in basically column t instead of distributed over columns t to t+K.
https://git.dynare.org/Dynare/dynare/-/issues/479Fix repmat syntax for R2013b2019-06-19T15:38:16ZHoutan BastaniFix repmat syntax for R2013bRepmat syntax has changed in numerous ways. See the table in the Mathematics section under "Functionality being removed or changed" on this page: http://www.mathworks.fr/fr/help/matlab/release-notes.html
Repmat syntax has changed in numerous ways. See the table in the Mathematics section under "Functionality being removed or changed" on this page: http://www.mathworks.fr/fr/help/matlab/release-notes.html
https://git.dynare.org/Dynare/dynare/-/issues/478extend tags to definitions2019-06-19T15:38:16ZMarco Rattoextend tags to definitionsWould it be possible to add new tags for parameters, exo and endogenous variables?
Something similar to the $latex-name$ e.g.
var
C $c$ [name = 'private consumption']
...
end;
varexo
e $\varepsilon$ [name='technology shock']
...
end;
...Would it be possible to add new tags for parameters, exo and endogenous variables?
Something similar to the $latex-name$ e.g.
var
C $c$ [name = 'private consumption']
...
end;
varexo
e $\varepsilon$ [name='technology shock']
...
end;
parameters
sigma $\sigma$ [name='elasticity of substitution']
...
end;
4.4Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/477use of tags in write_latex_dynamic_model2019-06-19T15:38:16ZMarco Rattouse of tags in write_latex_dynamic_modelwould it be possible to add tag info in the write_latex_dynamic_model, e.g. by inserting a simple text line with tags info before each equation?
would it be possible to add tag info in the write_latex_dynamic_model, e.g. by inserting a simple text line with tags info before each equation?
4.5Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/476Fix preprocessor bug related to estimated_params_init2019-06-19T15:38:16ZJohannes PfeiferFix preprocessor bug related to estimated_params_initThe file
```
var m P c e W R k d n l gy_obs gp_obs y dA;
varexo e_a e_m;
parameters alp bet gam mst rho psi del;
alp = 0.33;
bet = 0.99;
gam = 0.003;
mst = 1.011;
rho = 0.7;
psi = 0.787;
del = 0.02;
model;
dA = exp(gam+e_a);
log(m) ...The file
```
var m P c e W R k d n l gy_obs gp_obs y dA;
varexo e_a e_m;
parameters alp bet gam mst rho psi del;
alp = 0.33;
bet = 0.99;
gam = 0.003;
mst = 1.011;
rho = 0.7;
psi = 0.787;
del = 0.02;
model;
dA = exp(gam+e_a);
log(m) = (1-rho)*log(mst) + rho*log(m(-1))+e_m;
-P/(c(+1)*P(+1)*m)+bet*P(+1)*(alp*exp(-alp*(gam+log(e(+1))))*k^(alp-1)*n(+1)^(1-alp)+(1-del)*exp(-(gam+log(e(+1)))))/(c(+2)*P(+2)*m(+1))=0;
W = l/n;
-(psi/(1-psi))*(c*P/(1-n))+l/n = 0;
R = P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(-alp)/W;
1/(c*P)-bet*P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)/(m*l*c(+1)*P(+1)) = 0;
c+k = exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)+(1-del)*exp(-(gam+e_a))*k(-1);
P*c = m;
m-1+d = l;
e = exp(e_a);
y = k(-1)^alp*n^(1-alp)*exp(-alp*(gam+e_a));
gy_obs = dA*y/y(-1);
gp_obs = (P/P(-1))*m(-1)/dA;
end;
initval;
k = 6;
m = mst;
P = 2.25;
c = 0.45;
e = 1;
W = 4;
R = 1.02;
d = 0.85;
n = 0.19;
l = 0.86;
y = 0.6;
gy_obs = exp(gam);
gp_obs = exp(-gam);
dA = exp(gam);
end;
shocks;
var e_a; stderr 0.014;
var e_m; stderr 0.005;
end;
steady;
check;
estimated_params;
alp, beta_pdf, 0.356, 0.02;
bet, beta_pdf, 0.993, 0.002;
gam, normal_pdf, 0.0085, 0.003;
mst, normal_pdf, 1.0002, 0.007;
rho,2, normal_pdf, 0.129, 0.223;
psi, beta_pdf, 0.65, 0.05;
del, beta_pdf, 0.01, 0.005;
stderr e_a, inv_gamma_pdf, 0.035449, inf;
stderr e_m, inv_gamma_pdf, 0.008862, inf;
corr e_a, e_m, normal_pdf, 0, 0.007;
stderr gp_obs, inv_gamma_pdf, 0.008862, inf;
corr gp_obs, gy_obs, normal_pdf, 0, 0.007;
end;
varobs gp_obs gy_obs;
estimated_params_init;
stderr e_a, 0.014000;
stderr e_m, 0.005000;
stderr gp_obs, 0.000000;
corr e_a, e_m, 0.000000;
corr gp_obs, gy_obs, 0.000000;
alp, 0.330000;
bet, 0.990000;
gam, 0.003000;
mst, 1.011000;
rho, 0.700000;
psi, 0.787000;
del, 0.020000;
end;
estimation(order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8,prior_trunc=0);
```
creates matlab code
```
tmp1 = find((estim_params_.corrx(:,1)==1)) & (estim_params_.corrx(:,2)==2);
tmp1 = find((estim_params_.corrn(:,1)==12)) & (estim_params_.corrn(:,2)==11;
```
Somehow the brackets are incorrect and should be
```
tmp1 = find((estim_params_.corrx(:,1)==1) & (estim_params_.corrx(:,2)==2));
tmp1 = find((estim_params_.corrn(:,1)==12) & (estim_params_.corrn(:,2)==11));
```
Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/469Prevent estimating parameters used inside shocks-block2019-06-19T15:38:16ZJohannes PfeiferPrevent estimating parameters used inside shocks-blockI would classify the following behavior as a bug. `stoch_simul` allows using parameters to set variances inside of the `shocks` block. However, `estimation` completely ignores the updating of such a parameter if it is estimated as the co...I would classify the following behavior as a bug. `stoch_simul` allows using parameters to set variances inside of the `shocks` block. However, `estimation` completely ignores the updating of such a parameter if it is estimated as the covariance matrix is not updated. As can be seen in the mode_check plots of the attached modification of fs2000.mod, estimating sig_e_a results in the likelihood kernel being flat. Only the prior provides curvature. We should disallow such behavior as people should use the `stderr e_a` version.
```
var m P c e W R k d n l gy_obs gp_obs y dA;
varexo e_a e_m;
parameters alp bet gam mst rho psi del sig_e_a;
alp = 0.33;
bet = 0.99;
gam = 0.003;
mst = 1.011;
rho = 0.7;
psi = 0.787;
del = 0.02;
sig_e_a=0.014;
model;
dA = exp(gam+e_a);
log(m) = (1-rho)*log(mst) + rho*log(m(-1))+e_m;
-P/(c(+1)*P(+1)*m)+bet*P(+1)*(alp*exp(-alp*(gam+log(e(+1))))*k^(alp-1)*n(+1)^(1-alp)+(1-del)*exp(-(gam+log(e(+1)))))/(c(+2)*P(+2)*m(+1))=0;
W = l/n;
-(psi/(1-psi))*(c*P/(1-n))+l/n = 0;
R = P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(-alp)/W;
1/(c*P)-bet*P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)/(m*l*c(+1)*P(+1)) = 0;
c+k = exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)+(1-del)*exp(-(gam+e_a))*k(-1);
P*c = m;
m-1+d = l;
e = exp(e_a);
y = k(-1)^alp*n^(1-alp)*exp(-alp*(gam+e_a));
gy_obs = dA*y/y(-1);
gp_obs = (P/P(-1))*m(-1)/dA;
end;
initval;
k = 6;
m = mst;
P = 2.25;
c = 0.45;
e = 1;
W = 4;
R = 1.02;
d = 0.85;
n = 0.19;
l = 0.86;
y = 0.6;
gy_obs = exp(gam);
gp_obs = exp(-gam);
dA = exp(gam);
end;
shocks;
var e_a; stderr sig_e_a;
var e_m; stderr 0.005;
end;
steady;
check;
estimated_params;
del, beta_pdf, 0.01, 0.005;
sig_e_a, inv_gamma_pdf, 0.035449, inf;
end;
varobs gp_obs gy_obs;
estimation(order=1,bayesian_irf,irf_shocks=(e_m),datafile=fsdat_simul,mode_check, nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8);
```
4.4Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/466Make build system for MEX files compatible with future automake versions2019-04-06T07:33:00ZSébastien VillemotMake build system for MEX files compatible with future automake versionsIn future versions of automake, the `subdir-objects` option will be activated by default. This option breaks the way we build the MEX files. We need to redesign the build system for MEX files, or find a workaround.
In future versions of automake, the `subdir-objects` option will be activated by default. This option breaks the way we build the MEX files. We need to redesign the build system for MEX files, or find a workaround.
Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/461dynare++ doesn't compile with bison >= 2.72019-06-19T15:38:16ZMichelJuillarddynare++ doesn't compile with bison >= 2.7The functions xx_parse() are now declared int in csv_tab.hh formula_tab.hh and matrix_tab.hh, generated by bison, but declared void in csv_parser.cpp, formula_parser.cpp, matrix_parser.cpp
The functions xx_parse() are now declared int in csv_tab.hh formula_tab.hh and matrix_tab.hh, generated by bison, but declared void in csv_parser.cpp, formula_parser.cpp, matrix_parser.cpp
4.4https://git.dynare.org/Dynare/dynare/-/issues/446ms-sbvar/test_ms_variances.mod fails under Octave with MatIO 1.52019-06-19T15:38:18ZSébastien Villemotms-sbvar/test_ms_variances.mod fails under Octave with MatIO 1.5Here is the error message:
```
WHILE RUNNING MODFILE: ms-sbvar/test_ms_variances
MSG: load: reading matrix data for 'A0'
IN FILE: /home/sebastien/dynare/unstable/tests/../matlab//ms-sbvar/set_ms_est...Here is the error message:
```
WHILE RUNNING MODFILE: ms-sbvar/test_ms_variances
MSG: load: reading matrix data for 'A0'
IN FILE: /home/sebastien/dynare/unstable/tests/../matlab//ms-sbvar/set_ms_estimation_file.m
IN FUNCTION: set_ms_estimation_file
ON LINE and COLUMN: 49 and 12
```
Note that the problem does not occur with MatIO 1.3.
4.4Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/448Relax check for varobs statement with measurement error.2019-06-19T15:38:18ZJohannes PfeiferRelax check for varobs statement with measurement error.The following mod-file leads to a preprocessor error of
`ERROR: test_ME_shocks.mod: line 18, cols 1-16: shocks: standard error can only be specified for exogenous or observed endogenous variables`
```
var c, k;
varexo e;
model;
c=0.5*...The following mod-file leads to a preprocessor error of
`ERROR: test_ME_shocks.mod: line 18, cols 1-16: shocks: standard error can only be specified for exogenous or observed endogenous variables`
```
var c, k;
varexo e;
model;
c=0.5*c(+1)+e;
k = 0.9*k(-1);
end;
shocks;
var e; stderr 0.009;
var k; stderr 1;
end;
varobs k;
stoch_simul(periods=500);
```
The reason is that the `varobs` statement comes after the `shocks` block. Moving it before the `shocks` makes the file run. We might want to relax this restriction on the positioning for the check.
4.4Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/442Change default mode finder for nonlinear estimation2019-02-08T08:31:00ZJohannes PfeiferChange default mode finder for nonlinear estimationAs discussed in Fernandez-Villaverde/Rubio Ramirez (2007): "Estimating Macroeconomic Models:A Likelihood Approach" and Andreasen (2009): "How to Maximize the Likelihood Function for a DSGE Model" the resampling step in particle filtering...As discussed in Fernandez-Villaverde/Rubio Ramirez (2007): "Estimating Macroeconomic Models:A Likelihood Approach" and Andreasen (2009): "How to Maximize the Likelihood Function for a DSGE Model" the resampling step in particle filtering creates discontinuities in the parameters. Thus, using gradient based optimizers is discouraged. Based on the latter paper, I would suggest to change the default to mode_compute=9 in this case.
4.4https://git.dynare.org/Dynare/dynare/-/issues/444Document remaining options of nonlinear filters2021-08-17T10:25:22ZStéphane Adjemianstepan@adjemian.euDocument remaining options of nonlinear filtersWe need to describe and discuss all the available options in `options_.particle`. Setting options has been introduced in https://git.dynare.org/Dynare/dynare/-/merge_requests/1884. Still to do
- [x] Adjust the wiki to reflect the new way...We need to describe and discuss all the available options in `options_.particle`. Setting options has been introduced in https://git.dynare.org/Dynare/dynare/-/merge_requests/1884. Still to do
- [x] Adjust the wiki to reflect the new way of setting these options
- [x] Add information to the manual (a link to the wiki is the minimum)5.xJohannes PfeiferJohannes Pfeiferhttps://git.dynare.org/Dynare/dynare/-/issues/439Bytecode does not enforce positivity constraint on irreversible investment model2019-02-08T08:31:00ZSébastien VillemotBytecode does not enforce positivity constraint on irreversible investment modelIn the following RBC model with irreversible investment, the positivity constraint is not enforced if simulated with block+bytecode. On the contrary, if block+bytecode is removed, the classic deterministic solver gives the right result.
...In the following RBC model with irreversible investment, the positivity constraint is not enforced if simulated with block+bytecode. On the contrary, if block+bytecode is removed, the classic deterministic solver gives the right result.
```
var k, y, l, c, i, A, a, expterm, mu;
varexo epsilon;
parameters beta, theta, tau, alpha, psi, delta, rho, Astar, sigma;
beta = 0.990;
theta = 0.357;
tau = 2.000;
alpha = 0.450;
psi = -2.500;
delta = 0.020;
rho = 0.998;
Astar = 1.000;
sigma = 0.100;
model(differentiate_forward_vars,block,bytecode,cutoff=0);
a = rho*a(-1) + sigma*epsilon;
A = Astar*exp(a);
mu = max(0,(((c^theta)*((1-l)^(1-theta)))^(1-tau))/c - expterm(1)+beta*mu(1)*(1-delta));
(i<=0)*(k - (1-delta)*k(-1)) + (i>0)*((((c^theta)*((1-l)^(1-theta)))^(1-tau))/c - expterm(1)+beta*mu(1)*(1-delta)) = 0;
expterm = beta*((((c^theta)*((1-l)^(1-theta)))^(1-tau))/c)*(alpha*((y/k(-1))^(1-psi))+1-delta);
((1-theta)/theta)*(c/(1-l)) - (1-alpha)*(y/l)^(1-psi);
y = A*(alpha*(k(-1)^psi)+(1-alpha)*(l^psi))^(1/psi);
k = y-c+(1-delta)*k(-1);
i = k-(1-delta)*k(-1);
end;
steady_state_model;
a=0;
mu=0;
A=Astar;
// Steady state ratios
Output_per_unit_of_Capital=((1/beta-1+delta)/alpha)^(1/(1-psi));
Consumption_per_unit_of_Capital=Output_per_unit_of_Capital-delta;
Labour_per_unit_of_Capital=(((Output_per_unit_of_Capital/A)^psi-alpha)/(1-alpha))^(1/psi);
Output_per_unit_of_Labour=Output_per_unit_of_Capital/Labour_per_unit_of_Capital;
Consumption_per_unit_of_Labour=Consumption_per_unit_of_Capital/Labour_per_unit_of_Capital;
l=1/(1+Consumption_per_unit_of_Labour/((1-alpha)*theta/(1-theta)*Output_per_unit_of_Labour^(1-psi)));
c=Consumption_per_unit_of_Labour*l;
k=l/Labour_per_unit_of_Capital;
y=Output_per_unit_of_Capital*k;
i=delta*k;
expterm=beta*(c^theta*(1-l)^(1-theta))^(1-tau)/c*(1+alpha*(y/k)^(1-psi)-delta);
end;
shocks;
var epsilon;
periods 10;
values -1;
end;
steady;
options_.maxit_ = 200;
simul(periods=400);
n = 40;
figure(2);
subplot(3,2,1); plot(1:n,A(1:n)); title('A');
subplot(3,2,2); plot(2:n,y(2:n)); title('y');
subplot(3,2,3); plot(2:n,l(2:n)); title('l');
subplot(3,2,4); plot(1:n,k(1:n)); title('k');
subplot(3,2,5); plot(2:n,c(2:n)); title('c');
subplot(3,2,6); plot(2:n, y(2:n)-c(2:n)); title('i');
```
4.5