PROGRAM g13dcfe ! G13DCF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : g13dcf, nag_wp, x04abf ! .. Implicit None Statement .. IMPLICIT NONE ! .. Parameters .. INTEGER, PARAMETER :: iset = 1, liw = 1, lwork = 1, & nin = 5, nout = 6 ! .. Local Scalars .. REAL (KIND=nag_wp) :: cgetol, rlogl INTEGER :: i, ifail, ip, iprint, iq, ishow, k, & kmax, ldcm, maxcal, n, nadv, niter, & npar LOGICAL :: exact, mean ! .. Local Arrays .. REAL (KIND=nag_wp), ALLOCATABLE :: cm(:,:), g(:), par(:), qq(:,:), & v(:,:), w(:,:) REAL (KIND=nag_wp) :: work(lwork) INTEGER :: iw(liw) LOGICAL, ALLOCATABLE :: parhld(:) ! .. Executable Statements .. WRITE (nout,*) 'G13DCF Example Program Results' WRITE (nout,*) FLUSH (nout) ! Skip heading in data file READ (nin,*) ! Read in problem size READ (nin,*) k, ip, iq, n, mean ! Calculate NPAR npar = (ip+iq)*k*k IF (mean) THEN npar = npar + k END IF kmax = k ldcm = npar ALLOCATE (par(npar),qq(kmax,k),w(kmax,n),parhld(npar),v(kmax,n), & g(npar),cm(ldcm,npar)) ! Read in series READ (nin,*) (w(i,1:n),i=1,k) ! Read in control parameters READ (nin,*) iprint, cgetol, maxcal, ishow ! Read in exact likelihood flag READ (nin,*) exact ! Read in initial parameter estimates and free parameter flags READ (nin,*) par(1:npar) READ (nin,*) parhld(1:npar) ! Read in initial values for covariance matrix QQ DO i = 1, k READ (nin,*) qq(i,1:i) END DO ! Set the advisory channel to NOUT for monitoring information IF (iprint>=0 .OR. ishow/=0) THEN nadv = nout CALL x04abf(iset,nadv) END IF ! Fit VARMA ifail = 0 CALL g13dcf(k,n,ip,iq,mean,par,npar,qq,kmax,w,parhld,exact,iprint, & cgetol,maxcal,ishow,niter,rlogl,v,g,cm,ldcm,work,lwork,iw,liw,ifail) END PROGRAM g13dcfe