diff --git a/license.txt b/license.txt
index 486f3242e83de7fbb329f0910a7c2584f87e098c..d32b15f4f8d0927522b26c3b6fb4449ade56e0f1 100644
--- a/license.txt
+++ b/license.txt
@@ -1,4 +1,4 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: Dynare
 Upstream-Contact: Dynare Team, whose members in 2017 are:
                   Stéphane Adjemian <stephane.adjemian@univ-lemans.fr>
@@ -17,8 +17,8 @@ Copyright: 1996-2017 Dynare Team
 License: GPL-3+
 
 Files: matlab/AIM/SP*
-Copyright: public-domain
-License: public-domain
+Copyright: none
+License: public-domain-aim
  This code is in the public domain and may be used freely.
  However the authors would appreciate acknowledgement of the source by
  citation of any of the following papers:
@@ -86,52 +86,55 @@ Copyright: 2016 Benjamin Born and Johannes Pfeifer
 License: GPL-3+
 
 Files: matlab\gsa\Morris_Measure_Groups.m
-matlab\gsa\Sampling_Function_2.m
-Written by Jessica Cariboni and Francesca Campolongo
-Joint Research Centre, The European Commission,
-Copyright (C) 2005 European Commission
-Copyright (C) 2012 Dynare Team
+       matlab\gsa\Sampling_Function_2.m
+Copyright: 2005 European Commission
+           2012 Dynare Team
+License: GPL-3+
+Comment: Written by Jessica Cariboni and Francesca Campolongo
+ Joint Research Centre, The European Commission,
 
 Files: matlab\gsa\cumplot.m
-matlab\gsa\filt_mc_.m
-matlab\gsa\gsa_plotmatrix.m
-matlab\gsa\gsa_skewness.m
-matlab\gsa\gsa_speed.m
-matlab\gsa\log_trans_.m
-matlab\gsa\map_calibration.m
-matlab\gsa\map_ident_.m
-matlab\gsa\mcf_analysis.m
-matlab\gsa\myboxplot.m
-matlab\gsa\myprctilecol.m
-matlab\gsa\prior_draw_gsa.m
-matlab\gsa\read_data.m
-matlab\gsa\redform_map.m
-matlab\gsa\redform_screen.m
-matlab\gsa\scatter_mcf.m
-matlab\gsa\smirnov.m
-matlab\gsa\stab_map_.m
-matlab\gsa\stab_map_1.m
-matlab\gsa\stab_map_2.m
-matlab\gsa\stand_.m
-matlab\gsa\tcrit.m
-matlab\gsa\teff.m
-matlab\gsa\trank.m
-Copyright (C) 2011-2017 European Commission
-Copyright (C) 2011-2017 Dynare Team
+       matlab\gsa\filt_mc_.m
+       matlab\gsa\gsa_plotmatrix.m
+       matlab\gsa\gsa_skewness.m
+       matlab\gsa\gsa_speed.m
+       matlab\gsa\log_trans_.m
+       matlab\gsa\map_calibration.m
+       matlab\gsa\map_ident_.m
+       matlab\gsa\mcf_analysis.m
+       matlab\gsa\myboxplot.m
+       matlab\gsa\myprctilecol.m
+       matlab\gsa\prior_draw_gsa.m
+       matlab\gsa\read_data.m
+       matlab\gsa\redform_map.m
+       matlab\gsa\redform_screen.m
+       matlab\gsa\scatter_mcf.m
+       matlab\gsa\smirnov.m
+       matlab\gsa\stab_map_.m
+       matlab\gsa\stab_map_1.m
+       matlab\gsa\stab_map_2.m
+       matlab\gsa\stand_.m
+       matlab\gsa\tcrit.m
+       matlab\gsa\teff.m
+       matlab\gsa\trank.m
+Copyright: 2011-2017 European Commission
+           2011-2017 Dynare Team
+License: GPL-3+
 
 Files: matlab/gsa/pick.m
