Package 'cosCorr'

Title: Cosine-Correlation Coefficient for Vector Variables
Description: Computes the cosine-correlation coefficient for measuring the degree of linear dependence among variables in a multidimensional context. The package implements the generalized cosine-correlation theorem for p-1 variables, providing a quantitative assessment of interrelationships within experimental frameworks. This methodology extends classical correlation measures to higher-dimensional spaces using a dimensional exploration approach based on time scale calculus.
Authors: Mehmet Niyazi Cankaya [aut, cre]
Maintainer: Mehmet Niyazi Cankaya <[email protected]>
License: MIT + file LICENSE
Version: 1.0.0
Built: 2026-05-23 15:14:51 UTC
Source: https://github.com/cran/cosCorr

Help Index


Cosine-Correlation Coefficient Computation

Description

Computes the cosine-correlation coefficient for a vector of p-1 variables, measuring the degree of linear dependence among variables in a multidimensional context.

Usage

cosCorr(x, na.rm = FALSE)

Arguments

x

A numeric vector of length p >= 2, where x[1] should be 0 (representing t_1). The remaining elements x[2], x[3], ..., x[p] represent the p-1 variables (t_2, t_3, ..., t_p).

na.rm

Logical. If TRUE, NA values are removed before computation. Default is FALSE.

Details

The cosine-correlation coefficient is defined as:

ρp1=(p1)i=2ptii=2ptip1\rho_{p-1} = \frac{(p-1) \prod_{i=2}^{p} |t_i|}{\sum_{i=2}^{p} |t_i|^{p-1}}

where t1=0t_1 = 0 and t2,,tpt_2, \ldots, t_p are the variables within the system. The coefficient serves as a measure of the degree of linear dependence among the p-1 variables, providing a quantitative assessment of their interrelationships within a multidimensional context.

Value

A numeric value representing the cosine-correlation coefficient ρp1\rho_{p-1}. The coefficient ranges from 0 to 1, where higher values indicate greater linear dependence among the variables.

Examples

# Example 1: Simple vector
x <- c(0, 2, 3, 4)
cosCorr(x)

# Example 2: Vector with 5 variables
x <- c(0, 1, 2, 3, 4, 5)
cosCorr(x)