scieee AI-readable full text Open interactive document viewer

A reliable data-based smoothing parameter selection method for circular kernel estimation

Ameijeiras Alonso, José

Abstract

new data-based smoothing parameter for circular kernel density (and its derivatives) estimation is proposed. Following the plug-in ideas, unknown quantities on an optimal smoothing parameter are replaced by suitable estimates. This paper provides a circular version of the well-known Sheather and Jones bandwidths (J R Stat Soc Ser B Stat Methodol 53(3):683–690, 1991. https://doi.org/10.1111/j.2517-6161.1991.tb01857.x), with direct and solve-the-equation plug-in rules. Theoretical support for our developments, related to the asymptotic mean squared error of the estimator of the density, its derivatives, and its functionals, for circular data, are provided. The proposed selectors are compared with previous data-based smoothing parameters for circular kernel density estimation. This paper also contributes to the study of the optimal kernel for circular data. An illustration of the proposed plug-in rules is also shown using real data on the time of car accidents

Full text

Statistics and Computing (2024) 34:73 https://doi.org/10.1007/s11222-024-10384-x ORIGINAL PAPER A reliable data-based smoothing parameter selection method for circular kernel estimation Jose Ameijeiras-Alonso1 Received: 22 February 2023 / Accepted: 10 January 2024 / Published online: 7 February 2024 © The Author(s) 2024 Abstract A new data-based smoothing parameter for circular kernel density (and its derivatives) estimation is proposed. Following the plug-in ideas, unknown quantities on an optimal smoothing parameter are replaced by suitable estimates. This paper provides a circular version of the well-known Sheather and Jones bandwidths (J R Stat Soc Ser B Stat Methodol 53(3):683–690, 1991.https://doi.org/10.1111/j.2517-6161.1991.tb01857.x), with direct and solve-the-equation plug-in rules. Theoretical support for our developments, related to the asymptotic mean squared error of the estimator of the density, its derivatives, and its functionals, for circular data, are provided. The proposed selectors are compared with previous data-based smoothing parameters for circular kernel density estimation. This paper also contributes to the study of the optimal kernel for circular data. An illustration of the proposed plug-in rules is also shown using real data on the time of car accidents. Keywords Circular data ·Directional statistics ·Kernel density estimation ·Plug-in rule ·Sheather and Jones bandwidth 1 Introduction Circular data are observations that can be represented on the unit circumference and where periodicity must be taken into account. Classic examples appear when the goal is to model orientations or a periodic phenomenon with a known period. Several applications of circular data can be found, e.g., in Ley and Verdebout (2018) or SenGupta and Arnold (2022). The complicated features that circular data can exhibit on real data applications lead to several new flexible models in the statistical literature. A recent review of flexible parametric circular distributions can be found in Ameijeiras-Alonso and Crujeiras (2022). When trying to obtain a flexible fit of the density function, an alternative to parametric models is the kernel density estimation. Kernel density estimation for circular data dates back to Beran (1979) and Hall et al. (1987), while the estimator of the density derivatives was studied by Di Marzio et al. (2011). Additionally, the extension of density (and its derivatives) to the (hyper-)toroidal and (hyper-)spherical cases was BJose Ameijeiras-Alonso [email protected] 1CITMAga, Department of Statistics, Mathematical Analysis and Optimization, Universidade de Santiago de Compostela, Rúa Lope Gómez de Marzoa s/n, 15782 Santiago de Compostela, A Coruña, Spain considered by Di Marzio et al. (2011) and Klemelä (2000), respectively. It is well-known that, for all these estimators, the choice of the smoothing parameter is crucial when using these kernel methods. In the usual linear inferential framework, where random variables are supported on the Euclidean space, one can find many approaches for selecting the “best” data-driven bandwidth parameter (see, e.g., Jones et al. 1996,foradiscussion on this topic). Due to its good performance, one of the most-employed bandwidth selectors is the plug-in bandwidth proposed by Sheather and Jones (1991). The relevance of this plug-in selector is evident from the impressive number of citations that Sheather and Jones (1991) have received, and although other authors have introduced new bandwidth selectors, none of the proposals outperforms, in general, their plug-in selector. There exists some literature on smoothing parameter selection for circular data, some of these ideas are based on cross-validation (Hall et al. 1987), rule-of-thumb (Taylor 2008), plug-in (Oliveira et al. 2012; García-Portugués 2013; Tenreiro 2022), or bootstrap (Di Marzio et al. 2011) techniques. But none of the approaches introduced so far presents an outstanding performance with respect to its competitors, as is the case with the proposal by Sheather and Jones (1991) in the linear case. Hence, the goal of this paper is to provide the needed theory to derive an algorithm that replicates the 123 73 Page 2 of 13 Statistics and Computing (2024) 34 :73 idea of the two-stage direct and solve-the-equation plug-in bandwidth selectors for circular kernel density estimation. In addition, the developed theory can be also employed when estimating the density derivatives. Regarding the kernel choice, most of the results for circular density estimation fix the kernel to be the von Mises density function. In this paper, we study the asymptotic results for a more general class of kernels. This allow us to obtain the optimal kernels in the circular estimation context. This paper is organized as follows. Section2is devoted to the definition of the circular kernel density derivative estimate. Also, the key function needed to derive the optimal smoothing parameter is introduced in this section. For a general circular kernel, the asymptotic mean integrated squared error and the optimal smoothing parameter of the derivative estimator are derived in Sect.3. Section4is devoted to the estimation of density functionals needed to derive the plugin rules. In Sect.5, we discuss the kernel choice. Section6 provides all the essential details to compute the two-stage direct and solve-the-equation plug-in smoothing selectors. We analysed the performance of the proposed plug-in rules through a simulation study. The summarized conclusions appear in Sect.7. Section8uses a real data example to show the applicability of the proposed selector. Some final remarks are provided in Sect.9. Section10 describes the software that implements the proposed smoothing parameters. The complete simulation study showing that the proposed rules provide a competitive smoothing parameter, some additional comments regarding how to use the software, and the proofs of the theoretical results are provided as Supplementary Material. 2 Circular kernel density derivative estimation Given a circular random sample in angles 1,..., n∈ [−π,π), with an associated density function f, the circular kernel density estimator (see, for example, Oliveira et al. 2012) can be defined as follows: ˆ fν(θ) =1 n n  i=1 Kν(θ−i),(1) where Kνis the circular kernel with a smoothing parameter ν∈[0,1], representing the mean resultant length. It is worth noting that, in contrast to previous circular literature (Di Marzio et al. 2009,2011), we use the notation Kνinstead of Kκsince our smoothing parameter focuses on the mean resultant length rather than the concept of “concentration”. This choice allows us to establish a theory that is valid for both types of kernels, whether they depend on concentration, such as the von Mises, or on the mean resultant length, such as the wrapped normal (see Sect. 5for a formal introduction to these kernels). The estimator (1) can be easily extended, when the objective is estimating the r-th derivative of f, denoted by f(r).In that case, the estimator of f(r)can be defined as (Di Marzio et al. 2011), ˆ f(r) ν(θ) =1 n n  i=1 K(r) ν(θ−i).(2) The first question is which function can be employed as a kernel? In this case, we will assume that Kνsatisfies assumptions reminiscent of the canonical conditions for the linear kernel ( Wand and Jones 1995, Ch. 2). In particular, a circular kernel Kν(reflectively) symmetric about zero and squareintegrable in [−π,π) would admit the following convergent Fourier series representation (see Mardia and Jupp 1999, Section 4.2), Kν(θ) =1 2π⎛ ⎝1+2∞  j=1 αK,j(ν) cos(jθ)⎞ ⎠,(3) where only the values of αK,j(ν) ∈[0,1],for j∈{1,2,...}, depend on the employed kernel and the mean resultant length ν. In Sect.3, we will impose that Fourier series representation for the kernel Kν. Secondly, a crucial element in kernel density estimation is the smoothing parameter. Generally, this parameter is taken as a non-random sequence, depending on the sample size, and then as a fixed value for a sample realization. In this work, we will introduce the function hdepending on ν, h≡hK(ν) =π2 3+4∞  j=1 (−1)jαK,j(ν) j2.(4) We denote has the circular bandwidth and the sequence of numbers hn≡hK(νn)must satisfy limn→∞ hn=0. It is important to note that this circular bandwidth is constructed from trigonometric moments, distinguishing it from the concept of “bandwidth” used in scale-family kernels. The distinction arises because circular distributions, such as the von Mises, do not belong to the scale family. In this paper, we aim to derive an explicit expression for the optimal circular bandwidth without imposing assumptions that resemble scalar theory. Specifically, we do not require conditions like Kg(θ) =K(θ/g)/g(Tenreiro 2022)or Kgn(θ) =λg−2 nK((1−cos(θ))/g2 n), for some constant λ, when gn→0 (García-Portugués 2013). 123 Statistics and Computing (2024) 34 :73 Page 3 of 13 73 3 Asymptotic results In this section, we establish the results needed for deriving the asymptotic mean integrated squared error (AMISE) and the AMISE-optimal smoothing parameter. Throughout this section, for a given derivative order r, we will employ the following assumptions to derive the asymptotic results. (A1) The circular density fis such that its derivative f(r+2) is continuous. (A2) For all ν, the kernel Kνadmits the Fourier series representation (3). (A3) For t∈{1,2}, define the function RK;r,tas: RK;r,t(ν) = (2π)−11+2∞ j=1αt K,j(ν)if r=0, sπ−1∞ j=1jtrαt K,j(ν) otherwise, s=⎧ ⎨ ⎩ −1ift=1 and rmodulo 4 =1, −1ift=1 and rmodulo 4 =2, 1 otherwise. The smoothing parameter satisfies that limn→∞ hK(νn) =0 and limn→∞ n−1RK;r,2(νn)=0. As mentioned in Sect.1, Assumptions (A1) and (A2) are reminiscent of those employed in the standard linear case. For a large class of kernels, including the von Mises or the wrapped normal (see Sect. 5), we will see that Assumption (A3) translates into the standard conditions on the bandwidth, namely, limn→∞ hn=0 and limn→∞ nh(2r+1)/2 n=∞. The result in Theorem 1(see Section S3 of the Supplementary Material for a formal proof) states the AMISE order of the kernel derivative estimator (2). If we also assume the following two extra conditions, we can derive an explicit expression of the AMISE. (E1) π −πθ4Kνn(θ)dθ=o(hn),asn→∞. (E2) limn→∞ RK;r,2(νn)=∞and, as n→∞,π −πθ2 (K(r) νn(θ))2dθ=o[RK;r,2(νn)]. Theorem 1 Under the Assumptions (A1)–(A3), we have AMISE ˆ f(r) ν=Oh2 K(νn)+On−1RK;r,2(νn). If we also assume Conditions (E1) and (E2), then the AMISE has the following explicit expression. AMISE ˆ f(r) ν=1 4h2 K(νn)π −πf(r+2)(θ)2 dθ +1 nRK;r,2(νn). (5) Theorem 1states the expression of the AMISE which depend on the sample size n, the derivative of the density function f(r+2), the kernel Kν, and the mean resultant length ν. The complete expression of the asymptotic mean squared error (AMSE) is provided in Section S3 of the Supplementary Material. Remark 1 Di Marzio et al. (2009,2011) also analysed the AMISE of the circular kernel estimation obtaining a similar result as in (5), replacing hK(νn)by (1−αK,2(νn))/2. Note that, although not stated in their paper, additional conditions must be imposed to derive their asymptotic results. We further elaborate on this matter in Section S3.1 of the Supplementary Material. In particular, their results hold true assuming Condition (E1). Under this condition, we can approximate hK(νn)by (1−αK,2(νn))/2, as nincreases. Thus, asymptotically, both results coincide, but the expression provided in this paper will allow us to derive an expression of the optimal smoothing parameter. The issue, under the general AMISE expression given in (5), is that it is not straightforward to know how to derive an explicit expression of the optimal smoothing parameter, unless a specific kernel, such as the von Mises is chosen (see, e.g., Di Marzio et al. 2011). This problem can be solved when the following extra condition is assumed. (E3) As n→∞,RK;r,2(νn)=QK;r,2h−(2r+1)/2 n+ o(h−(2r+1)/2 n), where QK;r,2is a constant only depending on the kernel family and the derivative order r. Note that under the Condition (E3), the Assumption (A3) simplifies to limn→∞ hn=0 and limn→∞ nh(2r+1)/2 n= ∞. Using this last assumption, we can observe the classic variance-bias trade-off, where the bias is reduced if hnis “small” and the variance decreases if hnis “large”. The optimal smoothing parameter with respect to the AMISE criteria can be obtained using the following corollary of Theorem 1, which is a direct consequence of hK(ν) > 0 (see Section S3 of the Supplementary Material). Corollary 1 Consider the Assumptions (A1)–(A3) and (E1)– (E3). Then, for the kernel derivative estimator of order r (see (2)), we have that, asymptotically, the optimal (AMISE) value of hncan be obtained from, hK;r;AMISE =(2r+1)QK;r,2 nπ −πf(r+2)(θ)2dθ2/(2r+5) .(6) Under the previous assumptions, the minimal AMISE of ˆ f(r) ν is equal to inf 0≤ν<1AMISE ˆ f(r) ν=(2r+1)QK;r,2 n4/(2r+5) 123 73 Page 4 of 13 Statistics and Computing (2024) 34 :73 ×2r+5 8r+4π −πf(r+2)(θ)2 dθ(2r+1)/(2r+5) .(7) Remark 2 From Corollary 1, it can be observed that the optimal order for circular bandwidth density estimation hK;0;AMISE, which is O(n−2/5), does not coincide with the optimal bandwidth order, O(n−1/5), as presented in Tenreiro (2022). The reason for this discrepancy, as explained in Sect.2, is their lack of alignment. However, it is worth noting that, for example, in the case of the von Mises kernel (see Sect.5.1), when translating this result to the optimal concentration κfor density estimation, both theoretical outcomes yield the same asymptotic optimal concentration of order O(n2/5). Remark 3 Note that the AMISE expression in (7) aligns with the one obtained in the linear case ( Wand and Jones 1995, Chapter 2), except for terms related to the kernel. If Kis a scalar kernel with a variance of one, the same AMISE expression in the linear case can be obtained by replacing QK;r,2 in (7) with ∞ −∞(K(r) (x))2dx. The optimal mean resultant length νis the solution to the equation hK(ν) =hK;r;AMISE, see Equation (4). Alternatively, to avoid the infinite sum in (4), one can also obtain the optimal νby solving the equation αK,2(ν) =1−2hK;r;AMISE (see Remark 1). As usual, when using data-based plug-in smoothing parameters, the main problem with employing the optimal hK;r;AMISE in Corollary 1, is that its value depends on the unknown value of π −πf(r+2)(θ)2dθ. A rule-of-thumb smoothing selector can be obtained by replacing fwith a simple and standard density function, such as the von Mises density. One can also follow the ´ Cwik and Koronacki (1997) approach and replace fwith a mixture model, such as the mixture of von Mises. Both techniques were already proposed and studied in the circular literature when employing the von Mises density as the kernel Kν(see Taylor 2008; Oliveira et al. 2012; García-Portugués 2013). Following Sheather and Jones (1991), an alternative is to estimate density functionals related to π −πf(s)(θ)2dθ. In the next section, we study how to obtain a kernel estimator of this last quantity, in the circular context. 4 Estimation of density functionals As mentioned in the previous section, an issue with using, in practice, the optimal smoothing parameter (6) is its dependence on the unknown quantity π −πf(r+2)(θ)2dθ.Inthis section, we will see how to estimate this last quantity using kernel techniques. For doing so, we first define the functional of the form ψs=π −π f(s)(θ) f(θ)dθ. Note that under sufficient smoothness assumptions on f (e.g., the needed conditions to apply integration by parts), we obtain that, π −πf(s)(θ)2 dθ=(−1)sψ2s.(8) Since ψs=E(f(s)()), the following estimator can be employed to estimate the unknown quantity π −πf(r+2)(θ)2 dθon the optimal smoothing parameter (6), ˆ ψs;ρ=1 n n  i=1ˆ f(s) ρ(i)=1 n2 n  i=1 n  j=1 L(s) ρi−j,(9) where Lρand ρare a kernel and a mean resultant length parameter. In the following theory, we will assume that Lρ and ρmay differ from Kνand ν. However, it is important to note that, in practice, the same kernel is typically employed for both the density (derivative) and the density functionals estimators. Later on, we will observe that, conversely, νand ρusually take distinct values, and we will delve into how to derive a data-driven value for ρ. Using the estimator (9), a direct plug-in estimator of the smoothing parameter can be obtained from (6), replacing the quantity depending on the true f, by its estimator, in the following way, hK;r;PI =(2r+1)QK;r,2 n(−1)r+2ˆ ψ2r+4;ρ2/(2r+5) .(10) The problem with the direct plug-in estimator (10), is that it still depends on a choice of the pilot mean resultant length ρ. Below, we establish the asymptotic theory to derive the optimal smoothing parameter of ˆ ψ2r+4;ρ. For obtaining that result, the following conditions on the pilot parameter are required. (A4) The smoothing parameter satisfies that limn→∞ hL(ρn) =0 and limn→∞ n−2RL;s,2(ρn)=0. (A5) limn→∞ RL;s,1(ρn)=∞and limn→∞ n−1RL;s,1(ρn) =0. Note that when replacing the kernel Kνby Lρ, the mean resultant length νnby ρn, and the order of the derivative r by s, Assumption (A3) implies Condition (A4).Below,we provide the AMSE for the estimator ˆ ψs;ρ(see Section S4 of the Supplementary Material for a formal proof). 123 Statistics and Computing (2024) 34 :73 Page 5 of 13 73 Theorem 2 If f satisfies Assumption (A1) (replacing r by s), the kernel Lρand ρnverifies (A2),(A4) and (A5); then, for an even value of s, AMSE ˆ ψs;ρ=On−2R2 L;s,1(ρn)+Oh2 L(ρn) +O(n−2RL;s,2(ρn)) +O(n−1). (11) If, in addition, Conditions (E1) and (E2) (using Lρ, instead of Kν;ρn, instead νn; and r =s) are verified, we have AMSE ˆ ψs;ρ=n−1RL;s,1(ρn)+1 2hL(ρn)ψs+22 +2n−2ψ0RL;s,2(ρn) +4n−1π −πf(s)(θ)2 f(θ)dθ−ψ2 s.(12) As for Corollary 1, in order to derive a simpler expression of the AMSE and the optimal value of hn≡hL(ρn), we will assume the following extra conditions: (E4) RL;s,1(ρn)=QL;s,1h−(s+1)/2 n+o(h−(s+1)/2 n),asn→ ∞, where QL;s,1is a constant only depending on the kernel and the even number s. The sign of QL;s,1is equal to the sign of (−1)s/2. (E5) π −πθ4Lρn(θ)dθ=o(h5/4 n),asn→∞. From the AMSE expression in (12), we can see that the optimal hnvalue, in terms of AMSE, will depend on the relation between RL;s,1(ρn),RL;s,2(ρn), and hL(ρn). Conditions (E3) and (E4) help to establish this relation, from which the following corollary is derived (see Section S4 of the Supplementary Material). Corollary 2 Consider the assumptions of Theorem 2, Conditions ((E3); replacing Kνby Lρ;usingρn, instead νn; and r=s), and (E4). Then, for the kernel estimator of ψs(see (9)), we have that, asymptotically, the optimal value, in terms of the AMSE expression, of hncan be obtained from, hL;s;AMSE =−2QL;s,1 nψs+22/(s+3) .(13) Under the previous assumptions, if Condition (E5) is also assumed, the minimal AMSE for (9)isoforder O(n−min(5,s+3)/(s+3)). If s is an even number greater than 2, the minimal AMSE would be equal to inf 0≤ρ<1AMSE ˆ ψs;ρ=2ψ0QK;r,2 ×−ψs+2 2QL;s,1(2s+1)/(s+3) n−5/(s+3).(14) If s =0, the minimal AMSE is equal to inf 0≤ρ<1AMSE ˆ ψs;ρ=4n−1 ×π −πf(s)(θ)2 f(θ)dθ−ψ2 s.(15) When s =2, the minimal AMSE is equal to the sum of the right-hand sides of (14) and (15). Note that Condition (E5) is only assumed to obtain the same AMSE optimal order as in the linear case. If that condition is not fulfilled, then, when s>0, the leading term in the AMSE could be of a larger order (see Section S4 of the Supplementary Material). Another important consideration is that the sign of ψs+2is the same as that of (−1)s/2+1 and, using Condition (E4), it also coincides with the sign of −QL;s,1. Therefore, we always have that hL;s;AMSE ≥0in (13). Using the quantity hL;2r+4;AMSE in (13), one can obtain the pilot mean resultant length ρneeded to derive the direct plug-in estimator (10). The issue, as in the linear case, is that hL;2r+4;AMSE still depends on the unknown value of the functional ψ2r+6. We comment on how to overcome this difficulty in Sect. 6. 5 The kernel choice Theoretical results in Sects.3and 4provide mathematical support for deriving the optimal smoothing parameter. However, we still did not discuss how to obtain the plug-in mean resultant length parameter νr;AMISE from hK;r;AMISE.As mentioned in Sect.3, we must solve the equation hK(ν) = hK;r;AMISE. We also need to obtain the values of QK;r,1and QK;r,2in (6) and (13). In this section, we study what happens when the “most common” circular models are employed as kernels. For doing so, we restrict our attention to the four standard choices of circular densities (see Mardia and Jupp 1999, Section 3.5): cardioid, von Mises, wrapped normal, and wrapped Cauchy. Although all of them satisfy Assumption (A2), the cardioid kernel, KC;ν(θ) =(1+2νcos(θ))/(2π), with |ν|<1/2, does not meet Assumption (A3) and will be hence discarded from the analysis. This can be seen by observing that, for any ν,hKC(ν) =π2/3−4ν≥π2/3−2. The other three circular densities are studied in Sects.5.1 and 5.2. Once the behaviour of the standard kernels is studied, a second question to discuss is which is the optimal kernel in the circular context. As in Muller (1984), we study the kernel optimality in terms of the AMISE expression in (7). Fixing fand the sample size n, in Sect.5.3, we obtain the circular kernel that minimizes the AMISE. 123 73 Page 6 of 13 Statistics and Computing (2024) 34 :73 5.1 Von Mises and wrapped normal kernels First, denote by Ijto the modified Bessel function of the first kind and order j, the density expression of the von Mises (VM) kernel is KVM;ν(θ) =exp (κcos(θ)) (2πI0(κ)) =1 2π⎛ ⎝1+2∞  j=1 Ij(κ) I0(κ) cos(jθ)⎞ ⎠, where ν=I1(κ)/I0(κ), being κ≥0. The density expression of the wrapped normal (WN), with a mean resultant length ν∈[0,1],is KWN;ν(θ) =1 2π⎛ ⎝1+2∞  j=1 νj2cos(jθ)⎞ ⎠. For both kernels, if limn→∞ νn=1 (equivalently limn→∞ κn=∞, for the von Mises kernel), then limn→∞ hK(νn)=0. Even more, it is easy to show that, in that setting, Conditions (E1) and (E2) are satisfied. Thus, as n→∞,we obtain the following asymptotic approximations: hKVM (νn)=1 21−I2(κn) I0(κn)=1 κn , hKWN (νn)=1 21−ν4 n. From the previous equalities, we can see that κnor νnare easily derived, after computing the optimal/plug-in value of hn(see, e.g., (6)or(10)). κn VM =h−1 nand νn WN =(1−hn)1/4.(16) Again, considering limn→∞ νn=1, it can be seen that Conditions (E3)–(E5) are satisfied for the von Mises and wrapped normal kernels. For both kernels and a non-negative integer number r, the values of the constants in (E3) and (E4) are the following ones: QK;r,1=(−1)r/2r! 2r/2(r/2)!√2π(rbeing even), QK;r,2=(2r)! 22r+1r!π1/2.(17) We can see that the AMSE and AMISE results derived in Sects.3and 4can be easily computed in practice from these last quantities. These optimal asymptotic results will coincide for both the von Mises and wrapped normal kernels. 5.2 Wrapped Cauchy kernel The expression of the wrapped Cauchy kernel, with a mean resultant length ν∈[0,1], is given by KWC;ν(θ) =1 2π⎛ ⎝1+2∞  j=1 νjcos(jθ)⎞ ⎠. From the density expression, we derive that hKWC (ν) = π2/3+4Li2(−ν), where Lisis the polylogarithm of order s. The last implies limn→∞ hKWC (νn)=0 if limn→∞ νn=1. Also, the expressions of RKWC;r,2(ν) can be obtained in terms of a polylogarithm, RKWC;r,2(ν) =(2π)−11+2Li0(ν2)if r=0, π−1Li−2r(ν2)otherwise, =O(h−(2r+1) n),asn→∞.(18) If we consider a value of hnsuch that limn→∞ hn=0 and limn→∞ nh2r+1 n=∞, Condition (A3) is satisfied. Therefore, from Theorem 1,if falso satisfies Assumption (A1), we obtain the following AMISE for the wrapped Cauchy kernel, AMISE ˆ f(r) ν=Oh2 n+On−1h−(2r+1) n.(19) The AMISE expression (19) would be minimized if hnis of order n−1/(2r+3). Using the previous result, we obtain that the AMISE order of the wrapped Cauchy kernel is worse than that obtained with the von Mises or the wrapped normal kernel (see Corollary 1). In particular, its minimal AMISE is equal to inf 0≤ν<1AMISE ˆ f(r) ν=On−2/(2r+3). When searching for an explicit expression of the optimal smoothing parameter, one could be tempted to combine (5) and (18). But note that this cannot be done as Condition (E1) is not verified (see Section S3.1). Thus, the explicit expression of the asymptotic bias cannot be obtained following the steps in Section S3 of the Supplementary Material. This implies that the AMISE does not have a closed expression as given in (5). On the contrary, Tsuruta and Sagae (2017) were able to obtain an optimal smoothing parameter for the wrapped Cauchy kernel from the results by Di Marzio et al. (2009). Nevertheless, it should be noted that Di Marzio et al. (2009) results must not be employed for this kernel as Condition (E1) is not satisfied (see Section S3.1 for further details). 123 Statistics and Computing (2024) 34 :73 Page 7 of 13 73 5.3 Wrapped bounded-support kernels To find the optimal kernels, consider a wrapped kernel Kν(θ) =∞  =−∞ KX;λ(θ +2π), whose associated linear density KX;λhas bounded support, i.e., KX;λ(x)=0if |x|>λ. Then, Kν(θ) =KX;λ(θ), for all θ∈[−π, π), when λ<π. In that case, h=λ −λx2KX;λ(x)dx and RK;r,2(ν) =λ −λ(K(r) X;λ(x))2dx. Consider the asymptotic case for linear bounded-support kernels, i.e., limn→∞ λn=0. Fixing the unknown linear density function fX, Muller (1984) gives explicit expressions of the bounded-support kernels minimizing the AMISE when estimating the density function and its derivatives, in the linear case. Assume now that the wrapped bounded-support kernel satisfies the assumptions of Corollary 1. Except for the values not depending on the kernel, the minimal AMISE of ˆ f(r) ν in (7) is equal to the minimal AMISE obtained in the linear case. As a consequence, Theorem 2.4 of Muller (1984) can be employed to see that the optimal kernels in terms of AMISE coincide with the wrapped version of those employed on linear kernel estimation. The latter means that the optimal kernel for circular density estimation is the wrapped Epanechnikov, whose associated linear density is KX;λ(x)=3(1−(x/λ)2)/(4λ). When λ<π, the mean resultant length is ν=(3sin(λ) − 3λcos(λ))/λ3,h=λ2/5, and RK;0,2(ν) =3/(5λ). Thus, for circular density estimation with the wrapped Epanechnikov, the optimal (AMISE) value of hnis obtained by taking QK;0,2=3/(5√5)in (6). Regardless of the employed kernel, the minimum achievable AMISE for estimating a circular density function is given by: inf 0≤ν<1AMISE ˆ fν=5 43 5√5n4/5 ×π −πf(2)(θ)2 dθ1/5 . This is the AMISE obtained with the wrapped Epanechnikov kernel. Note that this optimality is established among kernels that satisfy the conditions outlined in Corollary 1. The optimality of the Epanechnikov kernel for circular density estimation is also established by Tenreiro (2022) when restricting to kernels that satisfy alternative necessary assumptions. For the derivatives of the density, we refer to Muller (1984). There, we can see, e.g., that the wrapped Biweight would be the optimal kernel for the first derivative of f. 6 Plug-in smoothing parameters In this section, we will study how to implement, in practice, the plug-in smoothing parameter hK;r;PI in (10). As mentioned in Sect.4, the issue of directly employing (10) is that the AMISE-optimal smoothing parameter for ˆ ψs;ρ will always depend on an unknown value of ψs+2.Awayto overcome this difficulty is to provide an l-stage direct plug-in smoothing selector. This procedure consists in estimating ψs with ˆ ψs+2;ρ, in an iterative process, until some point in which we replace ψ2r+2l+4by its value obtained with a simple density (see Sect.6.1 for more details). An alternative selector can be computed by noting that the smoothing parameter for ˆ f(r)can be obtained as a function of the smoothing parameter for ˆ ψ2r+4. This allows us to construct a solve-the-equation rule. In Sect.6.2, we discuss in more detail how this selector is derived. 6.1 Two-stage direct plug-in smoothing selector The procedure to obtain the l-stage direct plug-in smoothing selector consists in, at stage 0, using a simple rule of thumb to compute the smoothing parameter of ˆ ψ2r+4+2l;ρ. Once this initial step is achieved, from that estimator of ψ2r+4+2l, the following functional estimators are derived in an iterative process (see Algorithm 1for details). Two decisions remain from this brief explanation: the number of stages land which reference density should be employed at stage 0. Regarding the number of stages l,we suggest employing l=2 for two reasons. First, l=2is a common choice in the linear case (see, e.g., Wand and Jones 1995, Section 3.6). A second reason was obtained when replicating the simulation study in Sect.7, with l=3. In that case, similar results were achieved with respect to those obtained with l=2, with the added inconvenience of the extra computational time. The only scenario in which we would recommend increasing the value of lis when complex multimodal patterns are expected. As mentioned before, at stage 0, a reference density is needed to compute the smoothing parameter of ˆ ψ2r+2l+4;ρ. Here, in the same spirit of the original rule of thumb proposed by Taylor (2008), a natural selection would be to replace ψ2r+2l+4in (13) by the quantity obtained when assuming that the true density follows a von Mises. In the circular case, the main pitfall of employing that simple strategy is that a uniform estimation of the density can be obtained even if the true distribution is not uniform. This occurs, for example, when considering distributions with antipodal symmetry (see also Oliveira et al. 2012, for further discussion on this topic). The consequence would be to have a value of ˆ ψ2r+2l+4;ρ close to zero, which leads to a “large” value of the smoothing parameter at the next stage hL;2r+2l+2;PI. 123 73 Page 8 of 13 Statistics and Computing (2024) 34 :73 To avoid that last issue, while still having a simple model, one can use as the reference density the following mixture of Mvon Mises, all having the same concentration parameter κ≥0: fMvM(θ;M;µ,κ,w)=1 (2πI0(κ)) × M  m=1 wmexp (κcos(θ −μm)),(20) where the parameters μm∈[−π, π),wm∈[0,1], for all m∈{1,...,M}, and with M m=1wm=1. The value of ψ2r+2l+4is calculated from the density (20), replacing its parameters by their maximum likelihood estimates obtained from the sample. An algorithm providing the maximum likelihood estimates for the density (20) was implemented in the R (R Core Team 2022) library movMF by Hornik and Grün (2014). In practice, following Oliveira et al. (2012), the value of Mcan be chosen, using the Akaike Information Criterion (AIC), by comparing the results obtained with the mixtures (20)ofM=1,...,Mmax components. In Algorithm 1, we summarize the steps that are needed to obtain our proposed two-stage direct plug-in smoothing parameter. There, for simplicity, we use the same kernel for both Kand L, and this kernel satisfies Assumptions (A1)– (A5) and the extra Conditions (E1)–(E4). Algorithm 1 Two-stage direct plug-in smoothing selector. Step 1: Use a rule of thumb to obtain the estimator of ψ2r+8, namely ˆ ψ2r+8;RT . This can be achieved as follows. Step 1.a: For every M=1,...,Mmax; obtain the maximum likelihood estimators of the parameters in the mixture of Mvon Mises, all having the same concentration parameter, i.e., of µ,κ, and win (20). Step 1.b: Select the number of components in the mixture, MAIC, employing the AIC. Step 1.c: Compute the value ˆ ψ2r+8;RT , using the density fMvM(·;MAIC;ˆ µ,ˆκ, ˆ p)(see Equality (8)). Step 2: Estimate ψ2r+6using the estimator ˆ ψ2r+6;ρ1, where ρ1is the plug-in mean resultant length relying on ˆ ψ2r+8;RT . Step 2.a: Obtain hK;2r+6;PI from (13), replacing ψ2r+8 by ˆ ψ2r+8;RT . Step 2.b: The value ρ1is the one that satisfies hK(ρ1)= hK;2r+6;PI, see Equation (4). Step 3: Estimate ψ2r+4using the estimator ˆ ψ2r+4;ρ2, where ρ2is the plug-in mean resultant length relying on ˆ ψ2r+6;ρ1. Step 4: Compute the AMISE-optimal smoothing parameter for ˆ f(r), relying on ˆ ψ2r+4;ρ2. Step 4.a: Obtain the two-stage direct plug-in smoothing parameter hK;r;PI from (10), with the pilot mean resultant length ρ2. Step 4.b: The selected mean resultant length νDPI is obtained from the value that satisfies hK(νDPI)= hK;r;PI. The uniform distribution belongs to all the reference distributions mentioned before. Thus, in practice, the denominator of (10)or(13) could be equal to zero. If that occurs, we suggest directly returning a value of the mean resultant length νDPI =0, which would correspond to the uniform estimation of the density. Given a finite value of nin (10)or(13), the equation hK(ν) =hK;r;PI, or its approximation αK,2(ν) =1− 2hK;r;AMISE, cannot be solved for “large” values of hK;r;PI. The reason is that hK(ν) and αK,2(ν) are non-negative and bounded for any value of ν. Since a “large” value of hK(ν) corresponds to ν=0, if the equation hK(ν) =hK;r;AMISE cannot be solved, we also suggest employing the uniform as the density estimator. 6.2 Solve-the-equation plug-in smoothing selector An alternative to the previous smoothing selector is the solvethe-equation rule. This rule consists in searching for the smoothing parameter that satisfies hK;r;STE =(2r+1)QK;r,2 n(−1)r+2ˆ ψ2r+4;ρK;r;STE 2/(2r+5) ,(21) with hK(ρK;r;STE)=γ(hK;r;STE). Now, the smoothing parameter for ˆ ψ2r+4is a function of the smoothing parameter for ˆ f(r). We suggest taking the function γby looking at the relation between the optimal smoothing parameter of these two estimators, hL;2r+4;AMSE =(−1)r+12QL;2r+4,1 (2r+1)QK;r,22/(2r+7) ×(ψ2r+4/ψ2r+6)2/(2r+7)h(2r+5)/(2r+7) K;r;AMISE . Using a plug-in rule, this last relation suggests taking the following function: γ(h)=(−1)r+12QL;2r+4,1 (2r+1)QK;r,22/(2r+7) ×ˆ ψ2r+4;ρ1/ˆ ψ2r+6;ρ22/(2r+7) h(2r+5)/(2r+7).(22) The two smoothing parameters of the density functional estimators, ˆ ψ2r+4and ˆ ψ2r+6, can be obtained from (13). 123 Statistics and Computing (2024) 34 :73 Page 9 of 13 73 Those smoothing parameters will depend on some other density functionals, ψ2r+6and ψ2r+8. Following Sheather and Jones (1991), we suggest estimating these two new functionals with a rule of thumb. In Algorithm 2, we summarize the steps that are needed to obtain our proposed solve-the- equation plug-in smoothing parameter. Again, for simplicity, we use the same kernel for both Kand L, a kernel that satisfies Assumptions (A1)–(A5) and the extra Conditions (E1)–(E4). Algorithm 2 Solve-the-equation plug-in smoothing selector. Step 1: Use a rule of thumb to obtain the estimator of ψ2r+6and ψ2r+8, namely ˆ ψ2r+6;RT and ˆ ψ2r+8;RT .This can be done as in Step 1 of Algorithm 1. Step 2: Estimate ψ2r+4and ψ2r+6using the estimators ˆ ψ2r+4;ρ1and ˆ ψ2r+6;ρ2, where ρ1is the plug-in mean resultant length relying on ˆ ψ2r+6;RT , and ρ2the one relying on ˆ ψ2r+8;RT . Step 3: Employ the estimators ˆ ψ2r+4;ρ1and ˆ ψ2r+6;ρ2to obtain the function γin (22). Step 4: Using the γfunction of Step 3, select the value of hK;r;STE by solving Equation (21). The solve-the-equation mean resultant length νSTE is obtained from the value that satisfies hK(νSTE)=hK;r;STE. Note that two extra functional estimators must be computed in Step 1 of Algorithm 2. For this reason, the obtained smoothing parameter could be considered as a two-stages solve-the-equation plug-in selector. As for the direct rule, the number of stages could be increased to estimate the density functionals. In particular, a rule of thumb can be employed to estimate ψ2r+10 or ψ2r+12 and then, in an iterative process, the values of ρ1and ρ2are obtained (as in Steps 2 and 3 of Algorithm 1). The simulation study in Sect.7was carried out under the same conditions, using three (relying on ˆ ψ2r+8;RT and ˆ ψ2r+10;RT ) and four (relying on ˆ ψ2r+10;RT and ˆ ψ2r+12;RT ) stages. The results in practice were similar to those obtained with Algorithm 2, with the drawback of the extra computational time. 7 Simulation study In Section S1 of the Supplementary Material, we performed a simulation study to analyse the performance of the direct two-stage plug-in smoothing parameter (see Algorithm 1) and the solve-the-equation plug-in smoothing selector (see Algorithm 2). We focused only on the density estimation case (r=0in(2)), with Kνbeing the von Mises kernel. The reason is that their effectiveness can be compared with other smoothing parameters proposed in the literature. But note that our data-driven smoothing parameters could be employed to estimate any derivative and with other kernels. In particular, in this framework, slightly better results are expected by employing the wrapped Epanechnikov kernel (see Sect.5.3). A complete report on the results obtained when comparing the proposed smoothing selectors with other data-based smoothing selectors available in the circular literature (see Sect.1) is provided in Section S1. In the current section, Table 1presents the results obtained, for n=100, using the proposed smoothing selectors and other data-driven rules available in the literature. Table 1contains the average integrated square error (ISE) computed from 1000 samples of the reference Models M5–M20 that can be found in Oliveira et al. (2012). Models M1–M4 were not included here as they can be well-approximated by a von Mises density. In those cases, as expected, the rule of thumb provides the best results. The full discussion of the obtained results is provided in Section S1. Below, as a summary of our findings, we provide our recommendations. In this summary, in parentheses, we provide the abbreviated names of the analysed smoothing rules. The same notation is used in the tables presenting the simulation results. •For small sample sizes (say n=50), employ the proposed direct plug-in rule with Mmax =1(νDPI;1). The only exception to this recommendation is if there could be evidence of the density function being multimodal and k-fold rotational symmetric. In that case, employ the solve-the-equation plug-in smoothing selector with Mmax =1(νSTE;1). •For moderate sample sizes (say n=100 or n=250), employ the solve-the-equation plug-in smoothing selector with Mmax =1(νSTE;1). The direct plug-in rule with Mmax =1(νDPI;1) is also recommendable if there is evidence of unimodality. •For large sample sizes (say n=1000), employ the Fourier series-based plug-in approach of Tenreiro (2022) (νPIT). 8 Real data application In this section, we revisit the car accident data that can be found in Ameijeiras-Alonso and Crujeiras (2022). This real dataset consists of the time of the day (at a resolution of one minute) at which the car crash happened in El Paso County (Texas, USA) in 2018. A total of 85 observations were recorded on the webpage of the National Highway Traffic Safety Administration of the United States. In Ameijeiras-Alonso and Crujeiras (2022), several features of the shape of the distribution are analysed with different inferential tools. The conclusion is that the density is unimodal and (reflectively) asymmetric. More specifically among several parametric models studied by Ameijeiras- 123