-Copyright (C) 2001-2017 European Commission
-This file is part of GLUEWIN
-The program has been developed by M. Ratto, European Commission, Joint Research Centre,
-Institute for the Protection and Security of The Citizen, Technological and Economic Risk Management,
-Applied Statistics, as a deliverable of the IMPACT project 
-(EC Fifth Framework Programme, SCA Project, IST-1999-11313, DG-INFSO).
-Disclaimer: This software has been developed at the Joint Research Centre of European Commission
-by officers in the course of their official duties. This software is not subject to copyright
-protection and is in the public domain. It is an experimental system. The Joint Research Centre
-of European Commission assumes no responsibility whatsoever for its use by other parties
-and makes no guarantees, expressed or implied, about its quality, reliability, or any other
-characteristic. We would appreciate acknowledgement if the software is used.
+Copyright: none
+License: public-domain-jrc
+ This software has been developed at the Joint Research Centre of European Commission
+ by officers in the course of their official duties. This software is not subject to copyright
+ protection and is in the public domain. It is an experimental system. The Joint Research Centre
+ of European Commission assumes no responsibility whatsoever for its use by other parties
+ and makes no guarantees, expressed or implied, about its quality, reliability, or any other
+ characteristic. We would appreciate acknowledgement if the software is used.
+Comment: This file is part of GLUEWIN.
+ The program has been developed by M. Ratto, European Commission, Joint Research Centre,
+ Institute for the Protection and Security of The Citizen, Technological and Economic Risk Management,
+ Applied Statistics, as a deliverable of the IMPACT project
+ (EC Fifth Framework Programme, SCA Project, IST-1999-11313, DG-INFSO).
 
 Files: matlab/optimization/simpsa.m matlab/optimization/simpsaget.m matlab/optimization/simpsaset.m
 Copyright: 2005 Henning Schmidt, FCC, henning@fcc.chalmers.se
@@ -174,81 +177,22 @@ Copyright: 2005 Jos van der Geest <jos@jasen.nl>
            2013 Christophe Gouel
            2016 Dynare Team
 License: BSD-2-clause
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
- .
-     * Redistributions of source code must retain the above copyright
-       notice, this list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright
-       notice, this list of conditions and the following disclaimer in
-       the documentation and/or other materials provided with the distribution
- .
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
 
 Files: matlab/lmmcp/lmmcp.m
 Copyright: 2005 Christian Kanzow and Stefania Petra
            2013 Christophe Gouel
            2014 Dynare Team
-License: permissive
+License: permissive-lmmcp
  Unlimited permission is granted to everyone to use, copy, modify or
  distribute this software.
 
 Files: matlab/utilities/graphics/distinguishable_colors.m
-Copyright 2010-2011 by Timothy E. Holy
-All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in
-      the documentation and/or other materials provided with the distribution
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
+Copyright: 2010-2011 Timothy E. Holy
+License: BSD-2-clause
 
 Files: matlab/utilities/graphics/colorspace.m
-Pascal Getreuer 2005-2010
-All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in
-      the documentation and/or other materials provided with the distribution
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
+Copyright: 2005-2010 Pascal Getreuer
+License: BSD-2-clause
 
 Files: doc/dynare.texi doc/*.tex doc/*.svg doc/*.dia doc/*.pdf doc/*.bib
 Copyright: 1996-2017 Dynare Team
@@ -409,7 +353,7 @@ License: GPL-3+
 
 Files: contrib/dmm/randlib/*
 Copyright: none
-License: public-domain
+License: public-domain-dmm
  We place the Randlib code that we have written in the public domain.  
  .
                                  NO WARRANTY
@@ -429,6 +373,29 @@ License: public-domain
      ITS ANALYSIS BEING  RENDERED INACCURATE OR  LOSSES SUSTAINED  BY THIRD
      PARTIES) THE PROGRAM.
 
+License: BSD-2-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ .
+     * Redistributions of source code must retain the above copyright
+       notice, this list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright
+       notice, this list of conditions and the following disclaimer in
+       the documentation and/or other materials provided with the distribution
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
 License: GFDL-NIV-1.3+
  Permission is granted to copy, distribute and/or modify this document
  under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -437,21 +404,6 @@ License: GFDL-NIV-1.3+
  .
  A copy of the license can be found at <http://www.gnu.org/licenses/fdl.txt>
 
-License: GPL-2+
- This program 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 2 of
- the License, or (at your option) any later version.
- .
- This program 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 this program.  If not, see
- <http://www.gnu.org/licenses/>.
-
 License: GPL-2+ with Autoconf exception
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License as