• Nenhum resultado encontrado

IMSL STAT/LIBRARY Chapter 8: Time Series Analysis and Forecasting · 727

( )

0 0 0

( ) 0

( ) ip pj i j 1, 1

k p

k k i j p

s s = = f f s f

ìï =

¢ = íå åïî + - ³ º -

where s(k) denotes the autocovariance function of the original Wt process. The iterative procedure for determining the moving average parameters is based on the relation

2 2 2

1

2

1 1

(1 ) 0

( ) ( ) 1

q A

k k q k q A

k k

k

q q s

s q q q + q q s-

ì + + + =

¢ = íïïî - + + + ³

L L Let t = (t0, t1, …, tq)T and f = (f0, f1, …, fq)T where

0

0

/ 1, ,

A j

j

j

j q

t sq t ìï =

= í-ïî = K

and

0

( ) 0,1, ,

q j

j i i j

i

f - t t+ s j j q

=

=

å

- ¢ = K

Then, the value of t at the (i + 1)-th iteration is determined by ti+1 = ti -(Ti)-1 fi The estimation procedure begins with the initial value

0 ( (0), 0, , 0)T

t = s¢ K

and terminates at iteration i when either ||f i|| is less than RELERR or i equals MAXIT. The moving average parameters are determined from the final estimate of t by setting qj = -tj/t0 for j = 1,

…, q. The random shock variance is determined according to

2 1

2 0

(0) ( ) 0

0

p

i i

A

i q q

s f s

s t

ì - å= =

= íïïî ³

In practice, both the autocovariances and the autoregressive parameters are estimated. The solution of the system of nonlinear equations using these sample moments yields the method of moments estimates of the moving average parameters and the random shock variance. Note that autocorrelations r(k) may be used instead of autocovariances s(k) to compute s¢(k) for k = 1,

…, K. See Box and Jenkins (1976, pages 203–204) for additional motivation concerning the initial estimation of moving average parameters using a Newton-Raphson algorithm.

728 · Chapter 8: Time Series Analysis and Forecasting IMSL STAT/LIBRARY

Required Arguments

W — Vector of length NOBS containing the stationary time series. (Input) CNST — Estimate of the overall constant. (Output)

PAR — Vector of length NPAR containing the autoregressive parameter estimates. (Output) PMA — Vector of length NPMA containing the moving average parameter estimates.

(Output)

AVAR — Estimate of the random shock variance. (Output)

Optional Arguments

NOBS — Number of observations in the stationary time series W. (Input) NOBS must be greater than NPAR + NPMA + 1.

Default: NOBS = size (W,1).

IPRINT — Printing option. (Input) Default: IPRINT = 0.

IPRINT Action

0 No printing is performed.

1 Prints the mean of the time series, the estimate of the overall constant, the estimates of the autoregressive parameters, the estimates of the moving average parameters, and the estimate of the random shock variance.

IMEAN — Option for centering the time series X. (Input) Default: IMEAN = 1.

IMEANAction

0 WMEAN is user specified.

1 WMEAN is set to the arithmetic mean of X.

WMEAN — Constant used to center the time series X. (Input, if IMEAN = 0; output, if IMEAN = 1)

Default: WMEAN = 0.0.

NPAR — Number of autoregressive parameters. (Input) NPAR must be greater than or equal to zero.

Default: NPAR = size (PAR,1).

IMSL STAT/LIBRARY Chapter 8: Time Series Analysis and Forecasting · 729 NPMA — Number of moving average parameters. (Input)

NPMA must be greater than or equal to zero.

Default: NPMA = size (PMA,1).

RELERR — Stopping criterion for use in the nonlinear equation solver. (Input)

If RELERR = 0.0, then the default value RELERR = 100.0 *AMACH(4) is used. See the documentation for routine AMACH (in the Reference Material section of the manual).

Default: RELERR = 0.0.

MAXIT — The maximum number of iterations allowed in the nonlinear equation solver.

(Input)

If MAXIT = 0, then the default value MAXIT = 200 is used.

Default: MAXIT = 0.

FORTRAN 90 Interface

Generic: CALL NSPE(W, CNST, PAR, PMA, AVAR [,…]) Specific: The specific interface names are S_NSPE and D_NSPE.

FORTRAN 77 Interface

Single: CALL NSPE (NOBS, W, IPRINT, IMEAN, WMEAN, NPAR, NPMA, RELERR, MAXIT, CNST, PAR, PMA, AVAR)

Double: The double precision name is DNSPE.

Example

Consider the Wölfer Sunspot Data (Anderson 1971, page 660) consisting of the number of sunspots observed each year from 1749 through 1924. The data set for this example consists of the number of sunspots observed from 1770 through 1869. Routine NSPE (page 727) is used to compute preliminary estimates

0 output in CNST

ˆ ( )

q

1 2 output in PAR

ˆ , ,( )

f f

1 output in PMA

ˆ ( )

q

2 output in AVAR

ˆ (A )

s for the following ARMA (2, 1) model

0 1 1 2 2 1 1

t t t t t

w = +q fw- +f w- -q A- +A

where the errors At are independently distributed each normal with mean zero and variance

2

sA

730 · Chapter 8: Time Series Analysis and Forecasting IMSL STAT/LIBRARY USE GDATA_INT

USE NSPE_INT

INTEGER IPRINT, LDX, NDX, NOBS, NOPRIN, NPAR, NPMA

PARAMETER (IPRINT=1, LDX=176, NDX=2, NOBS=100, NOPRIN=0, NPAR=2, &

NPMA=1)

!

INTEGER IMEAN, MAXIT, NCOL, NROW

REAL AVAR, CNST, PAR(NPAR), PMA(NPMA), RDATA(LDX,NDX), &

RELERR, W(NOBS), WMEAN

