Produces a Graphviz DOT script for visualizing autoregressive NMF-with-covariates models constructed via nmfkc.ar + nmfkc.

The diagram displays three types of directed relationships:

  • Lagged predictors: \(T_{t-k} \rightarrow X\),

  • Current latent factors: \(X \rightarrow T_t\),

  • Optional intercept effects: Const -> X.

Importantly, no direct edges from lagged variables to current outputs (\(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.

nmfkc.ar.DOT(
  x,
  degree = 1,
  intercept = FALSE,
  threshold = 0.1,
  rankdir = "RL",
  fill = TRUE,
  weight_scale_xy = 5,
  weight_scale_lag = 5,
  weight_scale_int = 3
)

Arguments

x

A fitted nmfkc object representing the AR model. Must contain matrices X and C.

degree

Maximum AR lag to visualize.

intercept

Logical; if TRUE, draws intercept nodes for columns named "(Intercept)" in matrix C.

threshold

Minimum coefficient magnitude required to draw an edge.

rankdir

Graphviz rank direction (e.g., "RL", "LR", "TB").

fill

Logical; whether nodes are filled with color.

weight_scale_xy

Scaling factor for edges \(X \rightarrow T\).

weight_scale_lag

Scaling factor for lagged edges \(T-k \rightarrow X\).

weight_scale_int

Scaling factor for intercept edges.

Value

A character string representing a Graphviz DOT file.