SUBROUTINE GAUI0(NFILE,NK,TITLE,H0,LDH,B0,HB0,ANORM,THETA) C This routine reads in the mean vector mu and precision matrix H of a C kx1 parameter vector theta. It computes and returns the product of C H and mu, and prints information about the prior. C Inputs: C NFILE File number for reading prior C NK Dimension of parameter vector = k C TITLE Identifier for distribution (printed) C LDH Leading dimension of H0 C Ouptuts: C H0 Prior precision matrix H C B0 Prior mean vector mu C HB0 Product of H and mu C ANORM Log normalizing constant for prior density C THETA Draw from prior IMPLICIT REAL*8 (A-H,O-Z) CHARACTER*(*) TITLE PARAMETER(LD=100) COMMON/SCRA/V1(LD),V2(LD),A1(LD,LD),A2(LD,LD) DIMENSION H0(LDH,NK),HB0(NK),B0(NK),THETA(NK) READ(NFILE,*,END=110,ERR=120)NCODE1,NCODE2,NDIM C NCODE1=1 Diagonal, sqrts only C NCODE1=2 Sqrts diagonal followed by normalized matrix C NCODE1=3 Full matrix C NCODE2=1 Variance matrix C NCODE2=2 Precision matrix IF(NDIM.NE.NK)CALL PEND('ORDER OF GAUSSIAN PRIOR INCORRECT') CALL PINTI('Gaussian prior code 1',NCODE1,1,3) CALL PINTI('Gaussian prior code 2',NCODE2,1,2) READ(NFILE,*,END=110,ERR=120)(B0(IK),IK=1,NK) CALL DSET(NK,1.0D0,V1,1) IF(NCODE1.NE.3)CALL PLISTR(NFILE,NK,V1) CALL UMISET(NK,H0,LDH) IF(NCODE1.NE.1)CALL PDSYMR(NFILE,NK,H0,LDH) DO 10 IK=1,NK DO 10 JK=1,IK H0(IK,JK)=H0(IK,JK)*V1(IK)*V1(JK) 10 H0(JK,IK)=H0(IK,JK) IF(NCODE2.EQ.1)CALL DLINDS(NK,H0,LDH,H0,LDH) C Form Hx(mu). CALL DMURRV(NK,NK,H0,LDH,NK,B0,1,NK,HB0) C Normalizing constant and nitial draw TIME=60.0D0 SD=0.01D0 ANORM=GAUIN(NK,B0,H0,LDH,SD,TIME) CALL GAUI(NK,B0,H0,LDH,THETA) C Variances as convenience to user CALL DLINDS(NK,H0,LDH,A1,LD) WRITE(6,20)TITLE,(JK,B0(JK),DSQRT(A1(JK,JK)),H0(JK,JK), 1 THETA(JK),JK=1,NK) 20 FORMAT(/,' Invertible Gaussian prior for ',A,/, 1 ' Parameter',6X,'Prior mean',6X,'Prior s.d.',5X, 2 'Prior prec.',3X,'Initial value',/,(5X,I5,4(1PE16.6))) WRITE(6,30)SD,TIME 30 FORMAT(/,' .. Means and standard deviations do not reflect', 1 ' invertibility constraint.',/,' Standard deviation of', 2 ' approximation of log prior kernel:',1PE15.5,/, 3 ' Computation time:',0PF8.2) RETURN 110 CALL PEND('UNANTICIPATED END-OF-FILE, INIVERTIBLE GAUSSIAN PRIOR') 120 CALL PEND('ERROR READING GAUSSIAN PRIOR') END