% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model_validation.r
\name{model_validation}
\alias{model_validation}
\title{Validates NONMEM estimation model with an mrgsolve simulation model}
\usage{
model_validation(
  nmtable,
  simmodel,
  rounding = 4,
  comppred = "CP",
  out = NULL,
  ...
)
}
\arguments{
\item{nmtable}{either a character with a file or a data frame including the NONMEM table output}

\item{simmodel}{character with the file including the mrgsolve model}

\item{rounding}{numeric with the rounding applied for comparing}

\item{comppred}{character with the variable in mrgsolve model that should be compared with PRED variable in NONMEM}

\item{out}{character with the name of the output to create}

\item{...}{additional arguments passed through to \code{mrgsim} function}
}
\value{
a file with a PDF report is returned
}
\description{
This function uses the estimates from a NONMEM run and compares this with the results of a simulation
run. This function is inspired by a blog post from mrgsolve and mainly looks at the differences in population predictions
}
\details{
For a correct comparison, the nmtable should include all variables related to dosing (e.g. AMT/CMT/EVID).
The simulation model should be available as a separate file that can be read in using \code{mrgsolve::mread}.
To use the function, the packages \code{R3port}, \code{ggplot2}, \code{mrgsolve} and \code{dplyr} should be installed.
Be aware that no variables are renamed in $TABLE in the NONMEM control stream (e.g. AMT2=AMT). This can have unexpected results when comparing.
}
\examples{

\donttest{
  res  <- model_validation(system.file("testfiles/compareParfile",package="amp.sim"),
                           system.file("testfiles/compareModel.cpp",package="amp.sim"),
                           out=NULL)
}
}
\author{
Richard Hooijmaijers
}
