How to Output the Objective Function to a Separate File

From: Nick Holford Date: September 29, 1994 technical Source: phor.com
Here is an answer that is easy to use on a system that supports awk and grep (all unix and versions are available for DOS and other OSs). If you want to capture the obj func value at the end of each iteration you can extract it from the NONMEM listing as it produced. I use grep to search the NONMEM output as follows: grep "OBJECTIVE VALUE" nonmem.lst You could use awk to extract the obj value itself from each line. grep "OBJECTIVE VALUE" nonmem.lst|awk '{print $6}' As supplied NONMEM leaves the OS to flush the output file buffer when it feels like it instead of after printing the results of each iteration. If you want to have a continuously updated output file while NONMEM is running then you need to flush the file buffer. If your f77 compiler supports flush() or something like that then it easy to make the change to the NONMEM source so that the output file buffer is flushed as soon as a new obj value is printed. I can supply details if you wish.
Sep 28, 1994 Ekaterina Gibiansky How to Output the Objective Function to a Separate File
Sep 28, 1994 Alison Boeckmann How to Output the Objective Function to a Separate File
Sep 29, 1994 Nick Holford How to Output the Objective Function to a Separate File