Palgrave Handbook of Econometrics: Applied Econometrics

(Grace) #1
David T. Jacho-Chávez and Pravin K. Trivedi 789

called a kernel, provides the necessary weights, and a smoothing parameter, known
as the bandwidth, defines how close observations are to each other. A very compre-
hensive introduction to such methods can be found in Pagan and Ullah (1999), Li
and Racine (2007), Yatchew (2003) and Racine and Ullah (2006). Kernel methods
are by nature computationally intensive. The number of operations necessary for
their application grows exponentially with the number of data points and variables
used. In this section we illustrate with real data the computational issues aris-
ing from the implementation of kernel smoothing in applied non/semiparametric
analysis of cross section information. Unless otherwise stated, all calculations were
performed using thenpandgamlibraries of Hayfield and Racine (2007) and Hastie
(2006) respectively, written inRversion 2.4.1 or above. We use a Pentium IV (HT)
processor, running at 3.20 GHz.


15.4.1 Nonparametric estimation


For two particular points,xi=[xci,xdi]andxj=[xcj,xdj], let us define the functions:


K(xci,xcj;h)=

∏q^1

l= 1

1
hl
k



xli−xlj
hl


⎠, (15.11)

L(xdi,xdj;λ)=

∏q^2

l= 1

l(xli,xlj;λl), (15.12)

whereiindexes the “estimation data” andjthe “evaluation data,” which are
typically the same. The kernel function∫ k(·)for continuous variables satisfies
k(u)du=1 and some other regularity conditions depending on its order,p,


andh=[h 1 ,...,hq 1 ]$is a vector of smoothing parameters satisfyinghs→0as
n→∞fors=1,...,q 1. Similarly, the kernel functionl(·)for discrete variables lies


between 0 and 1, andλ=


[
λ 1 ,...,λq 2

]$
is a vector of smoothing parameters such
thatλs∈[0, 1], andλs→0asn→∞fors=1,...,q 2 (see, e.g., Li and Racine, 2003).
Functions (15.11) and (15.12) are the building blocks of kernel smoothing.
For example, the Nadaraya–Watson estimator ofm(·)evaluated atxjiŝm(xj)=
∑n
i=1,i =jyiK(x


c
i,x

c
j;h)L(x

d
i,x

d
j;λ)/

∑n
i=1,i =jK(x

c
i,x

c
j;h)×L(x

d
i,x

d
j;λ).

15.4.1.1 Example: kernel density estimation


The marginal density function ofxcan be estimated at evaluation pointxias:


̂f(xj)=(n− 1 )−^1
∑n

i= 1

K(xci,xcj;h)×L(xdi,xdj;λ). (15.13)

We are interested in estimating the density of the average annual earnings in 1988
(measured in 1982 US dollars) of a random sample from two age groups: 19–26
(1,109 observations) and 30–32 (1,479 observations). This sample is a sub-set of a
larger dataset considered in Mills and Zandvakili (1997). In this case,q 1 =1 and
q 2 =0, and algorithm 15.4.1.1.1 illustrates the necessary steps.

Free download pdf