Stata Command: kotlarski

Stata Command: kotlarski.ado

The "deconvolution" identifies the distribution of Xi even if Xi is not observed, but with two measurements X1i and X2i of Xi with measurement errors e1i = X1i - Xi and e2i = X2i - Xi, respectively. The graph below depicts a deconvolution kernel density estimate for the distribution of total factor productivity (TFP), ω1982,i, of Chilean firms in the food industry in 1982 along with its 95% uniform confidence band. The residuals of production functions in 1982 and 1983 are r1982,i = ω1982,i + ε1982,i. and r1983,i = ω1983,i + ε1983,i = ω1982,i + η1983,i + ε1983,i, where ω denotes productivity, η denotes a productivity shock, and ε denotes an idiosyncratic shock. Therefore, X1i = r1982,i and X2i = r1983,i serve as repeated measurement for Xi = ω1982,i with measurement errors, e1i = ε1982,i and e2i = η1983,i + ε1983,i, respectively. The graph is automatically produced by the Stata command kotlarski as follows:

Installation:

. ssc install kotlarski

Usage:

. kotlarski x1982 x1983, domain(4)

Help:

. help kotlarski

Reference: Kato, K., Y. Sasaki, and T. Ura (2021) Robust Inference in Deconvolution. Quantitative Economics, 12 (1), pp. 109-142. Paper

Title
kotlarski -- Executes deconvolution kernel density estimation and a robust construction of its uniform confidence band.

Syntax
kotlarski x1 x2 [if] [in] [, numx(real) domain(real) cover(real) tp(real) order(real) grid(real)]

Description
kotlarski executes deconvolution kernel density estimation and a robust construction of its uniform confidence band based on Kato, Sasaki, and Ura (2021). The command requires as input two measurements, x1 and x2, of the unobserved latent variable x with classical measurement errors, e1 = x1 - x and e2 = x2 - x, respectively. The output consists of a dec on kernel density estimate of f(x) and their uniform confidence band over a domain of x.
FAQ: Why do kotlarski x1 x2 and kotlarski x2 x1 produce different results? Answer: This is because Kotlarski's identity treats x1 and x2 asymmetrically in that x1 is assumed to have the zero mean of its measurement error, while x2 is not. See Assumption 1 in Kato, Sasaki, and Ura (2021).

Options
numx(real) sets the number of grid points of x for deconvolution kernel density estimation and its uniform confidence band. The default value is numx(20).
domain(real) sets the domain of deconvolution kernel density estimation and its uniform confidence band. The default value domain(2) defines the domain as +/- 2 standard deviations of x.
cover(real) sets the nominal uniform coverage probability for the uniform confidence band. The default value cover(0.95) constructs a 95% uniform confidence band.
tp(real) sets the scale-normalized tuning parameter. Not invoking this option will entail an optimal choice of the tuning parameter.
order(real) sets the order q of the Hermite polynomial basis. The default value is order(2).
grid(real) sets the size L of grid in the frequency domain. The default value is grid(50).

Examples
(x1982 first measurement of x, x1983 second measurement of x)
Constructing a uniform confidence band in the domain corresponding to +/- 4 standard deviations of x:
. use "example_1982_1983.dta" . kotlarski x1982 x1983, domain(4)
Construction of a 90% uniform confidence band:
. use "example_1982_1983.dta" . kotlarski x1982 x1983, domain(4) cover(0.90)

Stored results
kotlarski stores the following in e():
Scalars r(N) observations r(h) tuning parameter r(q) order of Hermite polynomial basis r(L) grid size in frequency domain
Macros r(cmd) kotlarski
Matrices r(x) vector of x r(fx) vector of density values r(lower) confidence band (lower boundary) r(upper) confidence band (upper boundary)

Reference
Kato, K., Y. Sasaki., and T. Ura 2021. Robust Inference in Deconvolution. Quantitative Economics, 12 (1), pp. 109-142. Link to Paper

Authors
Kengo Kato, Cornell University, Ithaca, NY. Yuya Sasaki, Vanderbilt University, Nashville, TN. Takuya Ura, University of California, Davis, CA.