This document describes codes used in replicating the results of “The Paradox of Price Flexibility in an Open Economy” in RED. The codes have been tested in MATLAB R2022b. *********** Configuration *********** For computation and drawing the figures, we use two toolkits: (1) Eggertsson et al. toolkit for solving ZLB of stochastic duration, and (2) subaxis program, where citation and copyright are given below. Citation and Copyright: (1) Gauti B. Eggertsson, Sergey K. Egiev, Alessandro Lin, Josef Platzer, Luca Riva, A toolkit for solving models with a lower bound on interest rates of stochastic duration, Review of Economic Dynamics, Volume 41, 2021, Pages 121-173,ISSN 1094-2025, https://doi.org/10.1016/j.red.2021.04.001. (2) Copyright (c) 2014, Aslak Grinsted All rights reserved. *********** Codes ************* Codes are stored in several different folders. 1. The codes for Figures 1-7 (which correspond to figures in Section 3 and 4.1) are in the "Section3&4.1" folder. The "Command.m" file replicates Figures 1 - 7 in the paper and calls subroutines: a. "do_baseline.m": computes the equilibrium under the monetary policy rule (12) (see section 2.4). b. "do_OPT": computes the optimal discretionary policy and is required to initiate Eggertsson et al.'s toolkit. c. "equations.m": gives numbers to the model equations and is required to initiate Eggertsson et al.'s toolkit. d. "matrices.m": constructs the coefficient matrices of the model equations and is required to initiate Eggertsson et al.'s toolkit. e. "variables.m": gives numbers to the model variables and is required to initiate Eggertsson et al.'s toolkit. f. "parameters.m": sets model parameters and is required to initiate Eggertsson et al.'s toolkit. 2. The codes for Figures 8 and 9 are in the "Section4.2(MU)" folder. The "Command.m" file replicates Figure 8 - 9 in the paper. In addition to the subroutines defined above for the "Section3&4.1" folder, this script calls: a. "wloss.m":calculates the expected welfare loss implied by quadratic loss. 3. Figure 10 code can be found in the "Section4.2(Peg)" folder. The "Command.m" file replicates Figure 10 in the paper. The subroutines are defined similarly to those of the "Section3&4.1" folder. 4. The codes for Figures 11 and 12 can be found in the "Section5" folder. The "Command.m" file replicates Figures 11 and 12 in the paper. In addition to the subroutines defined above for the "Section3&4.1" folder, this script calls: a. "do_OCP": computes the optimal discretionary policy and is required to initiate Eggertsson et al.'s toolkit. 5. The codes for Figures A.1-A.3 can be found in the "Appendix" folder. The "Command.m" file in the "Appendix" folder replicates Figure A.1 and A.3. The "Command.m" file in the "Appendix\Figure A.2\Panel 1" folder replicates Figure A.2(a). The "Command.m" file in the "Appendix\Figure A.2\Panel 2" folder replicates Figure A.2(b).