*! v1.0.3 IHSalgado-Ugarte 07January2013
help circkden

Title

circkden -- Performs kernel density estimation for circular data

Syntax

circkden varname [if] [in] [,kc(kernelcode) h(#) npoints(#) numodes

modes nuamodes amodes nograph circgph rval(#) fr(#) gs(#)

gen(pdfvar degvar) scatter_options]

Description

circkden calculates kernel density estimation for circular variables with azimutal scale (0 to 360 degrees) by means of a discretized procedure (Cox, 1998) and draws the result.

It is possible to choose the kernel function, to specify the smoothing parameter (half-width), the number of estimation points (at least _N) and to employ a linear (default) or a circular graph.

Additionally it provides modality (and anti-modality) information.

Options

kc(kernelcode) set kernel (weight) function according to the following numerical codes; default is 4, Quartic (Biweight):

1 = Uniform

2 = Triangle

3 = Epanechnikov

4 = Quartic (Biweight)

5 = Triweight

6 = Gaussian

7 = Cosine

h(#) is the smoothness parameter (half-width) in degrees. The default is 30.

npoints(#) specifies the number of equally spaced points in the range of the circular variable. At least must be equal to the number of observations (Default).

numodes displays the number of modes (maxima) in the density estimation.

modes lists the estimated values for each mode. The numodes option must
be included first.

nuamodes displays the number of antimodes (minima) in the density estimation.

amodes lists the estimated values for each antimode. The nuamodes option must
be included first.

circgph draws a circular graph

Options with circgph

rval is a factor controlling the radius size of the circle used

frval is a factor applied to the density values in the cosine and sine transformation. It permits to stretch or compress the density values arround the unit circle.

gsval is a factor controlling the size of the graph. Large values give small graphics while less than unity figures produce bigger circle graphs.

Defaults are 1 in all the cases. It is possible for the graphs to depart from circle by using other values. This can be corrected by using the right combination (see last two examples below).

gen(denvar degvar) specifies the name of the new variables in which probability density estimates (denvar) and the equally spaced angles (degvar) are to be stored.

graph_options are any of the options allowed with twoway scatter; see help for graph.

nograph suppresses the graph drawing

Examples

. use circdat

. circkden angles

. circbw angles, k(4)

. circkden angles, h(38) k(4) numodes modes

. circkden angles, h(14.5) nuamodes amodes gen(density deg)

. circkden angles, circgph r(1) fr(1) gs(.1)

. circkden angles, circgph r(.5) fr(1) gs(.1)

Authors

Isaías H. Salgado-Ugarte,
Laboratorio de Biometría y Biología Pesquera, FES Zaragoza, UNAM;
Departamento de Biología UAM Iztapalapa

ihsalgadougarte@gmail.com

Verónica Mitsui Saito-Quezada
Laboratorio de Biometría y Biología Pesquera, FES Zaragoza, UNAM.

mitsuisaito@gmail.com

Marco A. Pérez-Hernández,
Departamento de Biología, UAM Iztapalapa.

maph@xanum.uam.mx

References

Cox, N.J. 1997. Circular statistics in Stata. 3rd UK User Group meeting. June 5, 1997. London.

Fisher, N.I. 1993. Statistical analysis of circular data. Cambridge University Press, Cambridge, 296p.

Salgado-Ugarte, I.H. & M.A. Pérez-Hernández, 2017. estimación de densidad por núcleo (kernel) para datos circulares. In: Rodríguez-Yam, G.A., F.J. Araiza-Hernández, B.R. Pérez-Salvador & F. Ulín-Montejo (eds.). Aportaciones Recientes a la Estadística en México. INEGI, Mexico: 518-526. ISBN: 978-607-530-067-2.

Also see

Manual: [R] kdensity

Online: Help for circbw, circkden, cirkdevm, circgph, circnpde