% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/23_Chatterjee.R
\name{chatterjee_matrix}
\alias{chatterjee_matrix}
\title{Pairwise Chatterjee's xi correlation matrix}
\usage{
chatterjee_matrix(
  U,
  na = NULL,
  Z = NULL,
  w = NULL,
  B = 1000,
  seed = NULL,
  verbose = FALSE
)
}
\arguments{
\item{U}{Either an exametrika object or raw data.}

\item{na}{Values to be treated as missing.}

\item{Z}{Missing indicator matrix.}

\item{w}{Item weight vector.}

\item{B}{Number of bootstrap replications per pair. Default 1000.}

\item{seed}{Optional integer seed for reproducibility.}

\item{verbose}{Logical. If TRUE, progress messages are displayed.}
}
\value{
A p x p numeric matrix with item labels as row/column names.
The diagonal is 1; off-diagonal entries are asymmetric.
}
\description{
Computes the p x p asymmetric matrix of Chatterjee's xi correlations
between all item pairs. Entry \verb{[j, k]} is xi(item_j, item_k), which in
general differs from xi(item_k, item_j); this asymmetry is what
enables direction detection in subsequent graph-construction steps.
Each off-diagonal entry is computed by \code{xi_stable()} to average
over tie-breaking.
}
\details{
Pairs are computed with pairwise-complete observations: for each
pair (j, k), rows where either \code{Q[i, j]} or \code{Q[i, k]} is missing are
excluded. The diagonal is set to 1.
}
\examples{
\donttest{
xi_mat <- chatterjee_matrix(J15S3810, B = 500, seed = 42)
}
}
\references{
Chatterjee, S. (2021). A new coefficient of correlation. Journal of
the American Statistical Association, 116(536), 2009-2022.
}
