1310 Testing Econometric Software
can greatly affect the quality of the numerical derivatives. For example, in the days
when single precision was common,h=0.01 orh=0.001 were common choices.
In the present day, when double precision is standard, smaller values ofhare used.
It is well known that analytic derivatives are generally more accurate than numer-
ical derivatives. It is also well known that there exist some problems for which
implementing analytic derivatives is too difficult, and there is no recourse to
numerical differentiation. ARIMA estimation is just such a case. For CLS, analytic
derivatives are not difficult to implement. Backcasting, however, is another case.
BJ (1976, p. 235) provide the analytic derivatives for an ARMA(1,1) model, where
a(φ)t denotes∂[at]/∂φ:
e(φ)t =w(φ)t −φw(φ)t+ 1 +θet(φ)+ 1 −[wt+ 1 ] (28.10)
a(φ)t =w(φ)t −φw(φ)t− 1 +θa(φ)t− 1 −[wt− 1 ] (28.11)
e(θ)t =w(θ)t −φw(θ)t+ 1 +θe(θ)t+ 1 +[et+ 1 ] (28.12)
a(θ)t =w(θ)t −φw(θ)t− 1 +θa(θ)t− 1 +[at− 1 ], (28.13)
where:
[
wt
]
=wt,t> 0 (28.14)
w(φ)t =w(θ)t =0,t> 0 (28.15)
[e−j]=0,j≥0. (28.16)
These derivatives are tedious but straightforward to implement, and are simi-
lar to the previous use of backward and forward equations. Settinge(φ)n+ 1 =0,
equation (28.10) can be solved fromnto 1. Fort=0,e(φ)t =0 and so this equation
can be re-expressed to solve for values ofw(φ)t ,t≤0. Then, settinga(φ)−Q− 1 =0 and
using the backcasted values ofw(φ)t ,t≤0, equation (28.11) can be solved from
t=−Qtot=n, and similarly for equations (28.12) and (28.13).
By comparison, the analytic derivatives for an ARIMA(1,0,1) are much more
difficult to implement. Then differentiating equations (28.7) and (28.8) yields:
et(φ)=wt(φ)−(wt+ 1 −μ)−φw(φ)t+ 1 +θe(φ)t+ 1 (28.17)
a(φ)t =w(φ)t −(wt− 1 −μ)−φw(φ)t− 1 +θa(φ)t− 1 (28.18)
e(θ)t =w(θ)t −φw(θ)t+ 1 +et+ 1 +θe(θ)t+ 1 (28.19)
a(θ)t =w(θ)t −φw(θ)t− 1 +at− 1 +θa(θ)t− 1 (28.20)
e(μ)t =(w(μ)t − 1 )−φ(w(μ)t+ 1 − 1 )+θe(μ)t+ 1 (28.21)
a(μ)t =(w(μ)t − 1 )−φ(w(μ)t− 1 − 1 )+θa(μ)t− 1 , (28.22)
and programming these, of course, is more difficult than the ARMA(1,1) case.