!

EQUIVALENCE (W(1), RDATA(22,2))

! Wolfer Sunspot Data for

! years 1770 through 1869 CALL GDATA (2, RDATA, NROW, NCOL )

! USE Default Convergence parameters

! Compute preliminary parameter

! estimates for ARMA(2,1) model CALL NSPE (W, CNST, PAR, PMA, AVAR, IPRINT=IPRINT)

!

END

Output

Results from NSPE/N2PE WMEAN = 46.9760 CONST = 15.5440 AVAR = 287.242 PAR

1 2 1.244 -0.575 PMA

-0.1241

Comments

1. Workspace may be explicitly provided, if desired, by use of N2PE/DN2PE. The reference is:

The additional arguments are as follows:

ACV — Work vector of length equal to NPAR + NPMA + 1.

PARWK — Work vector of length equal to NPAR + 1.

ACVMOD — Work vector of length equal to NPMA + 1.

TAUINI — Work vector of length equal to NPMA + 1.

TAU — Work vector of length equal to NPMA + 1.

IMSL STAT/LIBRARY Chapter 8: Time Series Analysis and Forecasting · 731 FVEC — Work vector of length equal to NPMA + 1.

FJAC — Work vector of length equal to (NPMA + 1)2.

R — Work vector of length equal to (NPMA + 1) * (NPMA + 2)/2.

QTF — Work vector of length equal to NPMA + 1.

WKNLN — Work vector of length equal to 5 * (NPMA + 1).

A — Work vector of length equal to NPAR2. FAC — Work vector of length equal to NPAR2. IPVT — Work vector of length equal to NPAR. WKARMM — Work vector of length equal to NPAR. 2. Informational error

Type Code

4 1 The nonlinear equation solver did not converge to RELERR within MAXIT iterations.

3. The value of WMEAN is used in the computation of the sample autocovariances of W in the process of obtaining the preliminary autoregressive parameter estimates. Also, WMEAN is used to obtain the value of CNST.

Description

Routine NSPE computes preliminary estimates of the parameters of an ARMA process given a sample of n = NOBS observations {Wt} for t = 1, 2, …, n.

Suppose the time series {Wt} is generated by an ARMA(p,q) model of the form f(B)Wt= q0 + q(B)At t Î {0, ±1, ±2, ¼}

where B is the backward shift operator,

f(B) = 1 - f1(B) - f2(B)2 - ¼ - fp(B)p q(B) = 1 - q1(B) - q2(B)2 - ¼ - qq(B)q p = NPAR and q = NPMA. Let

ˆ WMEAN

m =

be the estimate of the mean of the time series {Wt} where

732 · Chapter 8: Time Series Analysis and Forecasting IMSL STAT/LIBRARY

1

known

ˆ 1

unknown

n t t

n W

m m

m m

=

ìï

= íïî

å

The autocovariance function s(k) is estimated by

1

ˆ( ) 1n k( t ˆ)( t k ˆ) 0,1, ,

t

k W W k K

s n - m + m

=

=

å

- - = K

where K = p + q. Note that

ˆ (0) s is an estimate of the sample variance.

Given the sample autocovariances, the routine ARMME (page 720) is used to compute the method of moments estimates of the autoregressive parameters using the extended Yule-Walker equations

ˆ ˆf sˆ å = where

ˆ ( , ˆ

1

, ˆ )

ˆ ˆ ( ) , 1, ,

ˆ ˆ ( ) 1, ,

T p

ij i

q i j i j p

q i i p

f f f

s s s

=

å = + - =

= + =

K

K K

The overall constant

q0

is estimated by

0

1

ˆ 0

ˆ ˆ (1

ip

ˆ

i

) 0

p p q m

m = f

ìï =

= íïî - å >

The moving average parameters are estimated using the routine

MAMME (page 723). Let

t

( )

t

W¢=f B W

then the autocovariances of the derived moving average process

t

( )

t

W¢=q B A

are estimated by

( )

0 0 0

ˆ ( ) 0

ˆ ( )

ip pj

ˆ ˆ

i j

ˆ 1, ˆ 1

k p

k k i j p

s s

f f s f

= =

ìï =

¢ = íïîå å + - ³ º -

The iterative procedure for determining the moving average parameters is based on the relation

2 2 2

1

2

1 1

(1 ) 0

( ) ( ) 1

q A

k k q k q A

k k

k

q q s

s q q q + q q s-

ì + + + =

¢ = íïïî - + + + ³ L

L

where

s

(k) denotes the autocovariance function of the original W

t

process.

IMSL STAT/LIBRARY Chapter 8: Time Series Analysis and Forecasting · 733

Let

t

= (

t0

,

t1

,

¼

,

tq

)

T

and f = (f

0

, f

1

,

¼

, f

q

)

T

where

0

0

/ 1, ,

A j

j

j

j q

t s

q t ìï =

= í-ïî = K

and

0

ˆ ( ) 0, 1, ,

q j

j i i j

i

f - t t+ s j j q

=

=

å

- ¢ = K

Then, the value of

t

at the (i + 1)-th iteration is determined by

1

( )

1

i i Ti fi

t + = -t -

The estimation procedure begins with the initial value

0

( ˆ (0),0, , 0)

T

t = s¢ K

and terminates at iteration i when either ||f

i

|| is less than

RELERR

or i equals

MAXIT

. The moving average parameter estimates are obtained from the final estimate of

t

by setting

ˆ

j j

/

0

for

j

1, ,

q q = -t t = K

The random shock variance is estimated by

2 1

2 0

ˆ (0) ˆ ˆ ( ) 0

ˆ 0

p

i i

A

i q q

s f s

s t

ì - å= =

= íï ïî ³

See Box and Jenkins (1976, pages 498–500) for a description of a similar routine.