Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
benchmark-pfm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stéphane Adjemian
benchmark-pfm
Commits
6bbc687a
Verified
Commit
6bbc687a
authored
7 months ago
by
Stéphane Adjemian
Browse files
Options
Downloads
Patches
Plain Diff
Add example.
parent
2c4fed06
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/README.org
+15
-0
15 additions, 0 deletions
examples/README.org
examples/rbc.mod
+137
-0
137 additions, 0 deletions
examples/rbc.mod
with
152 additions
and
0 deletions
examples/README.org
0 → 100644
+
15
−
0
View file @
6bbc687a
To run benchmarks on a single =.mod= file (e.g. =rbc.mod=):
#+BEGIN_SRC bash
~$ DYNARE=/home/stepan/works/Dynare/dynare/matlab ITERATIONS=100 ../run.sh rbc
#+END_SRC
The output is a =.pdf= file named =rbc-COMPUTERNAME.pdf=. The =DYNARE=
variable is mandatory, it holds the path to the =matlab= subfolder of
Dynare. The variable =ITERATIONS= is optional (default value is 1), it
specifies the number of times the problem has to be solved. If the
value is negative, the generated table will report the total time
instead of the average time.
It is also possible to run benchmarks on an arbitrary number of models:
#+BEGIN_SRC bash
~$ DYNARE=/home/stepan/works/Dynare/dynare/matlab ITERATIONS=100 ../run.sh rbc sw
#+END_SRC
This diff is collapsed.
Click to expand it.
examples/rbc.mod
0 → 100644
+
137
−
0
View file @
6bbc687a
@#ifndef BLOCKS
@#define BLOCKS=true
@#endif
@#ifndef BYTECODE
@#define BYTECODE=true
@#endif
@#ifndef USE_DLL
@#define USE_DLL=false
@#endif
@#ifndef MFS_VALUE
@#define MFS_VALUE = 0
@#endif
@#ifndef CUTOFF_VALUE
@#define CUTOFF_VALUE = 0
@#endif
@#ifndef PERIODS
@#define PERIODS = 200
@#endif
@#ifndef MARKOWITZ_VALUE
@#define MARKOWITZ_VALUE=0.5
@#endif
@#ifndef STACK_SOLVE_ALGO_VALUE
@#define STACK_SOLVE_ALGO_VALUE=5
@#endif
@#ifndef STEADY_SOLVE_ALGO_VALUE
@#define STEADY_SOLVE_ALGO_VALUE=0
@#endif
var Capital, Output, Labour, Consumption, Efficiency, efficiency, ExpectedTerm;
varexo EfficiencyInnovation;
parameters beta, theta, tau, alpha, psi, delta, rho, effstar, sigma2;
beta = 0.9900;
theta = 0.3570;
tau = 2.0000;
alpha = 0.4500;
psi = -0.1000;
delta = 0.0200;
rho = 0.8000;
effstar = 1.0000;
sigma2 = 0;
@#if !BLOCKS && !BYTECODE && !USE_DLL
model;
@#elseif BLOCKS && !BYTECODE && !USE_DLL
model(block, cutoff=@{CUTOFF_VALUE}, mfs=@{MFS_VALUE});
@#elseif !BLOCKS && BYTECODE
model(bytecode);
@#elseif BLOCKS && BYTECODE
model(block, bytecode, cutoff=@{CUTOFF_VALUE}, mfs=@{MFS_VALUE});
@#elseif !BLOCKS && USE_DLL
model(use_dll);
@#else
model(block, use_dll, cutoff=@{CUTOFF_VALUE}, mfs=@{MFS_VALUE});
@#endif
// Eq. n°1:
efficiency = rho*efficiency(-1) + EfficiencyInnovation;
// Eq. n°2:
Efficiency = effstar*exp(efficiency);
// Eq. n°3:
Output = Efficiency*(alpha*(Capital(-1)^psi)+(1-alpha)*(Labour^psi))^(1/psi);
// Eq. n°4:
Capital = Output-Consumption + (1-delta)*Capital(-1);
// Eq. n°5:
((1-theta)/theta)*(Consumption/(1-Labour)) - (1-alpha)*(Output/Labour)^(1-psi);
// Eq. n°6:
(((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption = ExpectedTerm(1);
// Eq. n°7:
ExpectedTerm = beta*((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption)*(alpha*((Output/Capital(-1))^(1-psi))+(1-delta));
end;
steady_state_model;
efficiency = EfficiencyInnovation/(1-rho);
Efficiency = effstar*exp(efficiency);
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/Efficiency)^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;
% Compute steady state share of capital.
ShareOfCapital=alpha/(alpha+(1-alpha)*Labour_per_unit_of_Capital^psi);
% Compute steady state of the endogenous variables.
Labour=1/(1+Consumption_per_unit_of_Labour/((1-alpha)*theta/(1-theta)*Output_per_unit_of_Labour^(1-psi)));
Consumption=Consumption_per_unit_of_Labour*Labour;
Capital=Labour/Labour_per_unit_of_Capital;
Output=Output_per_unit_of_Capital*Capital;
ExpectedTerm=beta*((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption)*(alpha*((Output/Capital)^(1-psi))+1-delta);
end;
steady;
ik = varlist_indices('Capital', M_.endo_names);
CapitalSS = oo_.steady_state(ik);
for i=1:@{ITERATIONS}
histval;
Capital(0) = CapitalSS/2;
end;
perfect_foresight_setup(periods=@{PERIODS});
perfect_foresight_solver(no_homotopy, markowitz=@{MARKOWITZ_VALUE}, stack_solve_algo = @{STACK_SOLVE_ALGO_VALUE}, solve_algo = @{STEADY_SOLVE_ALGO_VALUE});
end;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment