tr t r tr t s

tr t rtr ts - PowerPoint PPT Presentation

tr t rtr ts trt rtr stt s t stt


  1. ■♥tr♦ t♦ ♥♦♥✲♣❛r❛♠❡tr✐❝ ♠❡t❤♦❞s ✶✴✸✹

  2. ■♥tr♦❞✉❝t✐♦♥ ◆♦♥✲♣❛r❛♠❡tr✐❝ ❡st✐♠❛t✐♦♥ ❛✐♠s t♦ ❡st✐♠❛t❡ ❛♥ ✉♥❦♥♦✇♥ q✉❛♥t✐t② ✇❤✐❧❡ ♠❛❦✐♥❣ ❛s ❢❡✇ ❛ss✉♠♣t✐♦♥s ❛s ♣♦ss✐❜❧❡ ✭❛❜♦✉t t❤❡ ❞❛t❛ ❣❡♥❡r❛t✐♥❣ ♣r♦❝❡ss✮ ❲❡ ✇✐❧❧ ❧♦♦❦ ❛t t❤❡ ❢♦❧❧♦✇✐♥❣ ◮ ❞❡♥s✐t② ❡st✐♠❛t✐♦♥ ◮ r❡❣r❡ss✐♦♥ ◮ ❧♦❝❛❧ ❝♦♥st❛♥t ◮ ❧♦❝❛❧ ❧✐♥❡❛r ◆♦♥✲♣❛r❛♠❡tr✐❝ ♠❡t❤♦❞s ❛r❡ ❧♦❝❛❧ ❛✈❡r❛❣✐♥❣ ♠❡t❤♦❞s ❑❡② ❝♦♥❝❡r♥✿ ❤♦✇ t♦ ❞❡✜♥❡ ✧❧♦❝❛❧✧ ✷✴✸✹

  3. ◆♦♥✲♣❛r❛♠❡tr✐❝ ❞❡♥s✐t② ❡st✐♠❛t✐♦♥ ❊①❛♠♣❧❡ 0.0004 0.0004 0.0003 0.0003 Density Density 0.0002 0.0002 0.0001 0.0001 0.0000 0.0000 2000 4000 6000 8000 10000 2000 4000 6000 8000 10000 expenditure per pupil expenditure per pupil 0.0004 0.0004 0.0003 0.0003 Density Density 0.0002 0.0002 0.0001 0.0001 0.0000 0.0000 0 2000 4000 6000 8000 10000 2000 4000 6000 8000 10000 expenditure per pupil expenditure per pupil ✸✴✸✹

  4. Nonparametm'c Density and Regression Estimation 15 Figure 2 ◆♦♥✲♣❛r❛♠❡tr✐❝ ❞❡♥s✐t② ❡st✐♠❛t✐♦♥ Doubts About the Doubs: Bertillon's Histogram of the Heights of 9,002 Conscripts ❍✐st♦❣r❛♠ from Doubs Height in Inches ✹✴✸✹ where the function I(.) is equal to one if the statement is true and zero otherwise, and x, represents the bin midpoint. Once it is written this way, the problem with the histogram becomes clearer. The shape of the histogram can potentially be influenced by where you place the bin centers. Moreover, with a histogram, choosing the width of the bins and the location of the first bin also determines the choice of bin centers. In Bertillon's case, he "chose" to estimate his probability density function at the points 58.5 inches, 59.5 inches, 60.5 inches, . . . Suppose he had estimated his probability density function at 58 inches, 59 inches, 60 inches, . . . instead? Would it matter? Figure 3 (with simulated data generated to approximate Bertillon's original data) illustrates the potential problem. Note that consistent with our viewing the histogram as an estimate of the probability density function for the center of the bins, we have dropped the usual bars and have labeled the axis suitably. As in Bertillon's case, the choice of bin centers clearly matters: with our simulated data, a possibly more precise conversion from centimeters to inches, and bin centers at the inch, the middle hump disappears. The modern kernel density estimator differs from Bertillon's histogram esti- mator as described in the previous equation in two key ways. First, in a typical kernel density estimator, the bins are allowed to "overlap." This severs the link between bin size and bin centers that characterizes the histogram and is one reason to prefer the more sophisticated kernel density estimator. Second, kernel density estimators typically place diminishing weight on data points as they move farther away from our point xo, while the histogram

  5. 16 Journal of Economic Perspectives ◆♦♥✲♣❛r❛♠❡tr✐❝ ❞❡♥s✐t② ❡st✐♠❛t✐♦♥ Figure 3 ❍✐st♦❣r❛♠ The Sensitivity of the Histogram to Alternate Bin Centers 1 Bin Centers on the Inch 56 58 60 62 64 66 68 70 72 54 Height of Conscripts in Inches ✺✴✸✹ assigns equal weight to all points falling in the bin. On this latter point, note that the indicator function in the earlier equation simply serves to count the number of data points lying in the bin, while potentially one could assign differing weights to points falling in the bin depending on their "closeness" to %. Before formally describing the relationship between these two estimators, we first define two terms that are key ingredients in a kernel density estimator: the bandwidth and the kernel. What is a bandwidth? In a histogram, the bandwidth is the width of the bin divided by two. The bandwidth tells you how far to look to the left and to the right when computing the probability density function at x,. A bandwidth of i inch, of x , for example, would typically say that to estimate the probability density function at xo, you would consider all points that are within inch of x,. Bertillon's 1-inch bins imply a i inch bandwidth. More generally, one can think of a bandwidth as simply a parameter used to determine the size of the "neighborhood" around xo-large bandwidths define large neighborhoods, and small bandwidths define small ones. In the histogram, points falling outside the neighborhood receive zero weight, while those falling in the neighborhood receive constant weight. What is a kernel? It is merely a smoothing or weight-assigning function. Bertillon's kernel (the kernel used in any histogram) is today called a rectan- gular kernel-so-called because it treats all points in a bin the same. In modern

  6. ◆♦♥✲♣❛r❛♠❡tr✐❝ ❞❡♥s✐t② ❡st✐♠❛t✐♦♥ ❍✐st♦❣r❛♠ ❘❡♠❡♠❜❡r f ( x ) = dF ( x ) / dx s♦ F ( x + h ) − F ( x − h ) f ( x ) = ❧✐♠ ✷ h h → ✵ Pr ( x − h < X < x + h ) = ❧✐♠ ✷ h h → ✵ t❤❡ s❛♠♣❧❡ ❛♥❛❧♦❣ ♦❢ ✇❤✐❝❤ ✐s N f Hist ( x ) = ✶ ✶ [ x − h < X i < x + h ] � ˆ ✷ h N i = ✶ N �� � � = ✶ ✶ X i − x � � � ✷ × ✶ � < ✶ � � Nh h � i = ✶ ✻✴✸✹

  7. ◆♦♥✲♣❛r❛♠❡tr✐❝ ❞❡♥s✐t② ❡st✐♠❛t✐♦♥ ❑❡r♥❡❧ ❞❡♥s✐t② ❡st✐♠❛t♦r ❚❤❡ ❤✐st♦❣r❛♠ ❡st✐♠❛t♦r ❝❛♥ ❜❡ ❣❡♥❡r❛❧✐③❡❞ N � X i − x � f ( x ) = ✶ � ˆ K Nh h i = ✶ ✇❤❡r❡ ◮ t❤❡ ✇❡✐❣❤t✐♥❣ ❢✉♥❝t✐♦♥ K ( · ) ✐s ❝❛❧❧❡❞ ❛ ❦❡r♥❡❧ ❢✉♥❝t✐♦♥ ◮ h ✐s ❛ s♠♦♦t❤✐♥❣ ♣❛r❛♠❡t❡r ❝❛❧❧❡❞ t❤❡ ❜❛♥❞✇✐❞t❤ ✳ ❋♦r ˆ f → f ✇❡ r❡q✉✐r❡ t❤❛t Nh → ∞ ❛♥❞ h → ✵✳ ✼✴✸✹

  8. ◆♦♥✲♣❛r❛♠❡tr✐❝ ❞❡♥s✐t② ❡st✐♠❛t✐♦♥ ❑❡r♥❡❧ ❞❡♥s✐t② ❡st✐♠❛t♦r ■t ✐s ✉s✉❛❧❧② ❛ss✉♠❡❞ t❤❛t K ( · ) ◮ ✐s s②♠♠❡tr✐❝ K ( z ) = K ( − z ) ◮ ✐♥t❡❣r❛t❡s t♦ ✶ � K ( z ) dz = ✶ ❤❛s ③❡r♦ ♠❡❛♥ � zK ( z ) dz = ✵ ❛♥❞ ❛ ✜♥✐t❡ s❡❝♦♥❞ ♠♦♠❡♥t � z ✷ K ( z ) dz = κ ✷ < ∞ ✽✴✸✹

  9. ◆♦♥✲♣❛r❛♠❡tr✐❝ ❞❡♥s✐t② ❡st✐♠❛t✐♦♥ ❑❡r♥❡❧ ❞❡♥s✐t② ❡st✐♠❛t♦r ✕ ❙♦♠❡ ❝♦♠♠♦♥ ❦❡r♥❡❧s ❑❡r♥❡❧ K ( z ) δ ✶ ❯♥✐❢♦r♠ ✷ × ✶ [ | z | < ✶ ] ✶✳✸✺✶✵ ❚r✐❛♥❣✉❧❛r ( ✶ − | z | ) × ✶ [ | z | < ✶ ] ✕ ✸ ✹ ( ✶ − z ✷ ) × ✶ [ | z | < ✶ ] ❊♣❛♥❡❝❤♥✐❦♦✈ ✶✳✼✶✽✽ ✶✻ ( ✶ − z ✷ ) ✷ × ✶ [ | z | < ✶ ] ✶✺ ❇✐✇❡✐❣❤t ✷✳✵✸✻✷ ( ✷ π ) − ✶ / ✷ ❡①♣ ( − z ✷ / ✷ ) ●❛✉ss✐❛♥ ✵✳✼✼✻✹ ✾✴✸✹

  10. ◆♦♥✲♣❛r❛♠❡tr✐❝ ❞❡♥s✐t② ❡st✐♠❛t✐♦♥ ❑❡r♥❡❧ ❞❡♥s✐t② ❡st✐♠❛t♦r ✕ ❙♦♠❡ ❝♦♠♠♦♥ ❦❡r♥❡❧s 0.8 0.6 y1 0.4 0.2 0.0 −3 −2 −1 0 1 2 3 x ✶✵✴✸✹

  11. ◆♦♥✲♣❛r❛♠❡tr✐❝ ❞❡♥s✐t② ❡st✐♠❛t✐♦♥ ❑❡r♥❡❧ ❞❡♥s✐t② ❡st✐♠❛t♦r ❲❡ ❝❛♥ s❤♦✇ t❤❛t � ˆ f ( x ) dx = ✶ � n f ( x ) dx = ✶ � x ˆ X i n i = ✶ σ ✷ + h ✷ κ ✷ Var (ˆ f ( x )) = ˆ σ ✷ ✐s t❤❡ s❛♠♣❧❡ ✈❛r✐❛♥❝❡✳ ✇❤❡r❡ ˆ ◆♦t❡✿ t❤❡s❡ ❛r❡ ♥✉♠❡r✐❝❛❧ ♠♦♠❡♥ts✱ ♥♦t s❛♠♣❧✐♥❣ ♠♦♠❡♥ts ✶✶✴✸✹

  12. ◆♦♥✲♣❛r❛♠❡tr✐❝ ❞❡♥s✐t② ❡st✐♠❛t✐♦♥ ❑❡r♥❡❧ ❞❡♥s✐t② ❡st✐♠❛t♦r ✕ ❊st✐♠❛t✐♦♥ ❜✐❛s ❊①♣❡❝t❛t✐♦♥s ♦❢ ❦❡r♥❡❧ tr❛♥s❢♦r♠❛t✐♦♥s � ✶ � E [ ✶ hK ( X i − x hK ( z − x )] = ) f ( z ) dz = K ( u ) f ( x + hu ) du h h ✇❤❡r❡ u = ( z − x ) / h ✱ s♦ N � X i − x � f ( x )] = E [ ✶ � E [ˆ ] K Nh h i = ✶ N � X i − x � � = ✶ E [ ✶ � hK ] = K ( u ) f ( x + hu ) du N h i = ✶ ✇❤✐❝❤ ✭t②♣✐❝❛❧❧②✮ ❝❛♥♥♦t ❜❡ s♦❧✈❡❞ ❛♥❛❧②t✐❝❛❧❧② ✶✷✴✸✹

Recommend


More recommend