We want to build a database of example MOD files, with the following objectives: * the MOD files must be interesting from an academic or policy making point of view, * they must be distributed under a free software license, * the database should cover as many Dynare features as possible (deterministic simulations, stochastic simulations, bayesian estimation, optimal policy, ...), * the database should include as many models from "classical papers" as possible. Here is a check list for every MOD file to be included in the database: * at the top of the file, a comment must give a short description of the model, and the references of the paper from which the model is taken, * the copyright holder and the license under which the MOD file is distributed must be explicitly stated, * the MOD file must run under the latest stable version of Dynare (4.0.4 at the time of this writing), * when the MOD file performs an estimation, if it is not possible to redistribute the data for license reasons, then the MOD file should contain a link to a web site where the data can be downloaded. = Sources = There already exist a lot of MOD files available on the web. The three main sources are: * the "Contributions and examples" forum on [[http://www.dynare.org/phpBB3/|Dynare forums]] * the [[http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_content&task=category§ionid=11&id=96&Itemid=89|examples]] section of Dynare homepage * the [[https://www.dynare.org/trac/browser/tests|testsuite]] incorporated in Dynare distribution Some of these files are not working with Dynare 4, others are not documented, others have no explicit copyright/license. The first step of the project would be to go through all these existing MOD files, fix these issues, and when possible include them in the database. The second step of the project would be to create MOD files from scratch for models that are described in famous academic papers, and for which there is currently no implementation. When possible, the MOD file should replicate the results of the papers. A list of such papers follows: [TO BE COMPLETED] = Copyright and license issues = In order to redistribute our database of examples with Dynare, some legal conditions need to be met. The MOD files need either to be in the public domain, or, if they are copyrighted, they must be licensed under a free license. == Copyright holder == The copyright holder is the person who "owns" the piece of code. If is generally the person or the group of people who wrote the code. See [[http://en.wikipedia.org/wiki/Copyright|this]] for more information. For MOD files written by members of the Dynare team, the copyright holder will be "Dynare Team". For MOD files written by other people, there are three options: * the original author wants to remain the copyright holder: this is not a problem if she accepts to redistribute the MOD file under a free license (see below) * the original author accepts to give the copyright to "Dynare Team", in which case we will distribute it under the GPL (see below) * there is no copyright at all, and the MOD is therefore in the public domain. By law, this is automatically the case if the original author is an American federal public servant. It is also possible that the original author has explictly relinquished any copyright on her work. See [[http://en.wikipedia.org/wiki/Public_domain|this]] for more information. Note that, when the MOD file implements a model described in a paper, then the copyright holder is '''''not''''' the author of paper: it is the person who wrote the MOD file. Similarly, when somebody implements an algorithm described by a research paper, the copyright holder of the code is the programmer, not the researcher. Nevertheless, it is important that the research paper is cited in the MOD file, both for courtesy and for clarity. == License == If the MOD file is in the public domain, there is no need to state the license under which the MOD file is redistributed, because there is no usage restriction on the file. There should only be a comment such as: "This file is in the public domain. Author: ...". If the MOD file is copyrighted, then it is necessary to state the licensing terms. Our preferred free license is the [[http://www.gnu.org/licenses/gpl.html|GNU General Public License]] (GPL), version 3. Other free licenses are listed [[http://en.wikipedia.org/wiki/Open_source_license|there]]. By default, when the author has given no explicit license in the MOD file, then no usage of the MOD file is authorized without permission. It is therefore necessary in those case to contact the author and kindly ask her if she is willing to give up its copyright to Dynare Team, or at least to distribute her file under the GPL. = Example = Here is what a MOD file copyrighted by Dynare Team could look like: {{{ /* * A very basic RBC model, simulated in a deterministic setup. * Reference: Villemot & al. (2009), "My first DSGE model", Journal of Stupid Economics, vol. 1, pp. 111-116 */ /* * Copyright (C) 2009 Dynare Team * * This file is part of Dynare. * * Dynare is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Dynare is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Dynare. If not, see . */ var c k; varexo x; parameters alph gam delt bet aa; alph=0.5; gam=0.5; delt=0.02; bet=0.05; aa=0.5; model; c + k - aa*x*k(-1)^alph - (1-delt)*k(-1); c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam); end; initval; x = 1; k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1)); c = aa*k^alph-delt*k; end; steady; check; shocks; var x; periods 1; values 1.2; end; simul(periods=200); rplot c; rplot k; }}}