% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/metacoupling.R
\name{metacoupling}
\alias{metacoupling}
\title{Metacoupling Analysis}
\usage{
metacoupling(
  data,
  swm_peri = NULL,
  swm_tele = NULL,
  weight = NULL,
  method = c("standard", "wang", "fan"),
  threads = 1
)
}
\arguments{
\item{data}{A numeric matrix or data.frame. Rows are observations,
columns are indicators.}

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

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

\item{weight}{Numeric vector of indicator weights. Must have length equal
to \code{ncol(data)}. If \code{NULL}, equal weights are used.}

\item{method}{Coupling model. One of \code{"standard"}, \code{"wang"}, or \code{"fan"}.}

\item{threads}{Number of threads used in computation.}
}
\value{
A data.frame with:
\itemize{
\item \code{Intra_C}: intra-system coupling degree
\item \code{Intra_D}: intra-system coordination degree
\item \code{Peri_C}: peri-coupling degree
\item \code{Peri_D}: peri coordination degree
\item \code{Tele_C}: tele-coupling degree
\item \code{Tele_D}: tele coordination degree
}
}
\description{
Metacoupling Analysis
}
\details{
Full model definitions and formulas are available at:
\url{https://github.com/stscl/coupling/discussions/8}
}
\note{
Input values should be normalized to \verb{[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)

}
