spml.regs: Many simple circular or angular regressions

View source: R/many_regression_models_correlations.R

Many simple circular or angular regressionsR Documentation

Many simple circular or angular regressions

Description

Many regressions with one circular dependent variable and one Euclidean independent variable.

Usage

spml.regs(y, x, tol = 1e-07, logged = FALSE, maxiters = 100, parallel = FALSE)

Arguments

y

The dependent variable, it can be a numerical vector with data expressed in radians or it can be a matrix with two columns, the cosinus and the sinus of the circular data. The benefit of the matrix is that if the function is to be called multiple times with the same response, there is no need to transform the vector every time into a matrix.

x

A matrix with independent variable.

tol

The tolerance value to terminatate the Newton-Raphson algorithm.

logged

Do you want the logarithm of the p-value be returned? TRUE or FALSE.

maxiters

The maximum number of iterations to implement.

parallel

Do you want the calculations to take plac ein parallel? The default value if FALSE.

Details

The Newton-Raphson algorithm is fitted in these regression as described in Presnell et al. (1998). For each colum of x a circual regression model is fitted and the hypothesis testing of no association between y and this variable is performed.

Value

A matrix with two columns, the test statistics and their associated (log) p-values.

Author(s)

Michail Tsagris and Stefanos Fafalios

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Stefanos Fafalios <stefanosfafalios@gmail.com>

References

Presnell Brett, Morrison Scott P. and Littell Ramon C. (1998). Projected multivariate linear models for directional data. Journal of the American Statistical Association, 93(443): 1068-1077.

See Also

spml.mle, iag.mle, acg.mle

Examples

x <- rnorm(100)
z <- cbind(3 + 2 * x, 1 -3 * x)
y <- cbind( rnorm(100,z[ ,1], 1), rnorm(100, z[ ,2], 1) )
y <- y / sqrt( rowsums(y^2) )
x <- matrnorm(100, 100)
a <- spml.regs(y, x)
x <- NULL

Rfast documentation built on Nov. 9, 2023, 5:06 p.m.