PROGRAM g05rbfe ! G05RBF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : g05kbf, g05rbf, nag_wp ! .. Implicit None Statement .. IMPLICIT NONE ! .. Parameters .. INTEGER, PARAMETER :: ldc = 5, ldx = 100 INTEGER, PARAMETER :: lr = ldc*ldc + ldc + 2 INTEGER, PARAMETER :: nout = 6 ! .. Local Scalars .. INTEGER :: df, i, ifail, igen, j, m, mode, n ! .. Local Arrays .. REAL (KIND=nag_wp) :: c(ldc,ldc), r(lr), x(ldx,ldc) INTEGER :: iseed(4) ! .. Executable Statements .. WRITE (nout,*) 'G05RBF Example Program Results' WRITE (nout,*) ! Initialize the seed to a repeatable sequence iseed(1) = 1762543 iseed(2) = 9324783 iseed(3) = 42344 iseed(4) = 742355 ! Choose the random generator to use igen = 1 ! Initialize the random generator CALL g05kbf(igen,iseed) ! Set the number of variables and variates m = 4 n = 10 ! Input the upper triangle portion of the covariance matrix c(1,1) = 1.69E0_nag_wp c(1,2) = 0.39E0_nag_wp c(1,3) = -1.86E0_nag_wp c(1,4) = 0.07E0_nag_wp c(2,2) = 98.01E0_nag_wp c(2,3) = -7.07E0_nag_wp c(2,4) = -0.71E0_nag_wp c(3,3) = 11.56E0_nag_wp c(3,4) = 0.03E0_nag_wp c(4,4) = 0.01E0_nag_wp ! Set the degrees of freedom df = 10 mode = 0 ifail = 0 ! Set up reference vector and generate N numbers CALL g05rbf(mode,df,m,c,ldc,n,x,ldx,igen,iseed,r,lr,ifail) ! Display the results DO i = 1, n WRITE (nout,99999) (x(i,j),j=1,m) END DO 99999 FORMAT (1X,10F10.4) END PROGRAM g05rbfe