Re: $COV

From: Alison Boeckmann Date: July 29, 1998 technical Source: cognigencorp.com
From: alison@c255.ucsf.EDU (ABoeckmann) Subject: Re: $COV Date: 29 Jul 1998 17:59:33 -0400 First, anyone who uses $SIMULATION with the option SUBPROBLEMS=n with NONMEM V is likely to run into a bug. There is a fix. First I will describe the fix. Then I will answer Silvy's question. -- Alison Boeckmann =============================================== =============================================== Change to NONMEM V subroutine INITL. Fixes a bug that causes simulation with subproblems to fail with the message "SUBROUTINE GETETA NOT INITIALIZED". Locate: IGTETA=0 Delete the line, and insert it after these lines: DO 401 I=1,NDI 401 PASSRC(I)=V(I) IF (FRSTPR.EQ.1) THEN =============================================== If NONMEM V was installed using the SETUP.BAT installation utility, here is an easy way to make this change. In the following, it is assumed that the NONMEM V directory is c:\nmv. If not, use the appropriate drive and directory. The steps are: 1. Change to the NONMEM source directory. 2. Save INITL.for as INITL.bak. 3. Edit INITL.for and make the changes described above. 4. Erase all object files in this directory and nonmem.lib. 5. Use SETUP.BAT to recompile only the NONMEM source code and rebuild nonmem.lib. SETUP.BAT will automatically skip all other steps. In the following, it is assumed that SETUP.BAT remains in the NONMEM V directory where it was copied during installation. If not, it can be run from diskette as it was originally: a:\SETUP The DOS commands are as follows. Window-based utilities can be used to copy and erase files. c: cd c:\nmv\nm copy initl.for initl.bak edit initl.for erase *.obj erase nonmem.lib cd .. SETUP (Use here the same arguments that were used originally, if any. Type the command "type setup.txt" to see what they were). =============================================== If NONMEM V was installed on a Unix system using the SETUP installation utility, here is an easy way to make this change. In the following, it is assumed that the NONMEM V directory is /export/home/nmv. If not, use the appropriate drive and directory. The steps are: 1. Change to the NONMEM source directory. 2. Save INITL.f as INITL.bak. 3. Edit INITL.f and make the changes described above. 4. Remove all object files in this directory and nonmem.a. 5. Use SETUP to recompile only the NONMEM source code and rebuild nonmem.a. SETUP will automatically skip all other steps. The Unix commands are as follows. Window-based utilities can be used to copy, remove and edit files. cd /export/home/nmv/nm cp INITL.f INITL.bak vi INITL.f rm *.o rm nonmem.a cd .. SETUP ((Use here the same arguments that were used originally, if any. Type the command "cat SETUP.TXT" to see what they were). ============================================ =========================================== Now for Silvy's question. There are 2 ways to go about this. 1) The final parameter estimates, standard errors, and minimum value of the objective function can easily be extracted from a NONMEM output report using the little program nmsee that I have mentioned in email to this group before. Usage on Unix for standard errors: nmsee prefix out.sim | grep of Nmsee can be obtained at the NONMEM repository. Its in the directory NMSEE.DIR, under NONMEM.DIR. The full address is /public/nonmem.dir/nmsee.dir This is a reminder on how to access the repository: ftp 204.161.113.34 ftp pkpd.icon.palo-alto.med.va.gov World Wide Web at URL: http://pkpd.icon.palo-alto.med.va.gov/ 2) The final parameter estimates, standard errors, and other quantities are available in NONMEM read-only commons ROCM6, ROCM7, ROCM8, and ROCM9. These are discussed in Guide VIII, or try "nmhelp rocm6" etc. If you use $PRED, you can obtain them in a block of code that tests for ICALL.EQ.3. Or if you use PREDPP, you can use code such as the following in an INFN routine. E.g., if the code is in a file named myinfn, then specify $SUBROUTINES ... INFN=myinfn Here's the code. It is suitable for diagonal omega and sigma, but needs some modification for full omega or sigma. (Constants 40 and 30 in the declarations for THETAF etc. should be the same as the values given to LTH and LVR in file NSIZES, in case you changed those values.) It also performs a pass thru the data file to obtain individual etas, which you may delete if you do not want them. SUBROUTINE INFN(ICALL,THETA,DATREC,INDXS,NEWIND) DIMENSION THETA(*),DATREC(*),INDXS(*) DOUBLE PRECISION THETA COMMON /ROCM6/ THETAF(40), OMEGAF(30,30), SIGMAF(30,30) COMMON /ROCM7/ SETH(40),SEOM(30,30),SESIG(30,30) COMMON /ROCM8/ OBJECT COMMON /ROCM9/ IERE,IERC DOUBLE PRECISION THETAF, OMEGAF, SIGMAF DOUBLE PRECISION OBJECT REAL SETH,SEOM,SESIG DOUBLE PRECISION ETA(10) INTEGER J,I INTEGER IERE,IERC INTEGER MODE INTEGER NTH,NETA,NEPS C THE NEXT 3 LINES SHOULD BE EDITED FOR THE NUMBERS OF ETAs, THETAs C AND EPSILONs IN YOUR PROBLEM NTH=8 NETA=6 NEPS=2 IF (ICALL.EQ.0) THEN OPEN(49,FILE='ETA') OPEN(50,FILE='OBJECT') OPEN(51,FILE='THETA') OPEN(52,FILE='SETHETA') OPEN(53,FILE='OMEGA') OPEN(54,FILE='SEOMEGA') OPEN(55,FILE='SIGMA') OPEN(56,FILE='SESIGMA') OPEN(57,FILE='IERE_C') ENDIF C THE NEXT 11 LINES WRITE INDIVIDUAL ETAS IF 'POSTHOC' C OPTION CHOSEN IN THE ESTIMATION STEP IF (ICALL.EQ.3) THEN MODE=0 CALL PASS(MODE) MODE=1 20 CALL PASS(MODE) IF (MODE.EQ.0) GO TO 30 IF (NEWIND.NE.2) THEN CALL GETETA(ETA) WRITE (49,97) (ETA(I),I=1,NETA) ENDIF GO TO 20 30 CONTINUE WRITE (50,99) OBJECT WRITE (51,99) (THETAF(J),J=1,NTH) WRITE (52,99) (SETH(J),J=1,NTH) 7000 WRITE (53,99) (OMEGAF(J,J),J=1,NETA) WRITE (54,99) (SEOM(J,J),J=1,NETA) 7999 WRITE (55,99) (SIGMAF(J,J),J=1,NEPS) WRITE (56,99) (SESIG(J,J), J=1,NEPS) WRITE (57,98) IERE,IERC ENDIF 99 FORMAT (20F15.8) 98 FORMAT (2I8) 97 FORMAT (F8.0, 10E15.8) RETURN END With (say) $OMEGA BLOCK(3) .... the change is as follows: Locate: NETA=6 7000 WRITE (53,99) (OMEGAF(J,J),J=1,NETA) WRITE (54,99) (SEOM(J,J),J=1,NETA) Change to: NETA=3 7000 WRITE (53,99) ((OMEGAF(J,I),J=1,I),I=1,NETA) WRITE (54,99) ((SEOM(J,I),J=1,I),I=1,NETA)
Jul 29, 1998 Silvy Laporte $COV/$SIMULATION w/ subproblems
Jul 29, 1998 Alison Boeckmann Re: $COV