Extract the Objective Function Value (OFV) from a NONMEM Listing File
Source:R/fetch_ofv.R
fetch_ofv.RdExtracts the OFV from a NONMEM .lst file, trying several output formats
produced by different NONMEM versions and estimation methods:
Arguments
- lst
An object of class
"lst"fromread_lst_file().- digits
Integer or
NA. Rounding for the OFV. DefaultNA.
Details
#OBJV:***...*** <value> ***...***— standard NONMEM 7.x banner lineMINIMUM VALUE OF OBJECTIVE FUNCTION = <value>— same-line formatOBJECTIVE FUNCTION VALUE WITHOUT CONSTANT: <value>— multi-line FOCE-IFINAL VALUE OF OBJECTIVE FUNCTION <value>— alternative wordingOFV = <value>— pyDARWIN / workflow tool footer
When multiple #OBJV: lines are present (multiple estimation steps), the
last occurrence is returned (final step result).
Returns NA_real_ with a warning() if no OFV can be found — never stops.
Examples
path <- system.file("testdata", "full_cov.lst", package = "lstparsR")
lst <- read_lst_file(path)
fetch_ofv(lst)
#> [1] 8986.318