SUBROUTINE chkadj(Ntd,Khol) IMPLICIT NONE c ------------------------------------------------------------------ c This routine checks to see if Adj and Fin variables need to be c updated by seeing which types of regression effects are present c in the regression. c ------------------------------------------------------------------ LOGICAL F PARAMETER(F=.false.) c ------------------------------------------------------------------ INCLUDE 'model.prm' INCLUDE 'model.cmn' INCLUDE 'usrreg.cmn' INCLUDE 'x11log.cmn' c ------------------------------------------------------------------ INTEGER nusr,nsea,iusr,icol,rtype,Ntd,Khol c ------------------------------------------------------------------ INTEGER Adjtd,Adjhol,Adjao,Adjls,Adjtc,Adjsea,Adjusr, & Nusrrg,Nao,Nls,Ntc,Nramp,Nhol,Nln,Nlp,Nflwtd LOGICAL Finhol,Finao,Finls,Fintc,Finusr COMMON /x11adj/ Adjtd,Adjhol,Adjao,Adjls,Adjtc,Adjsea,Adjusr, & Finhol,Finao,Finls,Fintc,Finusr COMMON /numotl/ Nusrrg,Nao,Nls,Ntc,Nramp,Nhol,Nln,Nlp,Nflwtd c----------------------------------------------------------------------- IF(.not.(Adjtd.ge.0.or.Adjhol.ge.0.or.Adjao.ge.0.or.Adjls.ge.0.or. & Adjtc.ge.0.or.Adjsea.ge.0.or.Adjusr.ge.0.or.Finhol.or.Finao.or. & Finls.or.Fintc.or.Finusr))RETURN c ------------------------------------------------------------------ c Check to see if Adj and Fin variables need to be updated c First, initialize variables c ------------------------------------------------------------------ nusr=0 nsea=0 Ntd=0 Nao=0 Nls=0 Ntc=0 Nramp=0 Nln=0 Nlp=0 Nhol=0 iusr=1 c----------------------------------------------------------------------- c Determine type of regression variable c----------------------------------------------------------------------- DO icol=1,Nb rtype=Rgvrtp(icol) IF(Nusrrg.gt.0)THEN IF(rtype.eq.PRGTUD)THEN rtype=Usrtyp(iusr) iusr=iusr+1 ELSE IF(rtype.eq.PRGTUH.or.rtype.eq.PRGTUS)THEN iusr=iusr+1 END IF END IF c----------------------------------------------------------------------- c Generate regARIMA trading day factors c----------------------------------------------------------------------- IF((Adjtd.ge.0).and. & (rtype.eq.PRGTTD.or.rtype.eq.PRGTST.or.rtype.eq.PRRTTD.or. & rtype.eq.PRRTST.or.rtype.eq.PRATTD.or.rtype.eq.PRATST.or. & rtype.eq.PRG1TD.or.rtype.eq.PRR1TD.or.rtype.eq.PRA1TD).or. & (rtype.eq.PRGTLM.or.rtype.eq.PRGTSL.or.rtype.eq.PRGTLQ.or. & rtype.eq.PRGTLY.or.rtype.eq.PRRTLM.or.rtype.eq.PRRTSL.or. & rtype.eq.PRRTLQ.or.rtype.eq.PRRTLY.or.rtype.eq.PRATLM.or. & rtype.eq.PRATSL.or.rtype.eq.PRATLQ.or.rtype.eq.PRATLY))THEN Ntd=Ntd+1 IF(rtype.eq.PRGTTD.or.rtype.eq.PRRTTD.or.rtype.eq.PRATTD.or. & rtype.eq.PRG1TD.or.rtype.eq.PRR1TD.or.rtype.eq.PRA1TD) & Nflwtd=Nflwtd+1 IF(rtype.eq.PRGTLM.or.rtype.eq.PRGTSL.or.rtype.eq.PRGTLQ.or. & rtype.eq.PRRTLM.or.rtype.eq.PRRTSL.or.rtype.eq.PRRTLQ.or. & rtype.eq.PRATLM.or.rtype.eq.PRATSL.or.rtype.eq.PRATLQ) & Nln=Nln+1 IF(rtype.eq.PRGTLY.or.rtype.eq.PRRTLY.or.rtype.eq.PRATLY) & Nlp=Nlp+1 END IF c----------------------------------------------------------------------- c Generate regARIMA holiday factors c----------------------------------------------------------------------- IF(((Adjhol.ge.0).or.Finhol).and. & (rtype.eq.PRGTEA.or.rtype.eq.PRGTLD.or.rtype.eq.PRGTTH.or. & rtype.eq.PRGTES.or.rtype.eq.PRGTUH))Nhol=Nhol+1 c----------------------------------------------------------------------- c Generate regARIMA User-defined regression factors c----------------------------------------------------------------------- IF(((Adjusr.ge.0).or.Finusr).and.(rtype.eq.PRGTUD))nusr=nusr+1 c----------------------------------------------------------------------- c Generate regARIMA seasonal regression factors c----------------------------------------------------------------------- IF((Adjsea.ge.0).and.(rtype.eq.PRGTUS))nsea=nsea+1 c----------------------------------------------------------------------- c Generate regARIMA AO outlier factors c----------------------------------------------------------------------- IF(((Adjao.ge.0).or.Finao).and. & (rtype.eq.PRGTAO.or.rtype.eq.PRGTAA))Nao=Nao+1 c----------------------------------------------------------------------- c Generate regARIMA Level Change Outlier factors c----------------------------------------------------------------------- IF(((Adjls.ge.0).or.Finls).and.(rtype.eq.PRGTLS.or. & rtype.eq.PRGTRP.or.rtype.eq.PRGTAL))THEN Nls=Nls+1 IF(rtype.eq.PRGTRP)Nramp=Nramp+1 END IF c----------------------------------------------------------------------- c Generate regARIMA Temporary Change Outlier factors c----------------------------------------------------------------------- IF(((Adjtc.ge.0).or.Fintc).and.(rtype.eq.PRGTTC.or. & rtype.eq.PRGTAT))Ntc=Ntc+1 c----------------------------------------------------------------------- c Generate regARIMA MV outlier factors c----------------------------------------------------------------------- IF(rtype.eq.PRGTMV)Nao=Nao+1 c----------------------------------------------------------------------- END DO c----------------------------------------------------------------------- c reset regression adjustment indicators if no regession effect c found and print warning messages. c----------------------------------------------------------------------- IF(Adjtd.eq.1.and.Ntd.eq.0)Adjtd=0 IF(Adjtd.eq.0.and.Ntd.gt.0)Adjtd=1 IF(Adjhol.eq.1.and.Nhol.eq.0)THEN Adjhol=0 IF((.NOT.(Axrghl.or.Axruhl.or.Khol.ge.1)).and.Finhol)Finhol=F END IF IF(Adjhol.eq.0.and.Ntd.gt.0)Adjhol=1 IF(Adjsea.eq.1.and.nsea.eq.0)Adjsea=0 IF(Adjsea.eq.0.and.nsea.gt.0)Adjsea=1 IF(nusr.eq.0)THEN IF(Adjusr.eq.1)Adjusr=0 IF(Finusr)Finusr=F ELSE IF(nusr.gt.0)THEN IF(Adjusr.eq.0)Adjusr=1 END IF IF(Nao.eq.0)THEN IF(Adjao.eq.1)Adjao=0 IF(Finao)Finao=F ELSE IF(Nao.gt.0)THEN IF(Adjao.eq.0)Adjao=1 END IF IF(Nls.eq.0)THEN IF(Adjls.eq.1)Adjls=0 IF(Finls)Finls=F ELSE IF(Nls.gt.0)THEN IF(Adjls.eq.0)Adjls=1 END IF IF(Ntc.eq.0)THEN IF(Adjtc.eq.1)Adjtc=0 IF(Fintc)Fintc=F ELSE IF(Ntc.gt.0)THEN IF(Adjtc.eq.0)Adjtc=1 END IF c----------------------------------------------------------------------- RETURN END