typical analysis now proceeds by investigating how the mise behaves for large nunder various assumptions on for exampleit is shown in [ thatfor and ns the asymptotic approximation to the mise of the gaussian kernel density estimator ( (for is given by kf ( ps where : ( )) dx the asymptotically optimal value of is the minimizer ! / ( : gaussian rule of thumb theta kde to compute the optimal sin ( )one needs to estimate the functional the gaussian rule of thumb is to assume that is the density of the (xs distributionwhere and are the sample mean and variance of the datarespectively [ in this case - - / / and the gaussian rule of thumb becomes! / srot - / we recommendhoweverthe fast and reliable theta kde of [ ]which chooses the bandwidth in an optimal way via fixed-point procedure figures and illustrate common problem with traditional kdesfor distributions on bounded domainsuch as the uniform distribution on [ ] the kde assigns positive probability mass outside this domain an additional advantage of the theta kde is that it largely avoids this boundary effect we illustrate the theta kde with the following example example (comparison of gaussian and theta kdesthe following python program draws an iid sample from the exp( distribution and constructs gaussian kernel density estimate we see in figure that with an appropriate choice of the bandwidth good fit to the true pdf can be achievedexcept at the boundary the theta kde does not exhibit this boundary effect moreoverit chooses the bandwidth automaticallyto achieve superior fit the theta kde source code is available as kde py on the book' github site gaussian kde theta kde true density figure kernel density estimates for exp( )-distributed data