Can Dynare solve general equilibrium (GE) models with non-convex adjustment costs? I know that Dynare (which sits on top of Matlab) can solve many kinds of dynamic stochastic general equilibrium (DSGE) and overlapping generations (OLG) models. I also know that Dynare can handle some sorts of adjustment costs. For example, I have seen convex adjustment cost examples in Dynare. In particular, The Macroeconomic Model Data Base provides on the order of 50 models compatible with Dynare and the user manual indicates several models (e.g. NK_IR04 and US_NFED0) with quadratic (a type of convex) adjustment costs. 

Can Dynare solve models with non-convex adjustment costs like An equilibrium model of lumpy housing investment (Iacoviello and Pavan (2008)) or Housing and debt over the life cycle and over the business cycle (Iacoviello and Pavan (2013))? Non-convex has a specific mathematical meaning, but in the context of these papers it indicates that adjustment costs that are not proportional to the amount of adjustment. Instead, the adjustment costs have a fixed-cost proportional to the current asset value.  However, there are other forms of non-convex adjustment cost. If Dynare can solve any model with any sort of non-convex adjustment costs that is of interest. 

If models with these adjustment costs can be solved with Dynare, please provide an example or a link to an example (if possible).  If Dynare currently cannot solve these models is there any published code that can do so? Even sample code for a specific model solution rather than a general product like Dynare would be helpful.  

More details on non-convex adjustment costs: 

I draw my language here from a 
A Model of Housing in the Presence of Adjustment Costs: A Structural Interpretation of Habit Persistence (Flavin and Nakagawa (2008)) 


  At the instant the house is sold, the household pays a transactions
  cost proportional to the value of the house sold, so that wealth also
  changes discontinuously....The housing model developed in Section I
  invokes a fourth set of assumptions: utility depends nonseparably on
  nondurable consumption and on housing, nondurable consumption is
  costlessly adjustable, but housing is subject to a nonconvex
  adjustment cost ($\lambda &gt; 0 $).


Perhaps this language is non-standard but that's a quote from a paper in the AER, and when I've discussed it with others people seem to know what I'm talking about. The two mentioned papers don't use that language but do have the same rough form, that transaction costs are not increasing in the degree of the adjustment but rather that any use of adjustment (other than a small bit, perhaps for depreciation or unit improvement perhaps) triggers a cost related to the state variables instead of the control variables. The paper On the Nature of Capital Adjustment Costs (Cooper and Haltiwanger (2005)) seems to use nonconvex adjustment costs in the same way in a firm capital setting. 


  Building upon the analysis of Abel and Eberly [1999], Cooper,
  Haltiwanger and Power [1999] and Caballero and Engel [1999], during
  periods of investment plants incur a fixed adjustment cost. Generally,
  these non-convex costs of adjustment are intended to capture
  indivisibilities in capital, increasing returns to the installation of
  new capital and increasing returns to retraining and restructuring of
  production activity. These fixed adjustment costs represent the need
  for plant restructuring, worker retraining and organizational
  restructuring during periods of intensive investment
Short answer: no.

Dynare, and linearization/perturbation methods in general, are designed for solving


smooth models
approximated around a single point in state space (the steady state).


A model with fixed cost is typically non-smooth, and its behavior away from the steady state may be very different, if e.g. the firm switches from investing to not investing. On the most practical level, a model with fixed cost will typically include equation such as

$$
V = \max \left\{ V^{\text{invest}}, V^{\text{not invest}} \right\},
$$

which cannot be entered into Dynare, because max operator is not supported. On the other hand, first order conditions for convex (e.g. quadratic) adjustment cost are still smooth (one simply adds additional terms to Euler equation for investment) and thus can be easily solved with Dynare.

To actually compute optimal policy with fixed costs, one has typically to use global method, e.g. value function iteration. I'm not aware of any standardized toolbox for solving such problems, so you may need to code your own.

PS: there are some modelling tricks that make the problem smoother, typically in a setting with many, possibly heterogeneous agents/firms. For example, Thomas (2002) keeps track of number of firms depending on how long they didn't invest, and solves the model with standard linearization on this extended state space. Khan &amp; Thomas (2007) assume that the fixed cost is random and iid over time and across firms, so one can average over the realization of fixed cost to obtain smooth value functions. Miao &amp; Wang (2014) use a similar approach in a model with constant returns to scale and show how it aggregates to a version of representative-firm model with only convex adjustment costs.