Package 'coupling'

Title: Analysis of Coupling Coordination Degree
Description: Implements coupling coordination degree (CCD) models and supports metacoupling analysis following Tang et al. (2021) <doi:10.1016/j.scs.2021.103405>.
Authors: Wenbo Lyu [aut, cre, cph] (ORCID: <https://orcid.org/0009-0002-6003-3800>)
Maintainer: Wenbo Lyu <[email protected]>
License: GPL-3
Version: 0.1
Built: 2026-05-15 22:02:01 UTC
Source: https://github.com/cran/coupling

Help Index


Coupling Coordination Degree (CCD)

Description

Coupling Coordination Degree (CCD)

Usage

ccd(data, weight = NULL, method = c("standard", "wang", "fan"), threads = 1)

Arguments

data

A numeric matrix or data.frame. Rows are observations, columns are indicators.

weight

Numeric vector of indicator weights. Must have length equal to ncol(data). If NULL, equal weights are used.

method

Coupling model. One of "standard", "wang", or "fan".

threads

Number of threads used in computation.

Details

Full model definitions and formulas are available at: https://github.com/stscl/coupling/discussions/3

Value

A data.frame with:

  • C: coupling degree

  • D: coordination degree

Note

Input values should be normalized to ⁠[0, 1]⁠.

Examples

set.seed(42)
mat = matrix(runif(20), nrow = 5)
coupling::ccd(mat)

Metacoupling Analysis

Description

Metacoupling Analysis

Usage

metacoupling(
  data,
  swm_peri = NULL,
  swm_tele = NULL,
  weight = NULL,
  method = c("standard", "wang", "fan"),
  threads = 1
)

Arguments

data

A numeric matrix or data.frame. Rows are observations, columns are indicators.

swm_peri

A numeric matrix representing the peri (local) spatial weight matrix. Must be square with dimension equal to nrow(data). If NULL, a zero matrix is used.

swm_tele

A numeric matrix representing the tele (long-distance) spatial weight matrix. Must be square with dimension equal to nrow(data). If NULL, a zero matrix is used.

weight

Numeric vector of indicator weights. Must have length equal to ncol(data). If NULL, equal weights are used.

method

Coupling model. One of "standard", "wang", or "fan".

threads

Number of threads used in computation.

Details

Full model definitions and formulas are available at: https://github.com/stscl/coupling/discussions/8

Value

A data.frame with:

  • Intra_C: intra-system coupling degree

  • Intra_D: intra-system coordination degree

  • Peri_C: peri-coupling degree

  • Peri_D: peri coordination degree

  • Tele_C: tele-coupling degree

  • Tele_D: tele coordination degree

Note

Input values should be normalized to ⁠[0, 1]⁠. Spatial weight matrices are typically symmetric.

Examples

set.seed(42)
mat = matrix(runif(20), nrow = 5)
swm1 = apply(matrix(runif(25), 5, 5), 1, \(.x) .x / sum(.x))
swm2 = apply(matrix(runif(25), 5, 5), 1, \(.x) .x / sum(.x))
coupling::metacoupling(mat, swm1, swm2)