% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/exactlocaldiffexp.R
\name{exactlocaldiffexp}
\alias{exactlocaldiffexp}
\title{Compute local diffusion exponents for all nodes using exact analytical method}
\usage{
exactlocaldiffexp(adj, max_time, fit_range)
}
\arguments{
\item{adj}{Symmetric adjacency matrix (0/1, no self-loops) of a connected graph.}

\item{max_time}{Maximum number of steps (starting from t=1).}

\item{fit_range}{Numeric vector of length 2, e.g. c(t_min, t_max), specifying
the time window for fitting (1 <= t_min < t_max <= max_time).}
}
\value{
A list with components:
  \item{H}{Numeric vector of length n, the estimated local diffusion exponents.}
  \item{msd}{Matrix of size max_time x n, where rows correspond to times 1:max_time
             and columns correspond to nodes. Entry [t, i] = MSD_i(t).}
  \item{fit}{List of lm objects (one per node), or NULL if fit failed.}
}
\description{
For each node i, the mean squared resistance displacement is computed exactly
via the transition matrix powers: MSD_i(t), for t = 1, 2, ..., max_time.
Then a log-log linear regression is performed
over the specified time window to estimate the local diffusion exponent H_i.
}
\examples{
# Example: path graph with 4 nodes
adj <- matrix(c(0,1,0,0,
                1,0,1,0,
                0,1,0,1,
                0,0,1,0), nrow=4, byrow=TRUE)
res <- exactlocaldiffexp(adj, max_time = 50, fit_range = c(10, 40))
print(res$H)
}
\references{
Nie, Chun-Xiao. "Vertex‑level diffusion scaling from resistance distance."  .Chaos, Under Review.
}
