Extracted main text — title through conclusion, appendix excluded. This is what our citation measures are computed over, published so the extraction can be checked by eye.
67,642 characters · 20 sections · 11 citation commands
Calibrated Projection in MATLAB: Users' Manual
\doublespacing
This manual details the structure of the Calibrated Projection Interval (CPI) algorithm and \code{MATLAB} Package. It accompanies the paper “Confidence Intervals for Projections of Partially Identified Parameters” kaido2017confidence and it assumes familiarity with that paper.\footnote{Some notation differs between this paper and kaido2017confidence. This is made clear throughout this manual. Unless otherwise specified, we use notation from the earlier version of the paper kaido2016confidence. The table numbering references kaido2017confidence.} The CPI algorithm uses an EAM (evaluate, approximate, maximize) algorithm to solve:
where $\hat c(\theta)$ is the calibrated critical value jones1998efficient,jones2001taxonomy. This version of the CPI algorithm is optimized for basis projection $p = (0,\cdots,0,1,0,\cdots,0)$ with hyperrectangle parameter constraints $\Theta = \{\theta \in \mathbb{R}^d: \theta_{LB} \leq \theta \leq \theta_{UB}\}$. We also allow for $p$ to be in the unit sphere and polytope constraints on the parameter space, so that $\Theta = \{\theta \in \mathbb{R}^d: \theta_{LB} \leq \theta \leq \theta_{UB}, A_{\theta} \theta \leq b_{\theta}\}$. Additional care is required within these extensions (see Appendix (ref) for further details). The current version of the package is written for moment (in)equalities that are separable in data $W$ and parameter $\theta$, so that $E_P[m_j(W_i,\theta)] = E_P[f_j(W_i)] + g_j(\theta)$.\footnote{In this manual and in the CPI MATLAB package data is defined as $W$. The function $f$ and $g$ are the two components of the separable moment (in)equality $E_P[m_j(W_i,\theta)]$. This is in contrast to \citeA{kaido2017confidence}, where data is $X$, $f(\theta)$ refers to the objective function, and $\bar g(\theta)$ appears in the EAM algorithm. The subscript $n$ has also been dropped from all estimators.} Future releases of the package will include:
We have structured the code so that it is portable. In order to implement a user-specified model, the user needs only input the data, algorithm options, the function that defines the estimators for the moment (in)equalities, as well as the gradients and standard deviation estimators of the moment functions. Section (ref) details how to use the portable code with a user-specified partially identified model with separable moment inequalities. Section (ref) also provides instructions on how to replicate the simulations in \citeA{kaido2017confidence}. Section (ref) provides a deeper insight into how the CPI algorithm is structured. Section (ref) discusses extensions to the algorithm and concludes.
In this section we detail the steps required to run the simulations in \citeA{kaido2017confidence}, and how to run a user-specified model. We use as a working example the Entry Game Model in Section 5 of \citeA{kaido2017confidence}. This section is organized as follows. Section (ref) briefly describes the key files in the package. Section (ref) details how to set up \code{CVXGEN} and \code{CVX}, both are fast disciplined convex solvers that we use to compute the calibrated critical value $\hat c(\theta)$ mattingley2012cvxgen,cvx,gb08. Section (ref) provides instructions on how to replicate the simulations to reproduce the tables in \citeA{kaido2017confidence}. Section (ref) provides instructions on how to implement a user-specified model and compute Projection Intervals (either Calibrated or Andrew and Soares (AS) andrews2010inference) using the CPI algorithm.
First, we briefly describe the key \code{MATLAB} files and folders.
The package assumes that the moment (in)equalities are separable, so that $E_P[m_j(W_i,\theta)] = E_P[f_j(W_i)] + g_j(\theta)$.
The disciplined convex solver \code{CVXGEN} is used to check whether the set \[ \Lambda^b(\theta,\rho,c) = \{ \lambda \in \sqrt{n}(\Theta-\theta) \cap \rho B^d : \mathbb{G}^b_{j} + D_{\theta}g_j(\theta)\lambda + \varphi_j(\hat \xi_{j}(\theta)) \leq c, j = 1,\cdots,J\} \] is empty for each bootstrap repetition $b = 1,\cdots,B$. In order to run \code{CVXGEN}, the user first compiles a \code{MEX} file that defines the parameters of the problem (details in Section (ref)).
The calibrated critical value $\hat c(\theta)$ is computed using a fixed-point algorithm. The fixed-point mapping is computed by checking whether the following set is empty:
This amounts to solving many linear programs (LP), which is done using the fast disciplined convex solver \code{CVXGEN} mattingley2012cvxgen or \code{CVX} cvx,gb08.
To set up \code{CVXGEN}, the user needs to: 1) install a \code{MEX} Compiler; 2) generate \code{C} code at \url{https://cvxgen.com}; 3) compile and save the \code{MEX} file; 4) Instruct the CPI algorithm to use \code{CVXGEN} rather than \code{CVX}.
The first step is to install a \code{MEX} compiler. We use the \code{MinGW-w64 Compiler} on a Windows machine, which is an add-on in \code{MATLAB}. To install: open \code{MATLAB}, go to \code{Home} tab, go to \code{Add-Ons}. An add-on search window appears on the screen. Search \code{MinGW-w64 Compiler} and install \code{MATLAB Support for MinGW-w64 C/C++ Compiler v}. On a Mac, a \code{C} compiler is supplied with \code{Xcode}. On a Linux based system, one can use \code{GCC} (GNU Compiler Collection).
The next step is to generate the \code{C} code for a specific problem. First, create an account at \url{https://cvxgen.com} and log in. Next, navigate to the \code{edit} tab under \code{problem}. Copy-and-paste the following:
Replace \code{XX} with the dimension of the parameter $\theta$, \code{YY} with the number of moment inequalities, \code{ZZ} with the number of moment equalities (do not double count $E_P[m_j(W_i,\theta)] \leq 0$ and $-E_P[m_j(W_i,\theta)] \leq 0$ here), and \code{VV} with the number of polytope box constraints. If no polytope constraints $A_{\theta} \theta \leq b_{\theta}$ are included, set \code{VV}$=0$.
Next, navigate to the \code{generate C} tab under \code{CODEGEN}. Click \code{Generate code}. As a result, a list of files populate the webpage. Download the \code{cvxgen.zip} file and extract. Run \code{make_csolve.m}. The file \code{csolve.mex64} should appear in the folder (if on a Linux or Mac machine, the extension is slightly different).\footnote{If an error occurs here, it is likely that the \code{MEX} compiler is not installed correctly.} Rename \code{csolve.mex64} to \code{CVXGEN_name.mex64} (where \code{CVXGEN_name} is specified by the user) and move the file to the subfolder \code{\textbackslash CVXGEN}.
Last, set \code{KMSoptions.CVXGEN = 1} to instruct CPI algorithm to use \code{CVXGEN}.
There is an upper bound of $4,000$ non-zero Karush-Kuhn-Tucker matrix entries for the linear program in \code{CVXGEN}. The size of the problem is determined jointly by $J_1$, $J_2$, and $d$. As an example, \code{CVXGEN} can handle $\theta \in \mathbb{R}^{10}$ with $J_1 = 55$ and $J_2 = 55$.
An alternative solver to \code{CVXGEN} is \code{CVX}. This solver is slower than \code{CVXGEN}, but can handle significantly larger LPs and, in our experience, is significantly faster than \code{MATLAB}'s LP solver \code{LINPROG}. \code{CVX} is a \code{MATLAB} “wrapper” for five different disciplined convex solvers cvx,gb08. Among these, the solver \code{MOSEK} is the fastest for our problem. To run \code{CVX} with \code{MOSEK}:
Once \code{CVXGEN} or \code{CVX} is set up, either a simulation model (Section (ref)) or a user-specified model (Section (ref)) can be called via the CPI algorithm.\footnote{For additional help with \code{CVXGEN} or \code{CVX}, please visit \url{https://cvxgen.com} and \url{http://cvxr.com/cvx/}.}
In this section we discuss how to replicate the simulation results in \citeA{kaido2017confidence} (see Tables 1-7 in the paper). As per \code{CVXGEN} policy, we are unable to distribute the \code{MEX} files for these simulations. So the first step is to generate the relevant \code{MEX} files, see Section (ref) for instructions and Table (ref) for \code{CVXGEN} parameters and naming conventions.
The next step is to set parameters in \code{KMS_Simulation.m}. Open an instance of \code{KMS_Simul\-ation.m} and set the following:
Among other things, convergence criteria are set in \code{KMSoptions}. All DGPs other than the correlated error DGP, which is DGP 7, use what we call the baseline options. DGP 7, on the other hand, is a fairly difficult problem to solve. Therefore, we use more stringent convergence criteria for this DGP. The options listed below and, in particular, the contraction rates are discussed in more detail in Section (ref).
The baseline options are:
The stringent options for \code{DGP=7} are:
The number of bootstrap repetitions is also set in \code{KMSoptions.m}. Table 1 sets this number equal to 301, so that \code{KMSoptions.B=301}. For Tables 2-7 set \code{KMSoptions.B=1001}.
Finally, run \code{KMS_Simulation} to run a simulation with the parameters and options specified above. The results are saved in the subfolder \code{\textbackslash Results}.
The file \code{Analysis.m} carries out post analysis for a particular set of simulations. To run the post analysis, load a results file and run \code{Analysis.m}. The output includes the median lower bound for the Calibrated Projection Interval; the median upper bound for the Calibrated Projection Interval; coverage percent at the end points of the identification region, as well as at the true parameter; average $\hat c(\theta)$; and average computational time.
In this section we detail the files that need to be modified so that a user can implement the algorithm to compute the Calibrated Projection Interval for a user-specified problem. We use \code{DGP=6} as a working example (this is the partially-identified Entry Game with zero correlation between the unobservable shocks $u_1$ and $u_2$). For tractability, we have created a working example file \code{ExampleDGP6.m}. Here, we generate one data set with $n=4000$ observations. We assume that the parameter space is a hyperrectangle and $p$ is a basis vector throughout the rest of this section.
The first step is to set up either \code{CVXGEN} or \code{CVX}. This is described in detail in Section (ref). The required parameters are the dimension of the parameter $\theta$, \code{dim_p}, the number of moment inequalities, \code{J1}, and the number of moment equalities, \code{J2}. In our working example, set \code{dim_p} = 8, \code{J1 = 8}, and \code{J2 = 8}. Name the \code{MEX} file as \code{exampleDGP6.mex64} and deposit it in the subfolder \code{\textbackslash CVXGEN}. Set \code{KMSoptions.CVXGEN = 1}. Alternatively, if \code{CVX} is used, follow the installation instructions at the end of Section (ref) and set \code{KMSoptions.CVXGEN = 0}.
The moment (in)equalities are separable so that $E_P[m_j(W_i,\theta)] = E_P[f_j(W_i)] + g_j(\theta)$ for $j=1,\cdots,J$. The estimator for $E_P[f_j(W_i)]$ is defined in the function \code{moments_w.m}. Override the file \code{moments_w.m} with the following shell:
The inputs are data \code{W}, which is $n$-by-$d_W$ and \code{KMSoptions}. The outputs are:
In the shell above, replace \code{XX1} - \code{XX3} with the number of moment inequalities, moment equalities, and paired moment inequalities. Preset each output to the zero vector or the empty set as described above. Last, input user-specified functions for each output.
The model-implied function $g_j(\theta)$ is defined in the function \code{moments_theta.m}. Override \code{moments_theta.m} with the following shell:
The inputs are the $d$-by-$1$ parameter vector \code{theta}, number of moment inequalities \code{J1}, number of moment equalities \code{J2}, and algorithm options \code{KMSoptions}. The outputs are the $J_1$-by-$1$ vector of moment inequalities \code{g_ineq} and the $2J_2$-by-$1$ vector of moment equalities \code{g_eq}, where entries $j=1,\cdots,J_2$ of \code{g_eq} correspond to $E_P[m_j(W_i,\theta)] \leq 0$ and entries $j = J_2+1,\cdots,2J_2$ of \code{g_eq} correspond to $-E_P[m_j(W_i,\theta)] \leq 0$.
In the shell above, input user-specified functions for outputs \code{g_ineq} and \code{g_eq}.
As an example, consider \code{DGP=6}. The moment functions are defined on \code{Lines 100-169} in \code{moments_theta.m}. For example, the moment inequality in Equation (5.3) in \citeA{kaido2017confidence} is:
where $x \in \mathcal{X}$ and $p_x$ is the probability of support point $x$ occurring. $G_r(\cdot,\cdot)$ is the Bivariate Gaussian process with correlation $r$. \code{DGP=6} assumes $r=0$, so the moment $g_{j}(\theta)$ can be expressed as: \[ g_{j}(\theta) = -\Phi(-x_1'(\beta_1 + \Delta_1))(1- \Phi(-x_2'\beta_2))p_x, \] where $\Phi(\mu)$ is the univariate Gaussian CDF with mean $\mu$ and variance equal to $1$. Compare to \code{Line 143} in \code{moments_theta.m}:
(The negative of \code{g_ineq} is reported on \code{Line 164} in \code{moments_theta.m} to get the correct sign.)
Under the assumption that the moment functions are separable, the standard deviation does not depend on $\theta$. Specify the standard deviation estimator in the function \code{moments_stdev}. Override \code{moments_stdev.m} with the following shell:
The inputs are: data \code{W}, data-implied moment functions \code{f_ineq} and \code{f_eq}, number of moment (in)equalities \code{J1} and \code{J2}, and a structure of options \code{KMSoptions}. The outputs are the $J_1$-by-$1$ vector of standard deviations for the moment inequalities $\code{f\_stdev\_ineq}$ and the $2J_2$-by-$1$ vector of standard deviations for the moment equalities $\code{f\_stdev\_eq}$.
For \code{DGP=6}, the estimator for $\sigma_j(W_i)$ is
Compare to \code{Lines 58-59} in \code{moments_stdev.m}:
The CPI algorithm requires that the user specifies gradients of the moment functions. Since the moments are separable, the gradient does not depend on data $W$, so that: \[ \frac{\partial m_j(W,\theta)}{\partial \theta_k} = \frac{\partial g_j(\theta)}{\partial \theta_k}. \] The gradients are specified in the function \code{moments_gradient.m}, and below is a shell for this function:
The inputs are: a $d$-by-$1$ parameter vector $\code{theta}$, the number of moment (in)equalities \code{J1} and \code{J2}, and the structure of options \code{KMSoptions}. The outputs are the $J_1$-by-$d$ matrix of gradients for the moment inequalities \code{Dg_ineq}, where
and the $2 J_2$-by-$d$ matrix of gradients for the moment equalities \code{Dg_eq}, where
As an example, consider the moment inequality in Equation (5.3) \citeA{kaido2017confidence}: \[ g_j(\theta) = - \Phi(-x_1'(\beta_1 + \Delta_1))(1- \Phi(-x_2'\beta_2))p_x. \] The gradients are:
where $\phi(\mu)$ is the univariate Gaussian PDF with mean $\mu$ and variance equal to $1$. Compare to \code{Lines 112-115} in \code{moments_gradient.m}:
Algorithm options are specified in the file \code{KMSoptions.m}. These options should be adjusted for each user-specified model in order to balance computational time and accuracy. The key options are highlighted below.
The following inputs are required:
Finally, the CPI algorithm is called on \code{Lines 114-115} in \code{ExampleDGP6.m}, with the inputs specified below:
In this section we provide an overview of the CPI algorithm. We start with \code{KMS_0_Main}, since this is the function that calls the CPI algorithm. The empirical moments $\hat f_j$, standard deviation $\hat \sigma_j$, and the recentered bootstrap moments $\mathbb{G}_j^b$ do not depend on $\theta$ and can be computed outside of the EAM algorithm. These are computed on \code{Lines 217, 502}, and \code{Lines 438-493} and \code{509-510} in \code{KMS_0_Main}, respectively. The recentered bootstrap moments are denoted \code{G_ineq} and \code{G_eq}.
It is required that the EAM algorithm is initiated with a feasible point, that is, a point $\theta^{\text{feas}} \in \Theta$ satisfying:
The CPI algorithm executes two feasible search algorithms on \code{Lines 565-583} in \code{KMS_0_Main}. The feasible search algorithms are \code{KMS_1_FeasibleSearch.m} and \code{KMS_2_EAM_FeasibleSearch.m}. If a feasible point(s) is supplied by the user, then the algorithm skips this step.
The EAM algorithm is called on \code{Lines 602-635} in \code{KMS_0_Main}. The search direction $p$ is executed first and the search direction $-p$ second. Output including the optimal point $\theta^{*,EAM}$, the calibrated critical value at this point $\hat c(\theta^{*,EAM})$, the expected improvement $EI(\theta^{*,EAM})$, and the convergence time is reported in the structure $\code{KMS\_output}$.
An optional algorithm on \code{Lines 637-676} in \code{KMS_0_Main} is also included (set \\ \code{KMSoptions.direct_solve=1} to run this algorithm). This algorithm solves the problem:
using numerical gradients (the gradient of $\hat c(\theta)$ is unknown). Even for simple problems this algorithm requires a large amount of computational time to find a solution and the solution is often not the global minimizer/maximizer.\footnote{One could specify an analytical gradient function, where the analytical gradients $D_{\theta}g_j(\theta)$ are passed and the numerical gradient for $\hat c(\theta)$ is computed. This is not done in this version of the CPI algorithm.}
Finally, the Calibrated Projection Interval (or AS Projection Interval) is reported on \code{Lines 678-707} in \code{KMS_0_Main}. The feasible search and EAM algorithm is discussed in Sections (ref) and (ref) below. The algorithm that computes $\hat c(\theta)$ is discussed in Section (ref)
The feasible search algorithms \code{KMS_1_FeasibleSearch} and \code{KMS_2_EAM_FeasibleSearch} attempt to find a point $\theta$ satisfying:
The algorithm \code{KMS_1_FeasibleSearch} solves the problem:
Let the minimizer be $\theta^{*,FS1}$. The hope is that $\theta^{*,FS1}$ satisfies the relaxed condition
If $\max_j \sqrt{n} \frac{\hat f_j + g_j(\theta^{*,FS1})}{\hat \sigma_j} \leq 0$, then the condition in Equation (ref) is satisfied since $\hat c(\theta) \geq 0, \forall \theta \in \Theta$.
A MultiStart algorithm is used to solve Problem (ref).\footnote{The solver \code{fmincon} cannot efficiently solve Problem (ref) as written, since the gradient of $ \max_{j=1,\cdots,J}\sqrt{n} \frac{\hat f_j + g(\theta)}{\hat \sigma_j}$ is unknown. By introducing a free parameter $\gamma$, the problem can be re-written so that \code{fmincon} can solve it. See Section (ref).} On \code{Lines 72-78} in \code{KMS_1_Feasible\-Search}, a set of starting points is drawn uniformly from $\Theta$. These starting points are passed to \code{fmincon} (\code{Lines 93-119}). At each solution, the constraint violation is computed on \code{Line 134}. If there is a feasible point (constraint violation = 0), then the feasible point \code{theta_feas} is returned. Otherwise, \code{flag_feas=0} is returned indicating failure to find a feasible point.
If the feasible search algorithm \code{KMS_1_FeasibleSearch} fails, the second feasible search algorithm, \code{KMS_2_EAM_FeasibleSearch}, is executed. It uses an EAM-type algorithm to try to find a feasible point. In particular, \code{Line 86-92} in \code{KMS_2_EAM_FeasibleSearch.m} draws an initial set of points $\theta^{(1)},\cdots,\theta^{(L)}$. The calibrated critical value $\hat c(\theta)$ is computed at each of these points (E-step, \code{Line 109}). If any of these points are feasible, the algorithm is terminated and a feasible point is returned (\code{Line 125-137}). Otherwise, the surface $c_L(\theta)$ is approximated using the kriging method (A-step, \code{Lines 139-144}). Last, the following minimization problem is solved using a MultiStart algorithm:
(M-step, \code{Lines 174-204}). Call the minimizer $\theta^{*,L+1}$. This EAM algorithm is re-iterated with the new set of points $\{\theta^{(l)}\}_{l=1}^L\cup \{\theta^{*,L+1}\}$, and continues until either a feasible point is obtained or the maximum number of iterations \code{KMSoptions.EAM_maxit} is reached.
The EAM algorithm (\code{KMS_3_EAM}) for search direction $q \in \{-p,p\}$ is called on \code{Lines 603-635} in \code{KMS_0_Main.m}. The inputs for the EAM algorithm are:
The outputs are:
The key steps in the EAM algorithm are detailed below.
Initialization: A initial set of points is drawn on \code{Lines 93-99} in \code{KMS_3_EAM}. The set of feasible points \code{theta_feas} is also added to the pool of initial points $\{\theta^{(l)}\}_{l=1}^{L_0}$. The set of points to be evaluated is saved in the $L$-by-$d$ matrix \code{theta_Estep} (where $L = L_0$ on the first iteration).
The following steps are iterated until either the program converges or a preset maximum number of iterations is reached.
E-step, Evaluation: \code{Line 143} in \code{KMS_3_EAM} calls the function \code{KMS_31_Estep}. Within this function, \code{c_Estep} is the $L$-by-$1$ vector of calibrated (or AS) critical values $\hat c(\theta)$ for each $\theta \in \{\theta^{(l)}\}_{l=1}^{L}$; \code{CV_Estep} and \code{maxviol_Estep} are the constraint violation and maximum violation for each $\theta \in \{\theta^{(l)}\}_{l=1}^{L}$, respectively. The subfunctions \code{KMS_31_Estep}, \code{KMS_32_Critval}, and \code{KMS_33_Coverage} are discussed in more detail in Section (ref).
\code{Lines 145-155} in \code{KMS_3_EAM} prepare the matrices \code{theta_Astep} and \code{c_Astep}, which keep track of all points to be passed to the A-step. The kriging model is sensitive if two points $\theta^{(l)}$ and $\theta^{(k)}$ are too close together. Therefore, if two points are too close to one another, only one point is passed to the kriging model, see \code{Line 161} in \code{KMS_3_EAM}.
A-step, Approximation: The surface $\hat c(\theta)$ is approximated via a kriging model. The set of points $ \{\theta^{(l)},\hat c(\theta^{(l)})\}_{l=1}^{L}$ is passed to the kriging function on \code{Line 163} in \code{KMS_3_EAM}. We use the \code{DACE} package lophaven2002dace. The \code{DACE MATLAB} files are saved in the subfolder \code{\textbackslash dace}. The output is the structure \code{dmodel}. The function \code{[c,Dc,mse,Dmse]=predictor(theta,dmodel)} uses the interpolated surface to predict the value of $\hat c(\theta)$ and gradient $D_{\theta} \hat c(\theta)$ at $\theta$. The standard deviation $\hat \zeta s_L(\theta)$ is also estimated and is equal to $\sqrt{\text{\code{mse}}}$.\footnote{For more information and source files for the \code{DACE MATLAB} package, go to \url{http://www2.imm.dtu.dk/projects/dace/}.}
M-step, Maximization: Using the approximated surface $c_L(\theta)$ and standard deviation $\hat \zeta s_L(\theta)$, the next point in the sequence $\{\theta^{(l)}\}_{l=1}^{L}$ is chosen to maximize the expected improvement function:
where
Problem (ref) is solved using a MultiStart algorithm. Three important steps are required to resolve numerical issues with Problem (ref):
The contraction of the parameter space occurs on \code{Lines 200-273} in \code{KMS_3_EAM}, \code{Lines 281-328} draw points, and \code{Lines 336-373} call \code{fmincon}.
Updating and Convergence: The final step in the EAM algorithm is to update the set of points and check convergence criteria. Provided we find a point with positive expected improvement in the M-step, we add both the M-step solution as well as a uniformly-drawn point to the set of evaluation points $\{\theta^{(l)}\}_{l=1}^L$. We also add two points, $\theta_{\epsilon_1}$ and $\theta_{\epsilon_2}$ that are close to $\theta^{*,L}$ and satisfy $q'\theta_{\epsilon_k} > q' \theta^{*,L}$. The distance between $\theta_{\epsilon_k}$ and $\theta^{*,L}$ is determined by the option \code{KMSoptions.h_rate2}. See \code{Lines 430-439} in \code{KMS_3_EAM}.
The convergence check occurs on \code{Lines 464-485} in \code{KMS_3_EAM}. We first check if $\theta^{*,L}$ is too close to the boundary of $\Theta$. If $|p' \theta^{*,L} - p' \theta_{UB}| < 10^{-4}$ (for search direction $p$), then a warning that the parameter is on the boundary is displayed and we output $\theta^{*,\text{EAM}} = \theta^{*,L}$. Otherwise, if all of the following conditions are satisfied, we say that the EAM algorithm has converged, and we output $\theta^{*,\text{EAM}} = \theta^{*,L}$.
Last, the contraction counter is updated (\code{Lines 487-494}). If $|q'\theta^{*,L} - q'\theta^{*,L-1}| < 1 \times 10^{-6}$ (so that no progress is made between this iteration and the previous iteration), then the contraction counter is increased by one: \code{counter = counter + 1}. If the contraction counter is positive and $\theta^{*,L}$ is too close to the contracted parameter space the contraction counter is decreased by one: \code{counter = counter - 1}.
This section explains in detail how to compute the calibrated critical value $\hat{c}(\theta)$:
where $P^*$ is the bootstrap empirical frequency. The relevant \code{MATLAB} files are: \code{KMS_31_Estep.m}, \code{KMS_32_Critval.m}, and \code{KMS_33_Coverage.m}. For a given $\theta \in \Theta$, $P^*(\Lambda^b (\theta ,\rho ,c)\cap \{p^{\prime }\lambda =0\}\neq \emptyset)$ increases in $c$ (with $\Lambda^b (\theta ,\rho ,c)$ defined in Equation (ref)), and so $\hat c(\theta)$ can be quickly computed via a root-finding algorithm, such as the Brent-Dekker Method (BDM), see \citeA{brent1971algorithm} and \citeA{dekker1969finding}. To do so, define $\Psi_{\alpha}(c) = \frac{1}{B} \sum_{b=1}^B \psi_b(c) - (1-\alpha)$ where \[ \psi_b(c(\theta)) = \mathbf{1}(\Lambda^b(\theta,\rho,c) \cap \{p'\lambda = 0\}\neq \emptyset). \] Let $\bar c(\theta)$ be an upper bound on $\hat c(\theta)$, for example, the asymptotic Bonferroni bound $\bar c(\theta) \equiv \Phi^{-1}(1-\alpha/J)$. It remains to find $\hat c(\theta)$ such that $\Psi_{\alpha}(\hat c(\theta)) = 0$ when $\Psi_{\alpha}(0)\leq 0$. It is possible that $\Psi_{\alpha}(0) > 0$ in which case we output $\hat c(\theta) = 0$. Otherwise, we use BDM to find the unique root to $\Psi_{\alpha}(c)$ on $[0,\bar c(\theta)]$ where, by construction, $\Psi_{\alpha}(\bar c(\theta)) \geq 0$. We propose the following algorithm:
Step 0 (Initialize)
Step 1 (Method Selection)
Use the BDM rule to select the updated value of $c$, say $c_2$. The value is updated using one of three methods: Inverse Quadratic Interpolation, Secant, or Bisection. The selection rule is based on the values of $c_{i}$, $i=-2,-1,0,1$ and the corresponding function values.
Step 2 (Update Value Function)
Update the value of $\Psi_{\alpha}(c_2)$. We can exploit the previous computation and monotonicity of the function $\psi_b(c_2)$ to reduce computational time:
Step 3 (Update)
Step 4 (Convergence)
The computationally difficult part of the algorithm is computing $\psi_b(\cdot)$ in Step 2. This is simplified for two reasons. First, evaluation of $\psi_b(c)$ entails determining whether a constraint set comprised of $J+2d+2$ linear inequalities in $d$ variables is feasible. This can be accomplished by efficiently employing \code{CVXGEN} or \code{CVX}. Second, we exploit monotonicity in $\psi_b(\cdot)$ to reduce the number of linear programs needed to be solved.
The file \code{KMS_31_Estep} fixes $\theta$ and computes the GMS function $\varphi(\hat \xi_j(\theta))$ and gradients $D_{\theta}g_j(\theta)$; \code{KMS_32_Critval} executes the BDM algorithm; and \code{KMS_33_Coverage} computes $\psi_b(c)$ for $b=1,\cdots,B$.
We have described how to implement the CPI algorithm to solve
One difficulty in solving this problem is that $\hat c(\theta)$ is a “black-box function” with an unknown gradient. Directly solving this problem using \code{fmincon} with numerical gradients is slow and can return local solutions that are far from the global solution(s). The EAM algorithm is employed to solve this problem. This manual and \code{MATLAB} package can serve as a guide on how to implement the EAM algorithm to solve other black-box functions, provided sufficient continuity assumptions hold.
In the next release of the \code{MATLAB} package, we will allow for non-separability of the moment (in)equalities. Additional numerical issues are presented in this case. The estimator for the moment function, the estimator for the standard deviation, and the bootstrap need to be recomputed at each visit of $\theta \in \Theta$ in the EAM algorithm. The gradients of the moment functions also depend on the data, so this adds additional numerical complexity in the optimization routine.
Another feature we plan to incorporate is an objective function $h(\theta)$ in Equation (ref) that is not necessarily equal to $p'\theta$. The objective function, for example, could be a welfare function from a partially identified model that is parameterized by $\theta$ (for example, see \citeA{Barseghyan2017}). Consequently, the welfare function is also partially identified. Using the CPI algorithm one can obtain uniformly valid bounds on the function $h(\theta)$. Modifications to the feasible search, fixed-point algorithm, and M-step are required.