% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/estimator_registry.R
\name{register_estimator}
\alias{register_estimator}
\title{Register a Network Estimator}
\usage{
register_estimator(name, fn, description, directed)
}
\arguments{
\item{name}{Character. Unique name for the estimator (e.g. \code{"relative"},
\code{"glasso"}).}

\item{fn}{Function. The estimator function. Must accept \code{data} as its
first argument and \code{...} for additional parameters. Must return a list
with at least: \code{matrix} (square numeric matrix), \code{nodes}
(character vector), \code{directed} (logical).}

\item{description}{Character. Short description of the estimator.}

\item{directed}{Logical. Whether the estimator produces directed networks.}
}
\value{
Invisible \code{NULL}.
}
\description{
Register a custom or built-in network estimator function by name.
Estimators registered here can be used by \code{\link{estimate_network}}
via the \code{method} parameter.
}
\examples{
my_fn <- function(data, ...) {
  m <- cor(data)
  diag(m) <- 0
  list(matrix = m, nodes = colnames(m), directed = FALSE)
}
register_estimator("my_cor", my_fn, "Custom correlation", directed = FALSE)
df <- data.frame(A = rnorm(20), B = rnorm(20), C = rnorm(20))
net <- build_network(df, method = "my_cor")
remove_estimator("my_cor")

}
\seealso{
\code{\link{get_estimator}}, \code{\link{list_estimators}},
\code{\link{remove_estimator}}, \code{\link{estimate_network}}
}
