% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nmfkc.ar.R
\name{nmfkc.ar.DOT}
\alias{nmfkc.ar.DOT}
\title{Generate a Graphviz DOT Diagram for NMF-AR / NMF-VAR Models}
\usage{
nmfkc.ar.DOT(
  result,
  degree = 1,
  intercept = any(colnames(result$C) == "(Intercept)"),
  threshold = 0.1,
  rankdir = "RL",
  fill = TRUE,
  weight_scale_xy = 5,
  weight_scale_lag = 5,
  weight_scale_int = 3,
  hide.isolated = TRUE
)
}
\arguments{
\item{result}{A fitted \code{nmfkc} object representing the AR model.
Must contain matrices \code{X} and \code{C}.}

\item{degree}{Maximum AR lag to visualize.}

\item{intercept}{Logical; if \code{TRUE}, draws intercept nodes for
columns named "(Intercept)" in matrix \code{C}.
Default is \code{TRUE} when an intercept column is detected in \code{C},
\code{FALSE} otherwise (auto-detected).}

\item{threshold}{Minimum coefficient magnitude required to draw an edge.}

\item{rankdir}{Graphviz rank direction (e.g., \code{"RL"}, \code{"LR"}, \code{"TB"}).}

\item{fill}{Logical; whether nodes are filled with color.}

\item{weight_scale_xy}{Scaling factor for edges \eqn{X \rightarrow T}.}

\item{weight_scale_lag}{Scaling factor for lagged edges \eqn{T-k \rightarrow X}.}

\item{weight_scale_int}{Scaling factor for intercept edges.}

\item{hide.isolated}{Logical. If \code{TRUE} (default), Y nodes that have no
edges at or above \code{threshold} are excluded from the graph.}
}
\value{
A character string representing a Graphviz DOT file.
}
\description{
Produces a Graphviz DOT script for visualizing autoregressive
NMF-with-covariates models constructed via \code{nmfkc.ar} + \code{nmfkc}.

The diagram displays three types of directed relationships:
\itemize{
\item Lagged predictors: \eqn{T_{t-k} \rightarrow X},
\item Current latent factors: \eqn{X \rightarrow T_t},
\item Optional intercept effects: \code{Const -> X}.
}

Importantly, \emph{no direct edges from lagged variables to current outputs}
(\eqn{T_{t-k} \rightarrow T_t}) are drawn, in accordance with the NMF-AR
formulation.

Each block of lagged variables is displayed in its own DOT subgraph
(e.g., “T-1”, “T-2”, ...), while latent factor nodes and current-time
outputs are arranged in separate clusters.
}
\examples{
d <- AirPassengers
ar_data <- nmfkc.ar(d, degree = 2)
result <- nmfkc(ar_data$Y, ar_data$A, rank = 1)
dot <- nmfkc.ar.DOT(result, degree = 2)
cat(dot)

}
\seealso{
\code{\link{nmfkc.ar}}, \code{\link{nmfkc}}, \code{\link{plot.nmfkc.DOT}}
}
