SUBROUTINE STT(K,AMU,H,LDH,ANU,X1,X2) C This routine generates two antithetic pseudo-random vectors x1 and x2 C from a Student-t distribution with mean vector mu and precision C matrix H. C Inputs: C K Dimension of x C AMU Mean vector mu (kx1) C H Precision matrix H (kxk) C LDH Leading dimension of H C ANU Degrees of freedom parameter C Outputs: C X1,X2 Random draws IMPLICIT REAL*8 (A-H,O-Z) PARAMETER(LD=100) COMMON/SCRA/V1(LD),V2(LD),A1(LD,LD),A2(LD,LD) DIMENSION AMU(K),H(LDH,K),X1(K),X2(K) C Entry STT: Factor precision CALL DLFTDS(K,H,LDH,A1,LD) CALL DLINRT(K,A1,LD,2,A1,LD) C Entry STTA: Precision already factored; C *** Can be no intervening calls that change A1 !! *** ENTRY STTA(K,AMU,H,LDH,ANU,X1,X2) 10 CALL URNMVN(K,A1,LD,V1) CALL DRNCHI(1,ANU,AA) AA=1.0D0/DSQRT(AA/ANU) CALL DSCAL(K,AA,V1,1) CALL UVADD(K,AMU,V1,X1) CALL UVSUB(K,AMU,V1,X2) RETURN C Entry GAUB: Coming in with R: RR'=Variance, R upper triangular ENTRY STTB(K,AMU,R,LDR,ANU,X1,X2) CALL UCRGRG(K,K,R,LDR,A1,LD) GO TO 10 END REAL*8 FUNCTION STTK(K,AMU,H,LDH,ANU,X) C This function evaluates the log density kernel of a multivariate C normal random vector x with mean mu and precision matrix H. The C kernel density is [1+.5(x-mu)'H(x-mu)/nu]^[-(nu+k)/2] C Inputs: C K Dimension of x C AMU Mean vector mu (kx1) C H Precision matrix h (kxk) C LDH Leading dimension of H C ANU Degrees of freedom parameter C X Point of evaluation, x (kx1) C Output: C STTK Evaluation of log kernel density IMPLICIT REAL*8 (A-H,O-Z) PARAMETER(LD=100) COMMON/SCRA/V1(LD),V2(LD),A1(LD,LD),A2(LD,LD) DIMENSION H(LDH,K),X(K) CALL UVSUB(K,X,AMU,V1) STTK=-.5D0*(ANU+K)*DLOG(1.0D0+UQUAF(K,V1,H,LDH)/ANU) RETURN END REAL*8 FUNCTION STTN(K,H,LDH,ANU) C*********************************************************************** C In the calling routine a call to INIT must be made prior to calling * C this routine for the first time. * C*********************************************************************** C This routine evaluates the log normalizing constant for the log C density kernel of a random vector computed in GAUK. This C normalizing constant, when multiplied by the kernel in GAUK, C yields the p.d.f. of the random vector. C Inputs: C K Dimension of random vector C H Precision matrix H (kxk) C LDH Leading dimension of H C ANU Degrees of freedom parameter C Output: C STTN Log normalizing factor IMPLICIT REAL*8 (A-H,O-Z) PARAMETER(LD=100) COMMON/CONST/DLOG2,DLGPI,HLG2PI,PI,PII COMMON/SCRA/V1(LD),V2(LD),A1(LD,LD),A2(LD,LD) DIMENSION H(LDH,K) STTN=DLNGAM(.5D0*(ANU+K))-DLNGAM(.5D0*ANU) 1 +.5D0*(DTLGPD(K,H,LDH)-K*DLOG(PI*ANU)) RETURN END