% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/eval.R
\name{HeatBath}
\alias{HeatBath}
\title{Heat-bath sampling of binary states}
\usage{
HeatBath(steps, nproc, h, J, g = NULL)
}
\arguments{
\item{steps}{Integer. Number of heat-bath iterations to run.}

\item{nproc}{Integer. Number of parallel samples (rows) to maintain.}

\item{h}{Numeric vector of length \code{nn}, implicit environmental parameters.}

\item{J}{Numeric matrix of size \code{nn x nn}, interaction matrix.}

\item{g}{Optional numeric matrix of size \code{nn x ne}, environmental coefficients.}
}
\value{
A list with components:
\describe{
  \item{y}{Numeric matrix (\code{nproc x nn}) of sampled states (0/1).}
  \item{enmat}{Numeric matrix (\code{nproc x ne}) of environmental values, or \code{NULL}
    if \code{g} is \code{NULL}.}
}
}
\description{
Generates samples of binary state vectors using heat-bath updates under
an extended maximum pairwise entropy model parameterized 
by implicit environmental parameters \code{h} and interaction matrix \code{J}.
Optionally includes environmental effects \code{g}, in which case an environmental
matrix is generated internally.
}
\examples{
set.seed(1)
nn <- 5
pars <- hb.paramgen(nn)
res <- HeatBath(steps = 10, nproc = 8, h = pars[[1]], J = pars[[2]])
str(res)

}
