CircNNTSR-package: CircNNTSR: An R Package for the statistical analysis of...

CircNNTSR-packageR Documentation

CircNNTSR: An R Package for the statistical analysis of circular data using nonnegative trigonometric sums (NNTS) models

Description

A collection of utilities for the statistical analysis of circular and spherical data using nonnegative trigonometric sum (NNTS) models

Details

Package: CircNNTSR
Type: Package
Version: 2.2-1
Date: 2020-02-16
License: GLP (>=2)
LazyLoad: yes

Fernandez-Duran, J.J. (2004) proposed a new family of distributions for circular random variables based on nonnegative trigonometric sums. This package provides functions for working with circular distributions based on nonnegative trigonometric sums, including functions for estimating the parameters and plotting the densities.

The distribution function in this package is a circular distribution based on nonnegative trigonometric sums (Fernandez-Duran, 2004). Fejer (1915) expressed a univariate nonnegative trigonometric (Fourier) sum (series), for a variable \theta, as the squared modulus of a sum of complex numbers, i.e.,

\left\|\sum_{k=0}^M c_ke^{ik\theta}\right\|^2\;\;\; (1)

where i=\sqrt{-1}. From this result, the parameters (a_k,b_k) for k=1,\ldots, M of the trigonometric sum of order M,T(\theta),

T(\theta)=a_0 + \sum_{k=1}^M(a_kcos(k\theta) + b_ksin(k\theta))

are expressed in terms of the complex parameters in Equation 1 , c_k, for k=0,\ldots, M, as a_k - ib_k= 2\sum_{\nu=0}^{n-k}c_{\nu + k}\overline{c}_{\nu}. The additional constraint, \sum_{k=0}^n\left\|c_k\right\|^2=\frac{1}{2\pi}=a_0, is imposed to make the trigonometric sum to integrate one. Thus, c_0 must be real and positive, and there are 2*M free parameters. Then, the probability density function for a circular (angular) random variable is defined as (Fernandez-Duran, 2004)

f(\theta; \underline{a},\underline{b},M)=\frac{1}{2\pi} + \frac{1}{\pi}\ \sum_{k=1}^M(a_kcos(k\theta) + b_ksin(k\theta)).

Note that Equation 1 can also be expressed as a double sum as

\sum_{k=0}^{M}\sum_{m=0}^{M}c_k\bar{c}_me^{i(k-m)\theta}

.

The \underline{c} parameters can also be expressed in polar coordinates as c_k=\rho_k e^{i\phi_k} for \rho_k \geq 0 and \phi_k \in [0,2\pi); where \rho_k is the modulus of c_k and \phi_k is the argument of c_k for k=1,\ldots,M. Many functions of the packages use as parameters the squared moduli and the arguments of c_k, \rho_k^2 and \phi_k, for k=1,\ldots,M. We refer to the parameter M as the number of components in the NNTS.

Author(s)

Juan Jose Fernandez-Duran and Maria Mercedes Gregorio-Dominguez

Maintainer: Maria Mercedes Gregorio Dominguez <mercedes@itam.mx>

References

Fernandez-Duran, J.J. (2004). Circular Distributions Based on Nonnegative Trigonometric Sums, Biometrics, 60(2), 499-503.

Fernandez-Duran, J.J., Gregorio-Dominguez, M.M. (2010). A Likelihood-Ratio Test for Homogeneity in Circular Data. Journal of Biometrics & Biostatistics, 1(3), 107. doi:10.4172/2155-6180.1000107

Fernandez-Duran, J.J., Gregorio-Dominguez, M.M. (2010). Maximum Likelihood Estimation of Nonnegative Trigonometric Sums Models Using a Newton-Like Algorithm on Manifolds. Electronic Journal of Statistics, 4, 1402-1410. doi:10.1214/10-ejs587

Fernandez-Duran, J.J., Gregorio-Dominguez, M.M. (2014). Distributions for Spherical Data Based on Nonnegative Trigonometric Sums. Statistical Papers, 55(4), 983-1000. doi:10.1007/s00362-013-0547-5

Fernandez-Duran, J.J., Gregorio-Dominguez, M.M. (2014). Modeling Angles in Proteins and Circular Genomes Using Multivariate Angular Distributions Based on Nonnegative Trigonometric Sums. Statistical Applications in Genetics and Molecular Biology, 13(1), 1-18. doi:10.1515/sagmb-2012-0012

Fernandez-Duran, J.J., Gregorio-Dominguez, M.M. (2014). Testing for Seasonality Using Circular Distributions Based on Nonnegative Trigonometric Sums as Alternative Hypotheses. Statistical Methods in Medical Research, 23(3), 279-292. doi:10.1177/0962280211411531.

Juan Jose Fernandez-Duran, Maria Mercedes Gregorio-Dominguez (2016). CircNNTSR: An R Package for the Statistical Analysis of Circular, Multivariate Circular, and Spherical Data Using Nonnegative Trigonometric Sums. Journal of Statistical Software, 70(6), 1-19. doi:10.18637/jss.v070.i06

Examples

set.seed(200)
data(Turtles_radians)
#Empirical analysis of data
Turtles_hist<-hist(Turtles_radians,breaks=10,freq=FALSE)
#Estimation of the NNTS density with 3 componentes for data
est<-nntsmanifoldnewtonestimation(Turtles_radians,3,iter=100)
est
#plot the estimated density
nntsplot(est$cestimates[,2],3)
#add the histogram to the estimated density plot
plot(Turtles_hist, freq=FALSE, add=TRUE)

b<-c(runif(10,3*pi/2,2*pi-0.00000001),runif(10,pi/2,pi-0.00000001))
estS<-nntsestimationSymmetric(2,b)
nntsplotSymmetric(estS$coef,2)

M<-c(2,3)
R<-length(M)
data(Nest)
data<-Nest
est<-mnntsmanifoldnewtonestimation(data,M,R,100)
est
cest<-est$cestimates
mnntsplot(cest, M)


CircNNTSR documentation built on Sept. 1, 2023, 9:07 a.m.