Title: | Multivariate Circular Data using MNNTS Models |
---|---|
Description: | A collection of utilities for the statistical analysis of multivariate circular data using distributions based on Multivariate Nonnegative Trigonometric Sums (MNNTS). The package includes functions for calculation of densities and distributions, for the estimation of parameters, and more. |
Authors: | Juan Jose Fernandez-Duran [aut], Maria Mercedes Gregorio-Dominguez [aut, cre] |
Maintainer: | Maria Mercedes Gregorio-Dominguez <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.0 |
Built: | 2024-10-30 06:49:00 UTC |
Source: | CRAN |
A collection of utilities for the statistical analysis of multivariate circular data using distributions based on Multivariate Nonnegative Trigonometric Sums (MNNTS). The package includes functions for calculation of densities and distributions, for the estimation of parameters, and more.
Package: | CircNNTSRmult |
Type: | Package |
Version: | 0.1.0 |
Date: | 2023-09-09 |
License: | GLP (>=2) |
Depends: | R (>= 3.5.0), stats, psychTools, CircNNTSR |
LazyLoad: | yes |
NeedsCompilation: | no |
The MNNTS (multivariate NNTS) density on a d-dimensional () hypertorus by Fernandez-Duran and Gregorio-Dominguez (2014) (see also Fernandez-Duran and Gregorio-Dominguez, 2016) for a vector of angles,
, is defined as
where is a
-dimensional parameter vector of complex numbers of dimension
with subindexes given for all the combinations (Kronecker products) of the
vectors
for
where
is the number of terms of the sum in the equation for the
-th component of the vector
.
The vector
must satisfy
.
For identifiabily,
is a nonnegative real number. The vector
is the Hermitian (conjugate and transpose) of vector
.
The MNNTS family has many desirable properties, the marginal and conditional densities of any order of an MNNTS density are also MNNTS densities and, independence among the elements of the vector
is
translated into a Kronecker product decomposition in the parameter vector
. For example, in the trivariate case
, if
,
and
are joint independent then,
where
,
and
are the parameter vectors of the NNTS marginal densities of
,
and
, respectively.
Similarly, if
is groupwise independent of
then,
where
is the parameter vector
of the bivariate MNNTS density of
. These results apply to higher dimensions.
Juan Jose Fernandez-Duran and Maria Mercedes Gregorio-Dominguez
Maintainer: Maria Mercedes Gregorio Dominguez <[email protected]>
Fernandez-Duran, J. J. and 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.
Fernandez-Duran, J. J. and Gregorio-Dominguez, M. M. (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, 1–19.
Fernandez-Duran, J. J. and Gregorio-Dominguez, M. M (2023). Multivariate Nonnegative Trigonometric Sums Distributions for High-Dimensional Multivariate Circular Data, arXiv preprint arXiv:2301.03643v2
Minimun and maximun daily bid and ask exchange rates from Euro-US dollar, GB pound-US dollar, Bitcoin-US dollar from March 22, 2019 to March 22, 2023
data("EURUSDGBPBTCtimesminmax")
data("EURUSDGBPBTCtimesminmax")
A data frame with 1048 observations on the following 14 variables.
id
Observation number
day1
Date in format day/month/year
EURUSDAskMax
Daily maximum of ask Euro-US dollar exchange rate
EURUSDAskMin
Daily minimum of ask Euro-US dollar exchange rate
EURUSDBidMax
Daily maximum of bid Euro-US dollar exchange rate
EURUSDBidMin
Daily minimum of bid Euro-US dollar exchange rate
GBPUSDAskMax
Daily maximum of ask GB pound-US dollar exchange rate
GBPUSDAskMin
Daily minimum of ask GB pound-US dollar exchange rate
GBPUSDBidMax
Daily maximum of bid GB pound-US dollar exchange rate
GBPUSDBidMin
Daily minimum of bid GB pound-US dollar exchange rate
BTCUSDAskMax
Daily maximum of ask Bitcoin-US dollar exchange rate
BTCUSDAskMin
Daily minimum of ask Bitcoin-US dollar exchange rate
BTCUSDBidMax
Daily maximum of bid Bitcoin-US dollar exchange rate
BTCUSDBidMin
Daily minimum of bid Bitcoin-US dollar exchange rate
Dukascopy publicly available tick-by-tick data
Computes the c parameter vector estimate based on the mean resultant vector of the vectors of observed trigonometric moments
mnntestimationresultantvector(data,M=0,R=1)
mnntestimationresultantvector(data,M=0,R=1)
data |
Data frame with the observed vectors of angles. The number of columns must be equal to R |
M |
Vector of M parameters. A nonnegative integer number for each of the R components of the vector |
R |
Number of dimensions |
cestimates |
A matrix with the index and values of the c parameters estimates of the MNNTS density |
Juan Jose Fernandez-Duran and Maria Mercedes Gregorio-Dominguez
Fernandez-Duran and J. J. and Gregorio-Dominguez and M. M (2023). Multivariate Nonnegative Trigonometric Sums Distributions for High-Dimensional Multivariate Circular Data, arXiv preprint arXiv:2301.03643v2
# A bivariate dataset Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) estmeanresultant<-mnntestimationresultantvector(data,M=Mbiv,R=Rbiv) estmeanresultant # A trivariate dataset Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate estmeanresultant<-mnntestimationresultantvector(data,M=Mtriv,R=Rtriv) estmeanresultant
# A bivariate dataset Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) estmeanresultant<-mnntestimationresultantvector(data,M=Mbiv,R=Rbiv) estmeanresultant # A trivariate dataset Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate estmeanresultant<-mnntestimationresultantvector(data,M=Mtriv,R=Rtriv) estmeanresultant
Computes the characteristic function from the c parameters of an MNNTS density
mnntscharacteristicfunction(cestimatesarray=as.data.frame(matrix(c(0,1/(2*pi)), nrow=1,ncol=2)),M=0,R=1)
mnntscharacteristicfunction(cestimatesarray=as.data.frame(matrix(c(0,1/(2*pi)), nrow=1,ncol=2)),M=0,R=1)
cestimatesarray |
output from mnntsmanifoldnewtonestimation function |
M |
Vector of M parameters. A nonnegative integer number for each of the R components of the vector |
R |
Number of dimensions |
A data frame (matrix) with the support and values of the characteristic function of the MNNTS density
Juan Jose Fernandez-Duran and Maria Mercedes Gregorio-Dominguez
Fernandez-Duran and J. J. and Gregorio-Dominguez and M. M (2023). Multivariate Nonnegative Trigonometric Sums Distributions for High-Dimensional Multivariate Circular Data, arXiv preprint arXiv:2301.03643v2
# A characteristic function from a bivariate MNNTS density set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) est<-mnntsmanifoldnewtonestimation(data,Mbiv,Rbiv,50) est charfunbiv23<-mnntscharacteristicfunction(cestimatesarray=est$cestimates,M=Mbiv,R=Rbiv) charfunbiv23 # A characteristic function from a trivariate MNNTS density set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est<-mnntsmanifoldnewtonestimation(data,Mtriv,Rtriv,50) est charfuntriv233<-mnntscharacteristicfunction(cestimatesarray=est$cestimates,M=Mtriv,R=Rtriv) charfuntriv233
# A characteristic function from a bivariate MNNTS density set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) est<-mnntsmanifoldnewtonestimation(data,Mbiv,Rbiv,50) est charfunbiv23<-mnntscharacteristicfunction(cestimatesarray=est$cestimates,M=Mbiv,R=Rbiv) charfunbiv23 # A characteristic function from a trivariate MNNTS density set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est<-mnntsmanifoldnewtonestimation(data,Mtriv,Rtriv,50) est charfuntriv233<-mnntscharacteristicfunction(cestimatesarray=est$cestimates,M=Mtriv,R=Rtriv) charfuntriv233
Computes the c parameters of a conditional MNNTS density at a particular value of the conditioning random vector
mnntsconditional(cpars=as.data.frame(matrix(c(0,0,1/(2*pi)),nrow=1,ncol=3)), M=c(0,0),R=2,cond=1,cond.values=0)
mnntsconditional(cpars=as.data.frame(matrix(c(0,0,1/(2*pi)),nrow=1,ncol=3)), M=c(0,0),R=2,cond=1,cond.values=0)
cpars |
Matrix of parameters of an MNNTS density with the first R columns containing the index of the c parameter and the R+1 containing the complex parameter |
M |
Vector of M parameters. A nonnegative integer number for each of the R components of the vector |
R |
Number of dimensions |
cond |
A subset of 1:R indicating the elements of the vector of variables to conditioning on |
cond.values |
A vector of fixed values of the conditional elements of the random vector at which to conditioning on |
param |
A matrix with the index and values of the c parameters for the MNNTS condtional density |
Juan Jose Fernandez-Duran and Maria Mercedes Gregorio-Dominguez
Fernandez-Duran and J. J. and Gregorio-Dominguez and M. M (2023). Multivariate Nonnegative Trigonometric Sums Distributions for High-Dimensional Multivariate Circular Data, arXiv preprint arXiv:2301.03643v2
# A univariate conditional from a bivariate joint set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) est<-mnntsmanifoldnewtonestimation(data,Mbiv,Rbiv,100) est cpars2cond1<-mnntsconditional(cpars=est$cestimates,M=Mbiv,R=Rbiv,cond=1,cond.values=c(pi/2)) cpars2cond1 nntsplot(cpars2cond1$cpar.cond,M=Mbiv[2]) # A bivariate conditional from a trivariate joint set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est<-mnntsmanifoldnewtonestimation(data,Mtriv,Rtriv,100) est cpars23cond1<-mnntsconditional(cpars=est$cestimates,M=Mtriv,R=Rtriv,cond=1,cond.values=pi/4) cpars23cond1 mnntsplot(cpars23cond1,M=Mtriv[c(2,3)]) mnntsplotwithmarginals(cpars23cond1,M=Mtriv[c(2,3)])
# A univariate conditional from a bivariate joint set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) est<-mnntsmanifoldnewtonestimation(data,Mbiv,Rbiv,100) est cpars2cond1<-mnntsconditional(cpars=est$cestimates,M=Mbiv,R=Rbiv,cond=1,cond.values=c(pi/2)) cpars2cond1 nntsplot(cpars2cond1$cpar.cond,M=Mbiv[2]) # A bivariate conditional from a trivariate joint set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est<-mnntsmanifoldnewtonestimation(data,Mtriv,Rtriv,100) est cpars23cond1<-mnntsconditional(cpars=est$cestimates,M=Mtriv,R=Rtriv,cond=1,cond.values=pi/4) cpars23cond1 mnntsplot(cpars23cond1,M=Mtriv[c(2,3)]) mnntsplotwithmarginals(cpars23cond1,M=Mtriv[c(2,3)])
Computes the design matrix of the auxiliary regression for the goodness of fit test of an MNNTS density based on the estimated characteristic function
mnntsgofdesignmatrix(data,charfunarray,R=1)
mnntsgofdesignmatrix(data,charfunarray,R=1)
data |
Matrix of angles in radians (with R columns) |
charfunarray |
A data frame (matrix) with the support and values of the characteristic function of the MNNTS density obtained by using the function mnntscharacteristic function with vector of parameters M of dimension R |
R |
Number of dimensions |
A matrix that is the design matrix to run the auxiliary regression for the goodness of fit test
Juan Jose Fernandez-Duran and Maria Mercedes Gregorio-Dominguez
Fernandez-Duran and J. J. and Gregorio-Dominguez and M. M (2023). Multivariate Nonnegative Trigonometric Sums Distributions for High-Dimensional Multivariate Circular Data, arXiv preprint arXiv:2301.03643v2
Fan, Y. (1997). Goodness-of-fit tests for a multivariate distribution by the empirical characteristic function. Journal of Multivariate Analysis, 62, 36-63.
# A characteristic function from a bivariate MNNTS density set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) est<-mnntsmanifoldnewtonestimation(data,Mbiv,Rbiv,70) est charfunbiv23<-mnntscharacteristicfunction(cestimatesarray=est$cestimates,M=Mbiv,R=Rbiv) charfunbiv23 designmatrix23<-mnntsgofdesignmatrix(data,charfunbiv23,R=2) designmatrix23 # A characteristic function from a trivariate MNNTS density set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est<-mnntsmanifoldnewtonestimation(data,Mtriv,Rtriv,40) est charfuntriv233<-mnntscharacteristicfunction(cestimatesarray=est$cestimates,M=Mtriv,R=Rtriv) charfuntriv233 designmatrix233<-mnntsgofdesignmatrix(data,charfuntriv233,R=3) designmatrix233
# A characteristic function from a bivariate MNNTS density set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) est<-mnntsmanifoldnewtonestimation(data,Mbiv,Rbiv,70) est charfunbiv23<-mnntscharacteristicfunction(cestimatesarray=est$cestimates,M=Mbiv,R=Rbiv) charfunbiv23 designmatrix23<-mnntsgofdesignmatrix(data,charfunbiv23,R=2) designmatrix23 # A characteristic function from a trivariate MNNTS density set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est<-mnntsmanifoldnewtonestimation(data,Mtriv,Rtriv,40) est charfuntriv233<-mnntscharacteristicfunction(cestimatesarray=est$cestimates,M=Mtriv,R=Rtriv) charfuntriv233 designmatrix233<-mnntsgofdesignmatrix(data,charfuntriv233,R=3) designmatrix233
Computes the statistics of the goodness of fit test of an MNNTS density based on the estimated characteristic function
mnntsgofstatistics(data,charfunarray,R=1)
mnntsgofstatistics(data,charfunarray,R=1)
data |
Matrix of angles in radians (with R columns) |
charfunarray |
A data frame (matrix) with the support and values of the characteristic function of the MNNTS density obtained by using the function mnntscharacteristicfunction with vector of parameters M of dimension R |
R |
Number of dimensions |
gofstat |
The value of the goodness of fit statistic |
gofstatnormal |
The value of the normal approximation o fthe goodnes of fit statistic |
Juan Jose Fernandez-Duran and Maria Mercedes Gregorio-Dominguez
Fernandez-Duran and J. J. and Gregorio-Dominguez and M. M (2023). Multivariate Nonnegative Trigonometric Sums Distributions for High-Dimensional Multivariate Circular Data,arXiv preprint arXiv:2301.03643v2
Fan, Y. (1997). Goodness-of-fit tests for a multivariate distribution by the empirical characteristic function. Journal of Multivariate Analysis, 62, 36-63.
# A characteristic function from a bivariate MNNTS density set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) est<-mnntsmanifoldnewtonestimation(data,Mbiv,Rbiv,70) est charfunbiv23<-mnntscharacteristicfunction(cestimatesarray=est$cestimates,M=Mbiv,R=Rbiv) charfunbiv23 gofstats23<-mnntsgofstatistics(data,charfunbiv23,R=2) gofstats23 # A characteristic function from a trivariate MNNTS density set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est<-mnntsmanifoldnewtonestimation(data,Mtriv,Rtriv,50) est charfuntriv233<-mnntscharacteristicfunction(cestimatesarray=est$cestimates,M=Mtriv,R=Rtriv) charfuntriv233 gofstats233<-mnntsgofstatistics(data,charfuntriv233,R=3) gofstats233
# A characteristic function from a bivariate MNNTS density set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) est<-mnntsmanifoldnewtonestimation(data,Mbiv,Rbiv,70) est charfunbiv23<-mnntscharacteristicfunction(cestimatesarray=est$cestimates,M=Mbiv,R=Rbiv) charfunbiv23 gofstats23<-mnntsgofstatistics(data,charfunbiv23,R=2) gofstats23 # A characteristic function from a trivariate MNNTS density set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est<-mnntsmanifoldnewtonestimation(data,Mtriv,Rtriv,50) est charfuntriv233<-mnntscharacteristicfunction(cestimatesarray=est$cestimates,M=Mtriv,R=Rtriv) charfuntriv233 gofstats233<-mnntsgofstatistics(data,charfuntriv233,R=3) gofstats233
Computes the mixing probabilities (eigenvalues) and parameter c vectors (eigenvectors) of the elements of the mixture defining a general MNNTS marginal of any dimension from an MNNTS density
mnntsmarginalgeneral(cpars=as.data.frame(matrix(c(0,0,1/(2*pi)),nrow=1,ncol=3)), M=c(0,0),R=2,marginal=1)
mnntsmarginalgeneral(cpars=as.data.frame(matrix(c(0,0,1/(2*pi)),nrow=1,ncol=3)), M=c(0,0),R=2,marginal=1)
cpars |
Matrix of parameters of an MNNTS density with the first R columns containing the index of the c parameter and the R+1 containing the complex parameter |
M |
Vector of M parameters. A nonnegative integer number for each of the R components of the vector |
R |
Number of dimensions |
marginal |
A subset of 1:R indicating the elements of the random vector in the marginal |
index |
Matrix of the index of the marginal MNNTS density |
eigenvectors |
Matrix of the c parameter vectors of each element of the mixture. Each column is a parameter vector |
eigenvalues |
The vector of mixing probabilities |
Juan Jose Fernandez-Duran and Maria Mercedes Gregorio-Dominguez
Fernandez-Duran and J. J. and Gregorio-Dominguez and M. M (2023). Multivariate Nonnegative Trigonometric Sums Distributions for High-Dimensional Multivariate Circular Data, arXiv preprint arXiv:2301.03643v2
# A univariate marginal from a bivariate joint set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) est<-mnntsmanifoldnewtonestimation(data,Mbiv,Rbiv,100) est cparsmarginal1<-mnntsmarginalgeneral(cpars=est$cestimates,M=Mbiv,R=Rbiv,marginal=1) cparsmarginal1 # A bivariate marginal from a trivariate joint set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est<-mnntsmanifoldnewtonestimation(data,Mtriv,Rtriv,100) est cparsmarginal12<-mnntsmarginalgeneral(cpars=est$cestimates,M=Mtriv,R=Rtriv,marginal=c(1,2)) cparsmarginal12
# A univariate marginal from a bivariate joint set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) est<-mnntsmanifoldnewtonestimation(data,Mbiv,Rbiv,100) est cparsmarginal1<-mnntsmarginalgeneral(cpars=est$cestimates,M=Mbiv,R=Rbiv,marginal=1) cparsmarginal1 # A bivariate marginal from a trivariate joint set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est<-mnntsmanifoldnewtonestimation(data,Mtriv,Rtriv,100) est cparsmarginal12<-mnntsmarginalgeneral(cpars=est$cestimates,M=Mtriv,R=Rtriv,marginal=c(1,2)) cparsmarginal12
Computes the value of the marginal density function at a set of vector of angles
mnntsmarginalgeneraldimension(cpars=as.data.frame(matrix(c(0,0,1/(2*pi)),nrow=1, ncol=3)),M=c(0,0),R=2,marginal=1,theta=matrix(0,nrow=1,ncol=1))
mnntsmarginalgeneraldimension(cpars=as.data.frame(matrix(c(0,0,1/(2*pi)),nrow=1, ncol=3)),M=c(0,0),R=2,marginal=1,theta=matrix(0,nrow=1,ncol=1))
cpars |
Matrix of parameters of an MNNTS density with the first R columns containing the index of the c parameter and the R+1 containing the complex parameter |
M |
Vector of M parameters. A nonnegative integer number for each of the R components of the vector |
R |
Number of dimensions |
marginal |
A subset of 1:R indicating the elements of the vector of variables in the marginal |
theta |
A vector of fixed values of the marginal elements of the random vector at which to obtain the value of the marginal density |
A scalar with the value of the marginal density at the specified value of the marginal vector.
Juan Jose Fernandez-Duran and Maria Mercedes Gregorio-Dominguez
Fernandez-Duran and J. J. and Gregorio-Dominguez and M. M (2023). Multivariate Nonnegative Trigonometric Sums Distributions f
# A univariate marginal from a bivariate joint set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest est<-mnntsmanifoldnewtonestimation(data,Mbiv,Rbiv,100) est marginal1value<-mnntsmarginalgeneraldimension(cpars=est$cestimates, M=Mbiv,R=Rbiv,marginal=1,theta=matrix(c(pi/2),nrow=1,ncol=1)) marginal1value # A bivariate marginal from a trivariate joint set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est<-mnntsmanifoldnewtonestimation(data,Mtriv,Rtriv,100) est marginal12value<-mnntsmarginalgeneraldimension(cpars=est$cestimates, M=Mtriv,R=Rtriv,marginal=c(1,2),theta=matrix(c(pi/4,pi/2),nrow=1,ncol=2)) marginal12value
# A univariate marginal from a bivariate joint set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest est<-mnntsmanifoldnewtonestimation(data,Mbiv,Rbiv,100) est marginal1value<-mnntsmarginalgeneraldimension(cpars=est$cestimates, M=Mbiv,R=Rbiv,marginal=1,theta=matrix(c(pi/2),nrow=1,ncol=1)) marginal1value # A bivariate marginal from a trivariate joint set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est<-mnntsmanifoldnewtonestimation(data,Mtriv,Rtriv,100) est marginal12value<-mnntsmarginalgeneraldimension(cpars=est$cestimates, M=Mtriv,R=Rtriv,marginal=c(1,2),theta=matrix(c(pi/4,pi/2),nrow=1,ncol=2)) marginal12value
Computes the vector of c parameters of an MNNTS density from the vectors of c parameters of its independent marginals
mnntsparametersunderindependenceunivariate(data,R,Mvector,cparlist)
mnntsparametersunderindependenceunivariate(data,R,Mvector,cparlist)
data |
Matrix of angles in radians (with R columns) |
R |
Number of dimensions |
Mvector |
Vector of M parameters. A nonnegative integer number for each of the R components of the vector |
cparlist |
A list in which each element is a matrix containing the information of the vector of c parameters for each independent marginal component |
cestimates |
Matrix of prod(M+1)*(R+1). The first R columns are the parameter number, and the last column is the c parameter's estimators |
loglik |
Log-likelihood value |
AIC |
Value of Akaike's Information Criterion |
BIC |
Value of Bayesian Information Criterion |
Juan Jose Fernandez-Duran and Maria Mercedes Gregorio-Dominguez
Fernandez-Duran and J. J. and Gregorio-Dominguez and M. M (2023). Multivariate Nonnegative Trigonometric Sums Distributions for High-Dimensional Multivariate Circular Data, arXiv preprint arXiv:2301.03643v2
# Bivariate MNNTS density from independent marginals set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) est1<-nntsmanifoldnewtonestimation(data[,1],Mbiv[1]) est1 est2<-nntsmanifoldnewtonestimation(data[,2],Mbiv[2]) est2 est12independent<-mnntsparametersunderindependenceunivariate(data,R=Rbiv, Mvector=Mbiv,cparlist=list(est1,est2)) est12independent # Trivariate MNNTS density from independent marginals set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est1<-nntsmanifoldnewtonestimation(data[,1],Mtriv[1],70) est1 est2<-nntsmanifoldnewtonestimation(data[,2],Mtriv[2],70) est2 est3<-nntsmanifoldnewtonestimation(data[,3],Mtriv[3],70) est3 est123independent<-mnntsparametersunderindependenceunivariate(data,R=Rtriv, Mvector=Mtriv,cparlist=list(est1,est2,est3)) est123independent
# Bivariate MNNTS density from independent marginals set.seed(200) Mbiv<-c(2,3) Rbiv<-length(Mbiv) data(Nest) data<-Nest*(pi/180) est1<-nntsmanifoldnewtonestimation(data[,1],Mbiv[1]) est1 est2<-nntsmanifoldnewtonestimation(data[,2],Mbiv[2]) est2 est12independent<-mnntsparametersunderindependenceunivariate(data,R=Rbiv, Mvector=Mbiv,cparlist=list(est1,est2)) est12independent # Trivariate MNNTS density from independent marginals set.seed(200) Mtriv<-c(2,3,3) Rtriv<-length(Mtriv) data(WindDirectionsTrivariate) data<-WindDirectionsTrivariate est1<-nntsmanifoldnewtonestimation(data[,1],Mtriv[1],70) est1 est2<-nntsmanifoldnewtonestimation(data[,2],Mtriv[2],70) est2 est3<-nntsmanifoldnewtonestimation(data[,3],Mtriv[3],70) est3 est123independent<-mnntsparametersunderindependenceunivariate(data,R=Rtriv, Mvector=Mtriv,cparlist=list(est1,est2,est3)) est123independent
Orientation of nests of 50 noisy scrub birds (theta) along the bank of a creek bed, together with the corresponding directions (phi) of creek flow at the nearest point to the nest.
data(Nest)
data(Nest)
Orientation of 50 nests (vectors)
Data supplied by Dr. Graham Smith
N.I. Fisher (1993) Statistical analysis of circular data. Cambridge University Press.
Wind directions registered at the monitoring stations of San Agustin located in the north, Pedregal in the southwest, and Hangares in the southeast of the Mexico Central Valley's at 14:00 on days between January 1, 1993 and February 29, 2000. There are a total of 1,682 observations
data(WindDirectionsTrivariate)
data(WindDirectionsTrivariate)
Three columns of angles in radians
Mexico Central Valleys pollution monitoring network. RAMA SIMAT (Red Automatica de Monitoreo Ambiental)