Commit Graph

154 Commits (6adf1c26392d737dc31844aa3add0441e040f4a8)

Author SHA1 Message Date
Stéphane Adjemian (Charybdis) 8b5b7921f6 Improved solver for (S)EP.
Use previous solution as an initial condition for the perfect foresight problem.
2016-05-24 17:28:24 +02:00
Stéphane Adjemian(Charybdis) 7d1d860a53 Fixed ep.init option.
Initialization of the perfect foresight solver (in extended path) with
the solution of the first order approximation of the model was broken.

If the value of options_.ep.init is "true"" (1) then the solution of the
first order approximation is used as an initial guess for the newton
lilke solver. If the value of options_.ep.init is "false" (0) the solver
is initialized with the steady state.
2016-05-24 17:28:24 +02:00
Stéphane Adjemian(Charybdis) dabdda0506 Fixed wrong definition of a logical variable.
The second outputr returned by perfect_foresight_solver_core is the
max. abs. residual, not a dummy variable indicating success or failure
of the perfect foresight solver.
2016-05-24 17:28:24 +02:00
Stéphane Adjemian(Charybdis) fbf2fae036 Changed option value for unscented integration nodes. 2016-05-24 17:28:24 +02:00
Stéphane Adjemian(Charybdis) fdbd4fa7a7 Code factorization.
- Added routines for initializing and setting shocks in EP.
 - Added a specialized routine for doing Monte Carlo around EP.
2016-05-24 17:28:24 +02:00
Stéphane Adjemian(Charybdis) 3bbac629ed Cosmetic change.
Removed maximum_lead and maximum_lag in extended_path routines.
2016-05-24 17:28:24 +02:00
Stéphane Adjemian(Charybdis) d74f315bfb Fixed bug in (Stochastic) Extended Path algorithm.
Innovations were not correctly passed to the non linear solver. Closes #1128.
2016-05-24 17:28:24 +02:00
Stéphane Adjemian (Hermes) 8958b7ef98 Cosmetic changes. 2016-05-24 17:28:24 +02:00
Stéphane Adjemian (Hermes) 3a1f74d7a7 Fixed typo. 2016-05-24 17:28:24 +02:00
Stéphane Adjemian (Hermes) 13ca15a278 Allow (S)EP with arbitrary sequence of innovations.
The third input argument of extended_path Matlab/Octave's routine is the
sequence of shocks (T*n array, where n is the number of exogenous
variables and T is the size of the sample). If the third argument is
empty, the (stochastic) extended path is run with gaussian
innovations (this corresponds to the previous behaviour).

TODO:
 - Fix the compatibility with ep.replic_nbr
 - Check the 'calibrated' mode.
2016-05-24 17:28:24 +02:00
Stéphane Adjemian (Hermes) b60bd7b36b Removed globals from extended_path routine. 2016-05-24 17:28:24 +02:00
Johannes Pfeifer 8e3cb65258 Provide informative error message if EP is used with varexo_det
Closes #875
2016-03-17 10:30:14 +01:00
Houtan Bastani f60945facc fix copyright dates 2016-03-11 16:22:42 +01:00
Stéphane Adjemian (Hermes) d331cf5a7a Fixed extended path.
- Removed call to make_ex_,
 - Fill oo_.exo_simul in extended path routine,
 - Do not update oo_.exo_simul after the call to the extended path routine,
 - Cosmetic change.

