REAL*8 FUNCTION FARSD1(ALAM) 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 function evaluates the product of the spectral density function C of a univariate autogregressive process, and the function C cos(lambda*tau), at the frequencies lambdaC Inputs: C ALAM Lambda C Inputs (/AUAR/): C B Coefficients of autoregression C H Precision of shock to autoregression C TAU tau C NP Number of coefficients in autoregression C Output: C FARSD1 Value of product described above IMPLICIT REAL*8 (A-H,O-Z) PARAMETER(LP=100) COMMON/AUAR/B(0:LP),H,TAU,NP COMMON/CONST/DLOG2,DLGPI,HLG2PI,PI,PII AL=ALAM AC=B(0) AS=0.0D0 DO 10 IP=1,NP AC=AC+B(IP)*DCOS(AL*IP) 10 AS=AS+B(IP)*DSIN(AL*IP) FARSD1=DCOS(AL*TAU)/(H*(AS**2+AC**2)) RETURN END