% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_est.r
\name{get_est}
\alias{get_est}
\title{Get model estimates from NONMEM ext or model file}
\usage{
get_est(from)
}
\arguments{
\item{from}{the model or ext file (or data.frame/model text string from results object) to be read in to obtain estimates.
extension or class of object of file determines the actions to be taken}
}
\value{
a list with theta, eta and omega values
}
\description{
This function gets the estimates (THETA, ETA and OMEGA) from a NONMEM ext or model file to be used
within the simulations in R. The model file is included as option as the names of THETAs can be
obtained in case this is set as comment in the model file
}
\details{
the function will return a list with theta, eta, omega and naming of theta values. In case a model is used as input, the values represent
the initial values from a model. In case the ext file is used, the final estimates are taken. The eta values
are all set to 0. The omega values are returned as a matrix so it can be used for sampling (e.g. using mvrnorm).
naming of thetas is taken from the model comments in the THETA block or in case an ext file is used naming is
set to THETA1:n.
In case the model is used as input, there are some assumptions within the function on how the model is coded. For the
omega block the value of omega must always be placed on a separate line (e.g. $OMEGA 0.1 is not permitted as 0.1 should be placed
on the next line. Also covariance within the omega block should be placed on the same line separated by spaces (e.g. for a BLOCK(2)
the first line should state variance eta1 and the second line should state covariance eta1, eta2 followed by variance eta2).
For the theta block, it is assumed that in case lower and upper boundaries are available they are separated by commas.
}
\examples{

# get the initial estimates from the model or final estimates from ext file
mod  <- system.file("example_models","PK.1CMT.ORAL.mod", package = "amp.sim")
ext  <- system.file("example_models","PK.1CMT.ORAL.ext", package = "amp.sim")
get_est(mod)
get_est(ext)

}
\author{
Richard Hooijmaijers
}