(cherry picked from commit 4791649524cc7876fc25d04a925f58a546a3a67d)
2016-03-05 16:24:14 +01:00
Michel Juillard 1bd2a1b1c2 ep: fixed return of solve_stochastic_perfect_foresight() and solve_stochastic_perfect_foresight_2() 2015-07-28 17:17:25 +02:00
Michel Juillard c3c72192ac small bug corrections 2015-07-27 16:52:36 +02:00
Michel Juillard 22eb824c6f extended path: fixing bug 2015-07-27 14:31:42 +02:00
Michel Juillard e8f318ff50 fixed problems in extended path 2015-07-23 14:27:55 +02:00
Michel Juillard 9b8077fc28 Merge branch 'master' into new_ep 2015-07-21 09:30:58 +02:00
Stéphane Adjemian (Hermes) c43cfb45a8 Fixed bug in Extended Path (added second argument to get_complementarity_condition). 2015-06-03 08:22:26 +02:00
Michel Juillard 3ef5bc2989 Merge branch 'master' into new_ep 2015-05-25 17:20:23 +02:00
Michel Juillard f03839cf12 removed "global options_" in dynare_solve.m and made it an
argument. Modified all calling functions.
2015-05-25 17:15:09 +02:00
Michel Juillard a36fd53eff fixing extended-path 2015-05-25 09:43:21 +02:00
Michel Juillard a53385ea28 dynare_solve: fix initial check for models with complementarity conditions 2015-03-07 10:10:35 +01:00
Michel Juillard 0c1197c13f extended_path: fixing bug when initializing with linear approximation,
adding simple homotopy scheme (unfinished)
2015-03-04 09:43:14 +01:00
Michel Juillard 70173d4431 fixing bugs in extended_path 2015-02-22 21:56:42 +01:00
Michel Juillard 55ea2100c6 Merge branch 'master' into new_ep 2015-02-19 10:27:15 +01:00
Houtan Bastani ca83397d95 update copyright dates for files changed in 2015 2015-02-16 09:08:02 +01:00
Michel Juillard 6d25d05be4 adapt extended_path to changes in perfect_foresight 2015-02-14 18:29:11 +01:00
Michel Juillard 21f009a531 Merge branch 'master' into new_ep 2015-02-14 11:54:57 +01:00
Michel Juillard 9f7c1a9bc6 fixes to extended path 2015-02-11 22:23:21 +01:00
Michel Juillard 9c6e219990 new implementation for extended path 2015-02-06 12:36:09 +01:00
Michel Juillard 5ff129e52d simplified extended_path.m.
homotopy and  variable sample length should be handled in the solvers.
2015-01-11 21:12:32 +01:00
Michel Juillard da8f702429 removed parfor used for building the Jacobian 2015-01-11 21:12:32 +01:00
ferhat 823477519c Corrects the extended path when bytecode option is used 2014-12-19 14:53:23 +01:00
Michel Juillard 6d42861e19 extended-path: fixing bug when options_.initial_period is NaN 2014-08-12 18:59:56 +02:00
Michel Juillard 812a8c7637 extended_path: fixed bugs when model doesn't converge 2014-08-12 12:12:15 +02:00
Michel Juillard 21d40f6123 fixed minor bug in stochastic extended path 2014-06-21 10:06:01 +02:00
Michel Juillard 499967f9a1 adding an option to extended path to control homotopic steps and
continue in case of failed case
2014-06-16 14:25:23 +02:00
Michel Juillard 6f9720ff84 removing debug code 2014-06-16 14:24:05 +02:00
Michel Juillard a7ec5c7258 extended_path: adding missing files 2014-05-18 21:49:52 +02:00
Michel Juillard a39d94409f adding lmmcp as solver for extended path 2014-05-18 21:49:52 +02:00
Michel Juillard 23134353e3 extended_path: update tests models; correct bugs introduced in
previous commit
2014-05-12 14:17:19 +02:00
Michel Juillard 26f2b301b0 make extended path algorithm 1 as a self contained problem usable by dynare_solve 2014-05-12 10:18:43 +02:00
Michel Juillard add594ab7e updating extended_path 2014-05-12 09:40:12 +02:00
Michel Juillard f5ae90bcc8 extended-path: changed homotopy so that integration nodes change
too (only for for case 1)
2014-03-16 18:54:52 +01:00
Michel Juillard 8f06a3134d added unscented nodes generator
put nodes generators in setup_integration_nodes.m
added stochastic_solvers to homotopic_steps
2014-03-16 18:54:52 +01:00
Stéphane Adjemian (Scylla) e1308a8192 Fixed homotopy for stochastic extended path. 2014-02-21 12:12:40 +01:00
Stéphane Adjemian (Charybdis) 6efe62a3b2 Transposed the definition of the innovations in (stochastic) extended path routine, so that, for a given state of the random number generator, stochastic simulations obtained with extended_path and stoch_simul commands consider the same innovations (when the number of shocks is greater than one). Otherwise the stochastic simulations cannot be compared. 2013-12-17 22:49:37 +01:00
Stéphane Adjemian (Scylla) 6cb18b34fb Added the possibilty to set the initial condition of the (stochastic) extended path simulations with the histval block. 2013-12-11 16:43:15 +01:00
Stéphane Adjemian (Scylla) a51db32145 Copy the generated time series in a dseries object (called Simulated_time_series) in the Base workspace (extended_path). 2013-12-11 10:01:22 +01:00
Stéphane Adjemian (Scylla) 1b57cb4a07 Copy the generated time series in Base workspace (extended_path). 2013-12-09 11:08:08 +01:00
Stéphane Adjemian (Charybdis) cc0d9b42f0 Changed name of options_.maxit as options_.simul.maxit. 2013-10-09 13:06:06 +02:00
Sébastien Villemot 61485ab809 Fix copyright notices 2013-06-12 17:04:46 +02:00
Michel Juillard ebf93d672f stochastic extended path: additional changes 2013-03-12 09:36:58 +01:00
Michel Juillard dd75baa9b4 stochastic extended path: new algorithm with leaner tree, new hybrid
option using second order perturbation correction,
solve_stochastic_perfect_foresight_model.m moves to matlab/ep directory
2013-03-11 16:09:08 +01:00
Stéphane Adjemian (Charybdis) f42446033c Compute tensorial grid (based on a univariate gauss hermite quadrature) for future shocks by default. 2012-11-29 12:56:01 +01:00
Stéphane Adjemian (Charybdis) 5c0d387c4f Cosmetic change. Changed the organization of options for (stochastic) extended path 2012-11-29 12:56:01 +01:00
Stéphane Adjemian (Charybdis) 63157949ca Removed useless routine. 2012-11-29 12:56:00 +01:00
Stéphane Adjemian (Charybdis) e9c552c436 Initialize pfm structure in a new routine (setup_stochastic_perfect_foresight_model_solver). 2012-11-29 12:56:00 +01:00
Sébastien Villemot 1f9cea669a Update copyright notices 2012-06-08 18:22:34 +02:00
Houtan Bastani 08b9d1c8b3 fix function name 2012-06-08 16:25:22 +02:00
Stéphane Adjemian (Charybdis) 75675d3677 Code simplification, do not pass endo_simul and exo_simul to bytecode through the global structure oo_. 2012-03-12 10:34:28 +01:00
Stéphane Adjemian (Charybdis) d995234003 Fixed bugs. 2012-03-08 12:49:17 +01:00
Michel Juillard d64817437e now extended_path with order = 0 calls solve_perfect_foresight_model()
and order ~= 0 solve_stochastic_perfect_foresight_model().
checking only first period of simulation for convergence when checking horizon
2012-03-05 12:35:55 +01:00
Stéphane Adjemian (Charybdis) 859335b34f Fixed bug in extended path routine (appearing when some innovations have zero variance). 2012-03-04 22:12:58 +01:00
Stéphane Adjemian (Charybdis) 192b5c7113 Fixed bugs in routines related to the extended path algorithm. 2012-03-04 22:09:18 +01:00
Michel Juillard bad8746e77 corrected bugs in extended path. The code works now with
./tests/ep/linear.mod
2012-03-04 20:59:57 +01:00
Michel Juillard 3564eca525 new version of solve_stochastic_perfect_foresight_model; doesn't work yet 2012-02-11 14:59:51 +01:00
Stéphane Adjemian (Charybdis) 6c9eeec7e5 Removed codes related to stochastic extended path. 2012-02-10 19:05:50 +01:00
Michel Juillard 44b03e5f19 modifying extended-path for parallel toolbox 2012-02-07 16:31:57 +01:00
Stéphane Adjemian (Charybdis) 9dfc0d5c08 Added calls to matlab implementation of the perfect foresight solver in homotopic routine (extended path approach). 2012-02-04 18:52:03 +01:00
Stéphane Adjemian (Charybdis) 704b0c9659 Added an option specifying if the bytecode solver has to be used first. 2012-02-04 16:26:22 +01:00
Stéphane Adjemian (Charybdis) 8a35ee7363 Added an option to skip the test on the number of periods over which the perfect foresight models are solved. 2012-02-04 16:19:15 +01:00
Stéphane Adjemian (Charybdis) 43f46f2886 Removed stability test over the last periods of the perfect foresight solution. 2012-02-03 14:06:35 +01:00
Stéphane Adjemian (Charybdis) 7978070814 Fixed bug. 2012-02-03 12:52:37 +01:00
Stéphane Adjemian (Charybdis) fed2e229e5 Try first Ferhat's code and if it fails try the matlab's implementation of the the perfect foresight model solver. 2012-02-03 12:39:48 +01:00
Stéphane Adjemian (Charybdis) ac54f7f528 Added comments and the possibility to use a matlab implementation of the perfect foresight model solver. 2012-02-03 11:25:03 +01:00
Stéphane Adjemian (Charybdis) 6328a44f33 Streamlined extended paths routines.
*  Removed the  necessity (for  the  user) to  run stoch_simul  bebore
executing the exetended path routine (when options_.init>0).

