% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fixef.R
\name{coef.rxUi}
\alias{coef.rxUi}
\alias{coef.function}
\title{Extract the initial coefficients from an rxode2 model (rxUi)}
\usage{
\method{coef}{rxUi}(
  object,
  level = c("theta", "fixed", "omega", "random", "all", "both"),
  ...
)

\method{coef}{`function`}(
  object,
  level = c("theta", "fixed", "omega", "random", "all", "both"),
  ...
)
}
\arguments{
\item{object}{rxode2 ui model or a function that evaluates to one}

\item{level}{which coefficients to return: \code{"theta"}/\code{"fixed"} (the default)
returns the named fixed-effect estimates; \code{"omega"}/\code{"random"} returns the
random-effect variability matrix (or \code{NULL} when the model has no random
effects); \code{"all"}/\code{"both"} returns a list with \code{theta} and \code{omega}.}

\item{...}{other parameters (currently ignored)}
}
\value{
depends on \code{level}: a named numeric vector of fixed effects, the
\code{omega} matrix (or \code{NULL}), or a list with both \code{theta} and \code{omega}.
}
\description{
For an rxode2 model specification (\code{rxUi}) there are no realized random
effects (etas), so \code{coef()} returns the fixed-effect (\code{theta}) estimates by
default.  The random-effect variability matrix (\code{omega}) can be requested
with \code{level="omega"}, or both can be returned together with \code{level="all"}.
}
\examples{
one.compartment <- function() {
  ini({
    tka <- 0.45
    tcl <- 1
    tv <- 3.45
    eta.ka ~ 0.6
  })
  model({
    ka <- exp(tka + eta.ka)
    cl <- exp(tcl)
    v <- exp(tv)
    d/dt(depot) <- -ka * depot
    d/dt(center) <- ka * depot - cl / v * center
    cp <- center / v
  })
}

ui <- one.compartment()
coef(ui)
coef(ui, level="omega")
coef(ui, level="all")
}
\author{
Matthew L. Fidler
}
