ABSTRACT
In the analysis of autoregressive-moving average time series
models, the parameter space becomes unwieldy when the order of the
model exceeds two.
An e1;ficient method is given for producing points
in this region either for a random search (for maximum likelihood
estimation) or for numerical integration (for a Bayesian analysis).
A.
INTRODUCTION
Consider the autoregressive-moving average (ARMA) time series model
given by the relation
where the disturbances
e
are independent and identically distributed
t
2
a ,
random variables with mean zero and variance
The ARMA (p,q)
model given by (A,l) can be rewritten in terms of the backshift
operator
k
B Zt
= Zt~k:
S (~,B)z = S (e,B)e
(A.2)
p
where
Sn(y,w)
=1
q
+ ylw + Y2 w2 + .,. + Ynwn
2
(~,e,a)
In order that the parameters
(~ee
Appendix F) the parameter vectors
respectively to the regions
C _ {y:
n
(A.3)
C
P
= (-1
.,
(+ 2, +1)
+1)
and
and
C
2
+
I~=l
YiW
i
of this process be identified
~
e
and
and
are restricted
where
all the roots of Sn(Y,w) = a
exceed one in absolute value}
Hence the parameter space for
C1
=1
(1', e ,a 2 )
is
Note that
is the interior of the triangle with vertices
(0, -1).
Tests for determining whether a poi~t
y
E
n
R
is in
first put forth in the time series literature by Wise [19J.
C
n
were
Using a
formulation in terms of Schur polynomials, Pagano [15J expanded this
work and gave a general algorithm for testing.
obtained by Anderson [2].
A similar result was
All of these tests avoid the computationally
prohibitive task of computing the roots of
S (y,w) = O.
n
2
However, when
n
exceeds 3,
C
becomes quite unwieldy and the
n
Pagano-Anderson-Wise (PAW) tests are not easily used in applications.
This is discussed further in Section D.
G is presented which maps onto
use in integrating over
C
n
algorithm TRACN derived from
C •
n
In this .paper, a transformation
The analysis of
G, especially its
is discussed in the next section.
G is described in Section C.
The
The
motivation and applications of TRACN are discussed in Section D.
Appendix F gives a short discussion of identifiability in ARMA time
series models.
Appendix G.
Listings of programs and a test program are given in
3
B.
THEORETICAL FOUNDATION
The transformation G is based on the well known theorem that any
polynomial with real coefficients can be uniquely factored into linear
factors and real quadratic factors with a negative discriminant
(~acLane
and Birkoff
13, p. 185),
obtained from a point
x
A
Zk
€
Then any point
y
E
C2k
can be
where
(K times)
(B. 1)
by equating the coefficients of the corresponding polynomials (this
defines G):
k
(B.2)
2
11
(1
i=l
Likewise for odd
one point
x
E
p
or
+ x 2i _ l w + x 2i w )
q, every
y
E
C2k+
l
corresponds to at least
A + = C x C x ••. x C x C •
2
2
2
2k l
l
G(A) c C,
n - n
is apparent that
Correspondingly, it
since every point of
A(n)
produces a
G(A
-n ) = Cn
polynomial all whose roots lie outside the unit circle; hence
Let
u
i = 1, , •. ,9"
1, u
u
iO il = x 2i- l ' i2 = x 2i '
and let
u9,,2
=0
if
29" >
where- 9" = [(N+l) /2J
n (odd n), then the mapping
can be defined more precisely by
y
= G(x)
G: A
n
-+ C
n
where
(B.3)
where
i
= 1,.",
9,,; j.1. =- 0,1,:2,
.
_
.
and
I
Also (B,2) can be rewritten more generally
(B.2 *)
S (y,w)
n
=
9"
11
i=l
(1 + x
is an indicator function.
(x. = 0
1.
2
w
+
x
w)
•
2i l
2i
if
i > n):
.
4
n = 4; (B.2 *) then becomes
To illustrate, let
(B.4)
and
(B.5)
traversing
Thus one problem,
all of
A,
n
all of
e,
n
is solved by traversing
a much simpler task, and using the mapping G.
half of the problem, integration over
en ,
The other
is much more difficult,
because G is not a one-to-one mapping and the standard result (see e.g.,
Buck [6J, Theorem 4, p. 304 or Fleming [lOJ, Theorem 17, p. 175)
fA g(G(~))
(B.6)
IJG(x) Idx
=
Ie
n
does not apply.
transformation
JG(x)
G at
g(y)dy
n
is the determinant of Jacobian matrix of the
x:
(B. 7)
THEOREM.
Let
NG(y)
be the number
l
of points in
any finite valued Lebesgue measurable function
(B.8)
Jen
G-l({y}), then for
g:
g(y)NG(y)dy.
lIf the integration is to be taken over a (Lebesgue measurable)
subset B of A , then NG(y) must be adjusted to count only points in
BnG-l({y}). n
5
PROOF.
This is an application o£ Theorem 2.vi, p. 374 of Rado and
Reichelderfer [16J.
The condition that
G be generalized Lipschitzian
follows from Lemma 5, p. 375, and Lemma 1, p.
coordinate functi.on of
G to be Lipschitzian.
33~,
which requires each
This last condition is
satisfied since each coordinate function is a finite sum of multinomials
of bounded variables.
The remaining problem is to compute
in
An
which .. yield the same polynomial,
NG(G(x», the number of points
Sn (G(x),w).
.
Different points
can be obtained either by permutating the index of the quadratic
factors,
(B.9)
where
tr
is a permutation of
i
= l, ••. ,k
= [N!2J,
or by rearranging
the pairing of real roots 2
(B .10)
(J+aw) (l+bw) (l+cw)
=
2
Cl+(a+b)w+abw ) (l+cw)
= (1+(a+c)w+acw2}(1+bw)
=
2
(1+(b+c)w+bcw ) (l+aw)
Several examples are given in Table 1.
Notice that since
S (y,w)
n
is
real, all of the complex roots must be paired with conjugates together.
S (G(x),w) = 0
n
a counting argument 3 leads to
Given that
has
j
pairs of complex roots,
2Polynomials without distinct roots have Lebesgue measure zero
and are ignored here.
3There are k! permutations of the quadratic factors as in (B.9).
There are (p-~)1![2k-J(k-j)!J ways of making k - j pairs from n - 2j
real roots •.
6
(B .11)
Table 3 lists
M (j)
n
for
n
=
1~
••• ,10.
The number of pairs of complex
roots can be found by counting the number of times the discriminant
2
(~2i-1
-e
- 4x 2i )
is negative, i
= 1, ••• ,k = [N/2].
7
Table 1.
Case 1:
n
-1
Examples of
G
'
({l})
= 3, Sn (y,w) = (1 + 5/6 + 3/8 w2 + 1/2 w3)
w
Roots are
= -2,
-3, -4.
=3
M (0)
3
.
t5/6. 1/6, 1/4) }
= (3/4, 1/8, 1/3)
G-\{Y})
(7/12, 1/12, 1/2)
Case 2:
n
= 3, Sn'(y,w) = 1 + 1/2 w +
Roots are
w
=+
i -
Ow
2
3
- 1/4 w
1,2
G- 1 ({y}) = {(1, 1/2, -1/2)}
= (1 +
Sn(Y'w)
Case 3:
2
n = 4, S (y,w) = (1 + Ow + 5/36 w +
n
Roots are
-1
G ({Y}) =
Case 4:
2
w + 1/2 w )(1 - 1/2 w)
n
= 4,
w = ± 2i, + 3
rto,
o,
S (y,w)
n
Roots are
w
=
M (1) = 2
4
1/4, 0, -1/4)1
-1/9, 0, 1/4)j
= (1
4
+ Ow - 13/36 22 + Ow3 + 1/36 w )
+ 2, + 3
(0, -1/4, 0, -1/9)
G- 1 ({y})
=
(0, -1/9, 0, -1/4)
(-5/6, 1/6, 5/6, 1/6)
(-1/6, -1/6, 1/6, -1/6)
(1/6, -1/6, -1/6, -1/6)
(5/6, 1/6, -5/6, 1/6)
·e
aw3 + 1/36 w4)
8
Table 2
Mn (j)
k
e
·e
1
k j
2 .... (k-j)!
2
3
4
0
1
1
1
2
1
1
1
3
3
1
2
4
6
2
2
2
5
30
6
2
3
6
90
18
6
6
3
7
630
90
18
6
4
8
2520
360
72
24
24
4
9
22680
2520
360
72
24
10 113400
12600
1800
360
120
5
k
0
= k! (n~2j)!
=
[n/2}
5
120
9
C.
ALGORITHM TRACN
Algorithm TRACN takes a point
x
from
A
and renders
n
/
The algorithm is described
in pseudo-Algol in Table 3 and a FORTRAN listing is given in Appendix G.
There are basically three steps to the operation.
1)
Obtain
2)
Compute
G(x),
3)
Compute
J (x) •
G
XIS
and count the pairs of complex roots,
The first part is rather straightforward.
In the FORTRAN sub-
routine TRACN, external references are made to RUIRI and RUIR2 which
furnish points from
C
l
and
G(x) pis more formidable.
C , respectively.
2
The problem of computing
In order to multiply the
nomials together, a nesting of loops for indices
was simulated and the
was used.
r
r
x
Every combination of 0,1,2 in
calculated and
=°
formulation of
y
incremented by
quadratic poly-
Q,
jl, ••• ,jQ,
in terms of
u..
jl
jQ,
through
~J
and (B.3)
was obtained,
The values for
p = TIu ••
~Ji
were computed and forgotten.
The final part of the problem, that of computing
follows simply.
A matrix is formed to hold
relevant columns are chosen for
OYr
-.,......::-~=
(ay/ax).
(ay/au)
JG(x) ,
now
from which the
Now
I
ji,· .. ,jQ,
hence the desired increment to
(ay /au)
r
is
p/u.*. * •
nested looping ceases and all combinations 0,1,:2
indices
jl, •.• ,jQ,' (oy/ax)
~
J
Once the
i
appear for the
can be found by deleting the columns
10
corresponding to
(oy/ou)
u.
~o
and,
i f 2,Q, > n, u,Q,2 •
is stored transposed in
Jacobian matrix
(oy/ax),
PGPX; the determinant of the
placed in array A, is 90mputed by GESEPP,
a general linear equations solver.
're
In the subroutine TRACN,
11
Table 3:
1.
£ + [(n+l)/Z]; j
Z.
Initialize
3.
(Obtain
for
and
PGPX
to
0;
and count pairs of complex roots)
XIS
i - 1, ... ,£
begin
0;
+
GX
Algorithm TRACN
do
u iO = 1;
~
if (Z*i
n) then (choose (uil,u iZ ) from CZ)
else begin
u£Z
+
0;
(choose u
il
from C );
l
end;
if (U~l
>
4*u iZ )
then (increment j by 1);
end;
4.
= PGPX)
(Find G and (ay/au)
for i = 1, ... ,£
do
for index (i)
= O,l,Z
do
begin
Compute
Compute p
r =
~
Index (i);
= TIu.1,1n
, d ex
(i) ,
GX(r) = GX(r) + p;
Comment (ay/au)
= P/ui,index
(i)'
PGPX(i, index (i),r) = PGPX (i, index (i) ,r) + p/u,1,1n
'd ex (')
.1
end;
5.
Load A = jacobian matrix with relevant parts of PGPX;
6.
Compute the determinant of A and return /det AI;
12
MOTIVATION AND APPLICATIONS
D.
To explain the value of TRACN, consider that two statistical
methodologies can be applied to the majority of nonstandard statistical
problems, maximum likelihood and Bayesian methods.
hood (see, e.g.
of
~
and
e
~
Theil [18J) ,
In maximum 1ike1i-
the likelihood function, here a function
for a given set of observations, must be maximized
over the parameter space
C xC.
p
In most situations, this maximi-
q
zation must be done numerically.
4
In a Bayesian ana1ysis 5 , since
analytic expressions for the posterior distributions do not exist, it
is necessary to integrate numerically over
Consider now how the PAW tests
C xC.
p
q
apply to these two computational
C xC.
problems, beginning with integration over
p
q
Either a mechanical quadrature procudt rule [17J or a Monte Carlo
method [11J must be employed to produce abscissas over a simple,
usually rectangular, region containing
C •
n
An indicator function,
based on the PAW tests and vanishing if the abscissa is outside
must be computed for each point.
will be inefficient since
n-dimensional box.
C
n
Both methods of numerical integration
does not fit snugly inside an
n
The poor fit is displayed in Table 4,
estimates of the volumes of
C ,
C
n
giv~ng
and an enclosing box.
For the problem of optimizing over
C xC, the tests, being a
p
q
"b1ack'-box" type of function do not help in locating the boundary of the
4 Th e op t~m~z~ng
'"
function of (~,e).
5
(1
2
can be found analytically as a (complicated)
For the framework of Bayesian inference, see DeGroot [8J or
Zellner [20J. The Bayesian analysis of ARMA time series models is the
object of the author's current research [14J.
13
constrained region.
Moreover, the penalty method [1,12J of constrained
optimization is not easily applied here.
are just checks.
The Wise and Anderson results
Pagano's method of checking whether the Schur matrix
(a function of y) is positive definite shows some hope but it is
unclear how to measure hqw close to
is and hence how close
y
"not~positive-definite" the
matrix
is to the boundary.
Algorithm TRACN cannot be used directly in maximum likelihood
with any standard optimization method based on local properties since
the mapping
G:
A
n
+
C
n
is not
one~to-one.
However, neither local
optima of the likelihood function nor other aberrant behavior can
precluded from the problem of maximum likelihood, especially for
large
p
or
q.
TRACN can then be useful in the problem of global
optimization in two ways.
First, a common method in global problems [9J
is to employ a locally-based search method from several randomly chosen
starting points, which TRACN can insure to be in
C •
n
More importantly
current practice should .be improved greatly by using TRACN to do a
preliminary pure random search [4J.
Since near its global maximum the
likelihood function is nearly always well behaved, locally-based
optimization algorithms armed with a coarse but reliable starting
point should then quickly succeed.
Given the irregular shape of
C
n
as indicated in Table 4, TRACN
provides the only practical hope for integrating over
suited for Monte Carlo integration, which for
the only logical approach [7J.
some warnings, however.
n
C .
n
TRACN is best
greater than 3, is
The use of mechanical quadrature requires
First, a different set of abscissas must be
used for each triangle
C making up
2
sampled simultaneously,
(aG(x)/ax)
A.
n
If identical points are
will be singular and the algorithm
14
will fail.
Secondly, no sampled
x
should take the exact value
since the algorithm will treat this as the odd case
will be incorrect
add
10-
6
6
(G(x)
NG(G(x»
J
G
The easy way out is just to
(or smaller) to all of the points.
user should be warned that
of x,
will be fine).
2t > nand
0,
Finally, the potential
is a rather discontinuous function
hence the order of convergence for fixed integration rules will
seldom hold up.
Note that this is not a concern in Monte Carlo inte-
gration.
6There appears to be no efficient way to circumvent this.
15
Table 4
Approximate Volumes of
n
and Enclosing Box
n
Volume of C
n
Volume of Box
3
5.3 *
3.2 x 10 1
.17
4
7.1
3.2 x 10 2
.022
5
7.7
l.9x 10 3
.004
6
8.3
2.6 x 105
5
3 x 10-
7
7.0
6.4 x 10 5
1 x 10- 5
8
8.0
l.Ox 10
7
8 x 10- 7
*Exact
·e
C
value is 16/3.
Ratio
16
E.
REFERENCES
Introduction to
[lJ
Adby, P. R. and M. A. H. Dempster (1974).
Optimization Methods, Wiley, New York.
[2J
Anderson, O. D. (1975). "The Recursive Nature of the Stationary
and Invertibility Constraints on the Parameters of Mixed Autoregressive-Moving Average Processes," Biometrika 62,
pp. 704-706.
[3J
Anderson, T. W. (1970).
Wiley, New York.
[4J
Anderssen, R. S. (1972). "Global Optimization," in Optimization~
ed. R. S. Anderssen, et al., U. of Queensland Press, pp. 26-48.
[5J
Box, G. E. P. and G. M. Jenkins (1976). Time Series Analysis:
Forecasting and Control (Rev. ed.), Holden Day, San Francisco.
~6J
Buck, R. C. (1965).
New York.
[7J
Davis, P. J. and P. Rabinowitz (1975).
Academic Press, New York.
[8J
DeGroot, M. H. (1970).
New York.
[9J
Dixon, L. C. W. and G. P. Szego, eds. (1975).
Optimization, North Holland, Amsterdam.
The Statistical Analysis of Time Series,
Advanced Calculus (2nd. ed.), McGraw-Hill,
Numerical
Integration~
Optimal Statistical Decisions, McGraw-Hill,
Towards Global
[lOJ
Fleming, W. H. (1965). Functions of Several Variables, AddisonWesley, Reading, Mass.
[llJ
Hammersley, J. M. and D. C. Handscomb (1964).
Methuen, London.
[12J
Luenberger, D. G. (1969).
Wiley, New York.
[13J
MacLane, S. and G. Birkhoff (1967).
[14J
Monahan, J. F. (1980), "A Structu1;'ed Bayesian Approach to ARMA
Time Series Models," Institute of Statistics Mimeo Series
No. 1297, N. Carolina State Univ.
[15J
Pagano, M. (1973). "When is an Autoregressive Scheme Stationary?"
Comm. Stat. 1, pp. 533-544.
[16J
Rado, T. and P. V. Reichelderfer (1955).
in Analysis, Springer-Verlag, Berlin.
Monte Carlo Methods,
Optimization by Vector Space Methods,
Algebra, MacMillan, New York.
Continuous Transformations
17
[17J
Stroud, A. H. (1971). APproximate Calculation of MUltiple
Integrals, Prentice-Hall, Englewood Cliffs, N.J.
[18J
Theil, H. (1971).
[19J
Wise, J. (1956). "Stationary Conditions for Stochastic Processes
of the Autoregressive and Moving Average Type," Biometrika 43,
pp. 215-219.
[20J
Zellner, A. (1971). An Introduction to Bayesian Inference in
Econometrics, Wiley, New York.
Principles of Econometrics, Wiley, New York.
18
. APPENDIX F.
IDENTIFIABILITY
Problems concerning identifiability * arise in one of two ways:
parameter redundancy or insufficient observations to distinguish between
models.
Only the first will be considereq here and the number of
observations of the stochastic process
{Zt}
of (A.l) is considered
infinite.
Given the observation vector
butions
x
arising from a family of distri-
p(xlw), W E ~, W is identified iff
(F.l)
P(x!w ) = p(xlw )
2
l
For a stationary Gaussian time series model,
equivalent to
e
fP.1wl) = f(A!W )
2
where
2
(J
f (A IcP , e, (J
(F.2)
)
is the spectral density
7J, which for an
of the process [3, especially Ch.
2
f(Alw)
21f
ARMA process is
2
r
er
L
cPs e
r=l
=
s=l
e
Dr
Ds
2
Parameter redundancies arise in the following manner.
be the roots of
v., i=l, ... ,q
~
q
I
r=l
*Box
Let
S (8,w) = 0, hence
q
(F.3)
is
=
q
II
r=l
"
Ie ~I\
-
I .
v
r
and Jenkins [5J use the term "model multiplicity" to indicate
lack of identification.
19
hence if
S (6 * ,w)
q
~F'. 4)
and
Sq-(6 * ,w)
=
II
rrr*
v
2
(4),6,0)
and
(<p,6
2
(4),6,0)
the same distribtion and
is real,
(w
. - v r ). (w - l/vr *)
will be a polynomial with real coefficients.
parameter points
r
* ,0 2v 2*)
r
Hence, the
are different but yield
is not identified.
Notice any real
root can be selected, perhaps many at a time, so that the resultant
polynomial
*
S q(6 ,w)
has some of its roots flipped.
be flipped also if chosen in conjugate pairs.
changes can be done to the denominator
parameters.
However, restricting
4>
of
to
Complex roots can
Notice that the same
feA) , the autoregressive
C
p
and
6
to
C
q
make these
reparameterizations invalid, since the flipping would then produce a
root inside the unit circle.
if the parameter space
'¥
Hence
2
(4),6,0)
is restricted to
**An additional constraint must be that
have no root in common.
will be identified **
S (ep,w)
p
and
S (6,w)
q
20
APPENDIX G
The following are programs to test TRACN.
The Structure:
Note:
These programs were implemented in double precision mainly to
aid the performance of PAWTS.
To change to single precision,
change all of the REAL*8 references to REAL, change DABS to ABS
(three times), and delete DBLE from RUIRZ.
21
00010
00020
00030
40
• 50
00060
00070
00080
00090
00100
00110
00120
00130
00140
00150
00160
00170
00180
00190
00200
00210
00220
00230
00240
00250
00260
00270
00280
.90
~300
00310
00320
00330
00340
00350
00360
00370
00380
00390
00400
00410
00420
00430
00440
00450
00460
00470
00480
00490
00500
00510
00520
00530
40
• 50
00560
00570
00580
00590
00600
C USE PAWTS TO CHECK IF TRACN GIVES ALL ROOTS OUTSIDE UNIT CIRCLE
REAL*8 VEC(10),JACOB
LOGICAL OUTSID,PAWTS
JACOB=RAN(7372585)
D01N=1,10
DO 21=1,3
CALL TRACN(N,VEC,JACOB,M)
OUTSID=PAWTS(VEC,N)
WRITE(3,22) N,I,OUTSID,(VEC(J),J=1 ,N)
CONTINUE
2
1
CONTINUE
22 FORMAT(1X, 'N=' ,13,13,' OUTSIDE? ,L1,' VEC=',5F10.6/27X,5F10.6)
STOP
END
LOGICAL FUNCTION PAWTS(V,N)
REAL*8 V(10),ALPHA(11 ),A(10,10),T,S
INTEGER N,IDET,I,J,K,IM1 ,JM1
C TEST TO SEE IF THE POLYNOMIAL Z**N+V(1 )*Z**(N-1)+ ... +V(N-1 )*Z+V(N)=O
C HAS ALL OF ITS ROOTS INSIDE THE UNIT CIRCLE
C PAGANO, COMM. STAT. V1 NO 6 (1973), PP.533-544.
C FIRST SET UP ALPHA'S 1 TO N+1 INSTEAD OF 0 TO N (DAMN FORTRAN!)
NP1 =N+1
ALPHA( 1 ) =1 .
DO 2I=1,N
2
ALPHA(I+1)=V(I)
C SET UP SCHUR'S MATRIX .... BRUTE STRENGTH, SEE P.537
DO 3J=1,N
DO 3K=J,N
A(J,K)=O.
DO 4L=1,J
4 A(J,K)=A(J,K)+ALPHA(J-L+1)*ALPHA(K-L+1)
1-ALPHA(NP1+L-J)*ALPHA(NP1+L-K)
3
A(K,J)=A(J,K)
C NOW CHECK TO SEE IF SCHUR'S MATRIX A IS POSITIVE DEFINTIE
C USING MODIFIEDCHOLESKY FACTORIZATION A=L*D*L-TRANSPOSE
PAWTS=.FALSE.
DO 6I=1,N
T=A(I,I)
IF(I.EQ.1) GO TO 5
IM1=I-1
C SOLVE FIRST L(N-1 )*X=AS(N)
DO 7J=1,IM1
S=A(I,J)
IF(J.EQ.1) GO TO 7
JM1 =J-1
DO 8K=1,JM1
8
S=S-A(J,K)*A(I,K)
7
A(I,J)=S
C SOLVE NOW D(N-1 )*LS(N)=X, GET D(N)
DO 9J=1,IM1
S=A(I,J)
A(I,J)=A(I,J)/A(J,J)
9
T=T-S*A(I,J)
5
A(I,I)=T
IF(T.LT.-1.D-6) RETURN
IF(T.LE.O .. AND.I.NE.N) RETURN
6
CONTINUE
PAWTS=. TRUE.
RETURN
END
I
22
QIIl10
_20
00630
00640
00650
00660
00670
00680
00690
00700
00710
00720
00730
00740
00750
00760
00770
00780
00790
00800
00810
00820
00830
00840
00850
60
• 70
00880
00890
00900
00910
00920
00930
00940
00950
00960
00970
00980
00990
01000
01010
01020
01030
01040
01050
01060
01070
01080
C
C
C
C
C
C
C
C
C
C
SUBROUTINE TRACN(N,VEC,JACOB,MNOJ)
TRACN GENERATES THE RANDOM COEFFICIENTS OF POLYNOMIALS OF DEGREE N
(N LE 10) ALL WHOSE ROOTS ARE GREATER THAN ONE IN ABSOLUTE VALUE
TO INTEGRATE OVER THIS SPACE OF COEFFICIENTS, JACOB AND MNOJ NEEDED
JACOB= DETERMINANT OF JACOBIAN OF TRANSFORMATION
MNOJ= LOCAL MULTIPLICITY OF TRANSFORMATION' TO THIS SPACE FROM THE
ORIGINAL CARTESIAN PRODUCT OF TRIANGLES AND (ODD ONLY) INTERVAL
IF FIXED INTEGRATION RULE IS PREFERRED, REPLACE RUIR2 AND RUIR1 WITH
APPROPRIATE SUBPROGRAMS WITH EXTRANEOUS ACCESS TO WEIGTHS
RUIR2 TAKES POINTS UNIFORMLY FROM TRIANGLE
WITH AREA 4
RUIR1 TAKES POINTS UNIFORMLY FROM INTERVAL
WITH LENGTH 2
REAL*8 VEC(10),JACOB,XX(5,3),GX(11),PGPX(15,11),A(10,10),X,Y,PROD
INTEGER INDEX(5),MNOJP1 (6,10),PT
DATA MNOJP1/1,
0,
0,
0,
0,
0,
2
1,
3
3,
1,
1,
0,
0,
4
5
6
6,
2,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
30,
2,
0,
90,
18,
6,
6,
7
630,
90,
18,
6,
0,
8
2520,
360,
72,
24,
24,
9
22680,
2520,
360,
72,
24,
*
113400, 12600,
1800,
120,
360,
C GET L FIRST
L=(N+1)/2
C INITIALIZE
J=O
DO 191=1,11
GX(I)=O.
DO 19K=1,15
19 PGPX(K,I)=O.
C GET RANDOM XIS
D010I=1,L
XX(I,1)=1.
IF(2*I.LE.N) GO TO 9
C 'TAKE CARE ODD N
CALL RUIR 1(X)
Y=O.
GO TO 8
CALL RUIR2(X,Y)
9
8
XX(I,2)=X
XX(I,3)=Y
C CHECK IF COMPLEX PAIR HERE ... INCREMENT J IF SO
IF(X*X-4.*Y.LT.0.) J=J+1
10 CONTINUE
C MNOJ=K! (N-2J) !/( (K-J) !2**(K-J)) ... K=N/2
C J= NO OF PAIRS OF COMPLEX ROOTS
MNOJ=MNOJP1 (J+1 ,N)
0,
0,
120/
23
01090 C NOW TRANSFORM
.00 C SIMULATE LOOPS TO GET ALL PRODUCTS
~10
DO 1I=1,L
01120
1
INDEX(I)=O
01130
2
PT=1
01140
INDEX(PT)=O
3
CONTINUE
01150
01160 C PROCESS EACH PRODUCT: XX(1,?)*XX(2,?)* ... *XX(L,?)
PROD=1.0
01170
IEXPP1=1
01180
DO 11I=1,L
01190
01200
INDY=INDEX(I)
01210
IEXPP1=IEXPP1+INDY
01220
11 PROD=PROD*XX(I,INDY+1)
01230 C STASH PRODUCT OF TRANSFORMATION
01240
GX(IEXPP1 )=GX(IEXPP1 )+PROD
01250 C NOW TAKE CARE OF MATRIX FOR JACOBIAN
01260
DO 12I=1,L
01270
INDYP1=INDEX(I)+1
01280
IF(XX(I,INDYP1).EQ.0.) GO TO 12
01290
IPT=3*(I-1)+INDYP1
PGPX(IPT,IEXPP1 )=PGPX(IPT,IEXPP1 )+PROD/XX(I,INDYP1)
01300
12 CONTINUE
01310
01320 C FINISH SIMULATED LOOPING
4
INDEX(PT)=INDEX(PT)+1
01330
IF(INDEX(PT).NE.3) GO TO (3,2,2,2,2),PT
40
INDEX(PT)=O
50
o 360
PT=PT+1
IF(PT.LE.L) GO TO 4
01370
01380 C NOW GET WANTED ELEMENTS FOR JACOBIAN
DO 13I=1,N
01390
VEC(I)=O.
01400
01410
DO 13K=1,N
13 A(I,K)=PGPX((3*I+1)/2,K+1)
01420
01430 C GESEPP IS GENERAL SIMULTANEOUS EQUATIONS SOLVER
CALL GESEPP(A,N,JACOB,VEC)
01440
01450 C JACOB NOW HOLDS THE DETERMINANT OF THE JACOBIAN MATRIX
01460 C DON'T FORGET TO TAKE THE ABSOLUTE VALUE
JACOB=DABS(JACOB)
01470
01480 C NOW LOAD VEC WITH COEFFICIENTS
01490 C POLY IS 1+VEC(1 )*W+VEC(2)*W**2+ ... +VEC(N)*W**N
DO 14I=1,N
01500
14 VEC ( I ) =GX(1+1 )
01510
RETURN
01520
END
01530
~
24
0
. 450
01560
01570
01580
01590
01600
01610
01620
01630
01640
01650
01660
01670
01680
01690
01700
01710
01720
01730
01740
01750
01760
01770
01780
.90
00
01810
01820
01830
01840
01850
01860
01870
01880
01890
01900
01910
01920
01930
01940
01950
SUBROUTINE RUIR1(X)
C RETURNED X IS UNIFORMLY DISTRIBUTED, ON (-1,+1)
C RAN IS A UNIFORM(0,1) PSEUDORANDOM NUMBER GENERATOR
REAL*8 X,S
DATA S/-1./
X=2.*RAN(1 )
IF(X.GT.1.) X=S*(X-1.)
RETURN
END
SUBROUTINE RUIR2(X,Y)
C RETURNED X,Y IS UNIFORMLY DISTRIBUTED ON TRIANGLE (0,-1 ),(-2,1 ),(2,1)
C RAN IS A UNIFORM(0,1) PSEUDORANDOM NUMBER GENERATOR
REAL*8 X,Y,R,S,H
R=DBLE(RAN(1 ))
S=DBLE(RAN(2))
IF(R.GT.S) GO TO 2
H=R
R=S
S=H
2
X=2.0*(R+S-1.)
Y=2.*(S-R)+1.
RETURN
END
REAL FUNCTION RAN(IXX)
C UNIFORM PSEUDORANDOM NUMBER GENERATOR
C FORTRAN VERSION OF LEWIS, GOODMAN, MILLER
C SCHRAGE, ACM TOMS V.5 (1979) P132
C FIRST CALL SETS SEED TO lXX, LATER IXX IGNORED
INTEGER A,P,IX,B15,B16,XHI,XALO,LEFTLO,FHI,K
DATA A/16807/,B15/32768/,B16/65536/,P/2147483647/
DATA IX/O/
IF(IX.EQ.O) IX=IXX
XHI=IX/B16
XALO=(IX-XHI*B16)*A
LEFTLO=XALO/B16
FHI=XHI*A+LEFTLO
K=FHI/B15
IX=(((XALO-LEFTLO*B16)-P)+(FHI-K*B15)*B16)+K
IF(IX:LT.O) IX=IX+P
RAN=FLOAT(IX)*4.656612875E-10
RETURN
END
25
60
70
o 80
01990
02000
. 02010
02020
02030
02040
02050
02060
02070
02080
02090
02100
02110
02120
02130
02140
02150
02160
02170
02180
02190
02200
10
20
o 230
02240
02250
02260
02270
02280
02290
02300
02310
02320
02330
02340
02350
02360
02370
02380
02390
02400
02410
02420
02430
1
1
SUBROUTINE GESEPP(A,N,DET,B)
GAUSSIAN ELIMINATION WITH PARTIAL PIVOTING
SOLVES A*X=B, A IS DESTROYED,
B IS OVERWRITTEN WITH SOLUTION X
A IS N BY N, B IS N BY 1, 1 LE N LE 10, DIMENSION 10 IS ARBITRARY
DET= DETERMINANT OF A
J F MONAHAN
CURRENT VERSION JULY 1980/
REAL*8 A(10,10),B(10),DET,S,T
DET=1 .
NM1 =N-1
IF(N.EQ.1) GO TO 7
DO 61=1 ,NM1
IP1=I+1
S=O.
DO 1J=I,N
C LOOK FOR GOOD PIVOT IN I-TH COLUMN
IF(DABS(A(J,I)).LE.S) GO TO 3
L=J
S=DABS(A(J,I))
CONTINUE
C DON'T SWITCH IF AVOIDABLE
IF(I.EQ.L) GO TO 6
DO 2K=I~N
T=A(I,Kj
A(I,K)=A(L,K)
2
A(L,K)=T
T=B(I)
B(I)=B(L)
B(L)=T
DET=-DET
C ELIMINATE
3
DO 5J=IP1,N
S=-A(J,I)!A(I,I)
DO 4K=IP1 ,N
4
A(J,K)=A(J,K)+S*A(I,K)
5
B(J)=B(J)+S*B(I)
6
DET=DET*A(I,I)
DET=DET*A(N,N)
7
C ELIMINATION DONE----NOW BACKSOLVE
B(N)=B(N)!A(N,N)
IF(N.EQ.1) RETURN
DO 9J=1,NM1
I=N-J
IP1=I+1
DO 8K=IP1 ,N
8
B(I)=B(I)-A(I,K)*B(K)
9
B(I)=B(I)!A(I,I)
RETURN
END
C
C
C
C
C
26
watfiv tgrip5.fort
WATFIV COMPILATION
COMPILATION COMPLETE
1 OUTSIDE? T
.~ 2 OUTSIDE? T
N= 1 3 OUTSIDE? T
N= 2 1 OUTSIDE? T
. N= 2 2 OUTSIDE? T
N= 2 3 OUTSIDE? T
N= 3 1 OUTSIDE? T
. N= 3 2 OUTSIDE? T
N= 3 3 OUTSIDE? T
N= 4 1 OUTSIDE? T
N= 4 2 OUTSIDE? T
N= 4 3 OUTSIDE? T
N= 5 1 OUTSIDE? T
VEC=
VEC=
VEC=
VEC=
VEC=
VEC=
VEC=
VEC=
VEC=
VEC=
VEC=
VEC=
VEC=
-0.047594
0.928670
0.165734
-0.088458 -0.060604
0.520892 0.206442
0.632889 0.336010
-0.257669 0.368785 -0.110866
0.144436 0.032676 -0.100029
1 .779031 1 .088213 0.286036
-1 .058543 0.316726 0.329597 -0.342188
-0.710463 -0.278300 0.803767 -0.348730
-0.580424 0.187076 -0.060817 0.003364
-1.940971 1 .198988 0.265220 -0.762863
0.245583
N=
5
2
OUTSIDE? T VEC=
0.335461
1 .677051
0.563330
0.874807
0.326085
N=
5
3
OUTSIDE? T VEC= -1 .234970
0.117741
0.561794 -0.594805
0.229232
0.349930 -0.159932 -0.287869
0.253802
0.468332
0.006973
OUTSIDE? T VEC= -0.612452
-0.278649
N= 6 2 OUTSIDE? T VEC= -1.220780
0.013335
N= 6 3 OUTSIDE? T VEC= 0.545736
-0.181465
N= 7 1 OUTSIDE? T VEC= -0.765826
0.318127
7 2 OUTSIDE? T VEC= 1.318575
-0.100900
, N= 7 3 OUTSIDE? T VEC= 0.673042
0.099433
. N= 8 1 OUTSIDE? T VEC= -0.636126
0.044784
N= 8 2 OUTSIDE? T VEC= 0.279849
0.045881
N= 8 3 OUTSIDE? T VEC= 1 .105256
0.072957
N= 9 1 OUTSIDE? T VEC= -0.744113
0.341173
N= 9 2 OUTSIDE? T VEC= 1.169027
-0.001561
N= 9 3 OUTSIDE? T VEC= -1.581407
0.008024
N= 10 1 OUTSIDE? T VEC= 0.994891
0.473775
N= 10 2 OUTSIDE? T VEC= -0.285989
0.142303
N= 10 3 OUTSIDE? T VEC= 1 .734054
0.101664
STATEMENTS EXECUTED= 130779
N=
6
•
.~;f
1
1.119371 -0.983899
0.102358 -0.138618 -0.368020 -0.715616
-0.574328
-0.070376
1.056819
-0.005162
0.052813
0.009272
0.348677
-0.013545
-0.724300
-0.238824
1 .862984
-0.029502
1.089365
-0.173896
-0.592276
0.003932
0.215439
-0.113739
0.940317
0.474974
1.384587
-0.594556
1 .844204
0.087318
0.711938 -0.675878
0.059140
0.261822 -0.193827 -0.056290
-0.018260 -0.462352 -0.072992
-0.775713 0.844114 -0.108362
0.007095
0.226236 0.170171 0.192251
-0.027930
1.057405 0.743716 0.115142
0.023494
-1.367273 0.858330 -0.543865
0.055020 -0.006690
-0.815448 -0.079767 -0.033202
-0.000490 0.000016
0.072616 0.904987 -0.598849
0.113855 0.001056
1.326104 1.240242 0.702571
0.106081 0.060867 0.034185
-0.118786 0.464443 -0.313202
0.334711 -0.275455 0.121123
1.743714 1.065129 0.349692
0.023303 0.006772 -0.000753
CPU(00:00:04) EXCP(00:00:03) IWT( 18,00:00:02) OWT( 12,00:00:01)
CONNECT(00:20:35) MEMORY USED( 200K) APPROX. COST($1.04)
USER07 LOGGED OFF TSO AT 16:22:16 ON AUGUST 10, 1980+
© Copyright 2026 Paperzz