*  The  value  of  options_.ep.init  defines the  mix  (used  for  the
initialization of  the perfect foresight solver)  between the previous
perfect foresight  solution and  the path obtained  with an  order one
perturbation approach.

* Removed timing related statements.

*  Changed homotopy set-up  for stochastic  extended path:  add future
multivariate innovations one by one.

* Endogeneously increase step_length in the homotopy routine.

* Removed homotopy_2 related code.
2012-01-27 18:27:42 +01:00
Stéphane Adjemian (Charybdis) 5e87dfcd0f Prevent homotopy routine to enter in the second loop (doi not (re)start the homotopy from weight=0). 2012-01-23 13:59:25 +01:00
Stéphane Adjemian (Charybdis) 9abb2e9ff8 Adapted homotopy routine to SEP. 2012-01-23 13:57:30 +01:00
Stéphane Adjemian (Charybdis) 02d6987685 Fixed bug in EP algorithm. 2012-01-23 13:56:46 +01:00
Michel Juillard 62b1ed7923 correcting bug in extended path and added a test 2012-01-21 17:50:11 +01:00
Stéphane Adjemian (Charybdis) 692708859e Fixed bug. 2012-01-21 14:40:27 +01:00
Stéphane Adjemian (Charybdis) f63ce01859 Put debug and memory modes in options_.ep. 2012-01-21 14:13:31 +01:00
Stéphane Adjemian (Charybdis) 651c5e7fba Fixed bug (wrong index variable). 2012-01-21 14:12:05 +01:00
Stéphane Adjemian (Charybdis) 0d8371c299 Added an option to track the expectation in the (S)EP approach. 2012-01-20 18:43:34 +01:00
Stéphane Adjemian (Charybdis) 58f4feb6ad Cosmetic change + Added scramble mode (possibility to add noise in the future). 2012-01-20 16:40:17 +01:00
Stéphane Adjemian (Charybdis) 1ba89be300 Undo last commit#3dc015592c9da527f7d2ad218bc53422ac7edc83. 2012-01-11 17:10:24 +01:00
Stéphane Adjemian (Charybdis) 3dc015592c Cosmetic change. Removed useless input argument to dyn_waitbar. 2012-01-11 16:08:24 +01:00
Stéphane Adjemian (Charybdis) f074679f14 Code factorization. Use dyn_waitbar in extended_path routine. 2012-01-11 16:01:24 +01:00
Stéphane Adjemian (Charybdis) 29cf9c4113 Removed the display of the first lines of oo_.exo_simul (extended path simulations). 2011-12-26 17:46:48 +01:00
Stéphane Adjemian (Charybdis) 3e84e333b4 Changed verbosity options (fast deterministic simulations). Default is options_.verbosity==1. 2011-12-26 17:46:48 +01:00
Stéphane Adjemian (Charybdis) ecfc5bbbc9 Removed nonsensic options (for the evaluation of the expectations). 2011-12-26 11:53:08 +01:00
Stéphane Adjemian (Charybdis) e2f69ab4fc Added arbitrary order of approximation for the Stochastic Extended Path approach.
Default is that we only consider shocks in t+1 to approximate the expectations. If
options_.ep.stochastic.order is set to s>1, shocks in t+1, t+2, ..., t+s are
considered. Obviously the (tensorial) tree of future shocks is growing
exponentially.

Other numerical rules of integration have to be added...
2011-12-23 17:57:41 +01:00
Stéphane Adjemian (Charybdis) 744f3fd41b Added Stochastic Extended Path method (SEP). 2011-12-19 18:04:54 +01:00
Stéphane Adjemian (Charybdis) 857eb7438f Added provisions for future shocks (using Gaussian quadratures). 2011-12-16 11:42:03 +01:00
Stéphane Adjemian (Charybdis) 8fa4bfc160 Cosmetic change. 2011-12-16 11:42:03 +01:00
Stéphane Adjemian (Charybdis) 230e787b27 Fixed bug. The seed has to be set before the sampling of the structural innovations. 2011-12-16 11:42:03 +01:00
Stéphane Adjemian (Charybdis) 95fb57b4e9 Added waitbar for EP simulations. 2011-12-12 14:20:14 +01:00