ENUMERATION OF ELEMENTARY t·1ULTI-liWI CES FOR
MULTIVARIATE FOURIER SERIES
by
JOHN H. MONAHAN
INSTITUTE OF STATISTICS tlIMEO SERIES No. 1338
1 9 8 1
Enumeration of Elementary
~ulti-indices
for
Multivariate Fourier Series
Abstract
An algorithm is given that produces a set of elementatry multiindices that facilitate the expression of multivariate Fourier series.
Key words:
Multi-index, multivariate Fourier series, simulating nested
loops
I.
Introduction
A Fourier series expansion of a function
f
in
can be written as
(1)
where
1
2
• 1.
The vector
k
=
(k , ... ,~)T
I
is called a muZti-index.
A typical term in the expansion (1) can then be written as
The
L
1
norm is natural for the
~ulti-ind~~
and can be written as
(2)
Thus the finite Fourier expansion can be written analagously to (1)
with the summation restricted to
the multi-index:
,
I
, J
I'
~Ik.
<
K , a bound on the norm of
f(x) -
(3)
'"
L
Ilkll
<
The limit of the Fourier expansion is then defined by taking
K
arbitrarily large in the right bound side of (3).
For the Fourier series to be real-valued, the coefficients must
satisfy
a. ,. a
it
-k
where the bar denotes complex conjugate.
Enforcing this condition and
others with economic interpretations (see Gallant, 1981) suggests a
rewriting of (3) as
(4)
where the vectors
k
a
indexing these vectors.
are called
eLement~J muZ~i-indiae8,
with
~
A multi-index is called elementary if it
cannot be expressed as an integer multiple of another multi-index with a
smaller norm.
Since non-negative integer multiples are permitted, an
additional normalization restriction must be that the first nonzero entry
be positive.
Hence (0,1,2), (0,1,-2) and (1,-1,-1) are elementary;
(0,2,4), (0,-1,2), and (-1,1,1) are not.
The bound
A in (4) represents the number of elementary multi-
indices whose norm is less than
K, and
J,
which depends on
a,
largest integer that satisfies
J
Ilk(l! i
< K
The zero vector is a special case and must be treated separately.
is the
II.
The Algori thm
The problem at hand, then, is to produce a table of elementary
vectors
ka
Ilka II
such that
~ K.
The approach is essentially to
produce all multi-indices with norm not exceeding
K and deleting those
that are not elementary.
Recall that the first restriction on elementary multi-indices is
that it cannot be expressed as an integer multiple of another multi-index
with a smaller norm.
all
Given a prime number
j . 1, ••• ,N, then
ka
p, if
(ka)j mod p • 0
is not elementary and is rejected.
The
logical function CHECK performs this test for the first ten primes
which should be sufficient for most practical problems.
is
·e
-lor
for
p,
If any component
+1, then it cannot be a multiple and is immediately accepted.
Exploring the second normalization restriction requires some sleight
of hand.
This restriction forces the first nonzero component must be
positive, hence the bounds on the first component are
others are
-K to +K.
begin with zeros.
fashion.
1
and
K and the
The missing multi-indices then are those that
These can be generated more easily in a recursive
Notice that all elementary multi-indices of length
N that
begin with a zero can be formed by prefacing all elementary multi-indices
of length
N- 1
with a
O.
multi-indices with lengths
So the algorithm generates elementarJ
1 through
N.
Since further details regarding the algorithm require lengthy
discussion, the FORTRAN code in the appendix should be consulted. The
features that should be noted are the
~imulation
of nested loops, the
updating for computing the norm, and the reversing of the order of the
components when stored.
Finally, the elementary multi-indices are sorted
by norm using a heapsort algorithm (see Knuth, 1973, pp. 145-149).
output from a test run with
the appendix.
K· 4
and the length
N· 3
is given in
Caution must be given that the number of A of
be quite large even for moderate values of
Nand
The
Ka's can
K.
References
Gallant, A. Ronald (1981), "On the bias in flexible functional forms and
and essentially unbiased form:
the Fourier flexible form,"
J. of Econometrics 15, pp. 211-245.
Knuth, Donald E. (1973), The Art of Computer Programming, Vol. 3:
and Searching, Addison-Wesley.
Sorting
All P::ND IX
00010
00020
00030
00040
00050
00060
THIS PROGRAM PRODUCES ELEMENTARY Mur..T!-IK:l!CES OF A G:V:::N r.ZNGT~
\tHOSE NORM :S I.E TO KCA? NORM(INDEX).SUM OF A.3S(:NDEX(J)) OV!R J
NESTRE
J ~ MONAHAN
APR:1 19S1
DEFAULT MAX DIMENSIONS:
MAX LENGTH OF MULTI-INDEI IS 16
MAX NUM~ER OF GOOD IN'I)IeES IS 1024
INTEGER INDEI(16),IMN(16),rMX(16),NORM(17~.:,J.KCAP,L,LP1,NUM,
~
¥
...
"
~
~
~
"
~
..."
~
a0070
00080
00090
0010e
0011 C
00120
00130
00140
001 SO
00160
001'70
001ao
C0190
00200
00210
00220
00230
00240
00250
J0260
00270
00280
00290
00300
00310
00320
00330
00340
00350
00360
00;'70
00380
00390
J0400
J0410
00420
00430
00440
00450
00460
00470
00480
004.?O
00500
'LENGTH,P,!NDICE('024,16).STNORM(1024),INDCN!(~024)
LOGICAL CHECK,OK
FORMAT(2I,I6.· I~DICES \tITH NORM I.E K.' ,I4/5X. 'ALPHA' .3X,
1 'NORM' ,U, 'MULTI-INDEX' )
1
2
FORMAT(4X,:4,4X.I4.4X, 16I3'
VAUUS
" TEST
K:Ah4
LENGTH·3
... IN!TIALIZE INDEX
DO 10Izl, 10
10 INDEX ( 1).0
NUM=O
DO 9L.l, LENGT~
20
~
~
LPl
.L+~
DO SIa1, 10
IMN(I).-f::CAP
5
IMX(I).K:CA?
IMN(L).1
NORM(LP1 ).0
DO 11=' ,1
J =LP1-I
NOID1(J).NORM(J-l )+IA3S(IMN(J)
...I' SIMULATION OF NEST~D LOOPS WI!E L INDEX VAR!ABLES AND BOUNDS:
:MN(I) LE INDEX(:)
~_
IMX(:: :FOR !=1 .... ,:
" 1
INDEX(I).IMN(::
2
?=1
INDEX(p)"rMN(p\
NORM(P\.NORM(P·1 )+IABS(INDEX(P)i
~
~
COlIT!.NUE
:E:S :s ~EE :E!rTIR or ~E! LOOPING
I:F(NORM( ~ ) .GT .K:CAP' GO ~o 4
OK=CEECK(!NDEX, KCAP, I.i
IF( .NOT.OK) GO ~o 4
CEECKS CAN GO IN SER!
'" ADDITIONAL
C NOW STORE A QOOD INDEX, :TS NOR~ IS STORED IN STNORM
NUM=NUM.1
INDCNT(NUM)aNUM
STNORM(NUM).NORM(1 )
DO 7I.l, 1ENGT~
INDICE(NUM,I).INDEI(LENGTB.1-I)
... THIS ENDS TEE CENTER LOCP
4
INDEX (P i=INDEX'? 'i.-'
NORM(? i=NORM( P'-1 ''-:ABS (InEX(?) )
J05~C
16 :::'(IND~X(?;.:.z.!MX(?:) GO:O ~3,2.2,2,2.2,2,2,Z.2.2,2.2,2.2.2'.?
IND:E:I(?)=:MN:?:
OCC:20
?:P+1
JC53C
IF(P.1E.L) GO ~o 4.
0054.0
J0550
9
CCNTIYUE
SORT ON NORM STORED IN STNORM. INDCNT IS :AP3:Z: ~10NG
00560 '"
005'7:
CALL EPSORT(STNORM.INDCNT.!roM)
.R!TE(3,2C; NUM,KCAP
J0580
DC 1 1: .. 1 .:roM
00590
P=INDCNT1I'
00600
00610
11 ~R:TE(3.21) :,STNORM(:),(INDICE(P.J),J=i .1ENGT~:
00620
STOP
00630
END
~
"
~
~
~
00640
~OG!CAl ?UNCTION CHECK(!XDEI,KCA2,~)
00650 C
Cm:CX ! ') SEE IF CUR."~L,{T :~DE! ! S A..'i ::rT!GER =,nn:.T !PtE CF on 'lITE
00660 C
SMA.LU:R' :fORM.
~!S O'SES JUST T~ nRST 10 ?R!l"IE 1UM!ERS SO THAT
00670 C
!T CAN ONLY CRECK INDICES WITH NORM LESS THAN 29*29a641
006aO
INTEGER INDEX(16),P.PR~E(10),J.KCAP,L
DATA PRIME/2,3,5,7,lt,13,17.19,23,291
00690
00700
CHECK•• TRUE.
00710
DO 2!s1, 10
P.PRIME( r)
00720
I?(P.GT.KCAP) RETURN
00730
0074.0
DO 3J=1, L
00750
!F(IA3S(INDEI(J».3Q.l) ~ETURN
00760
!?(~OD(!3DEX(J),P).NE.O) GO TO 2
00770
3
CONT!NUE
CID:CK•• ?'ALSE.
00780
00 7 90
RETt'RN
OC800
2
CONTI::roE
OC81 0
RET'JRN
00820
~ND
SUBROUTINE HPSORT(K.~,Y·
008'30
00840 C !NT!GER ~CD!?!CATICN OF ~APSORT eN ~. ~ :ARRI!D ALONG
008,0 C SEE ~UTS. 10L 3. ?P. '4.5-i~9. ALJOR!TEM E
00860
:NTEG::R R,r-1(l),MM,LC(l),KK,I,J,;',N
00870
r..H'/2+1
00880
00890
00900
00910
00920
Fi=H'
2
::(R.!Q.:)
~o
3
4.
5"
6
7
3
~80
1
4,C
01150
J =r.
hJ
J:2*J
!P(J-R) 5,6.8
!?(K(J).LT.i{(J+l»
!F(rA.~T.iC(J))
,«:J=iC(JJ
:lI:\.M(J)
:iC ~o oJ,
,C:i=i(!{
V!,:,=io1M
... t"'o
\ZV
)1: 10
01
~O
TO 3
L=l,- i
iCK.i\(:')
MMsM(I,)
01020
01120
:)1 ~ 30
9
ihR-l
00990
'J1
TO
:-tUil=1ot( 1 )
00980
01030
0104.0
:10,0
01060
J 1 0"'0
01080
01090
1
I(R )si« 1 )
JC,?4.0
009,0
:)0960
00970
:Jl000
~o
:otMsi'4(R)
~0930
0101J
rF(L.GT.1) GO
K:X=iC(R)
9
"'f'
... .,
,
_
:{!~
;siCK
:ot('
s~"lM
:t:::~t!RN
!XD
JaJ+l
GO TO 3
r
....atfiv nestre.fort
WATFIV COMPILATION
END
*EXTENSION* PSEUDO VARIABLE DIMENSIONING ASSUMED FOR ARRAY M
*EXTENSION* PSEUDO VARIABLE DIMENSIONING ASSUMED FOR ARRAY K
COMPILATION COMPLETE
.1
49 INDICES WITH NORM LE iC=
ALPHA
NORM
MULTI-INDEX·
:2
1
1
0
0
3
1
1
4
2
2
2
0
1
1
0
C
5
6
7
8
9
10
..
'
I
':It
..-'
1
1 -1
0
':It
• 'Z
3
'>:
3
17
3
2
-2
..-'
1 415
16
-1
0
3
12
'/
1
1 -1
2
-2
2 -1
2
1
-1
~8
3
19
'>:
..-'
3
2
21
22
23
24
25
26
2"
28
29
30
3
3
3
1
':It
..-'
3
J.
44
4
.1
4
':It""
4
4
34
35
36
3':
38
39
J.
4-
40
4-1
4
4
4
4
4
4
0 3
3 1
3 0
3 -1
1 0
2
1 -1
1
2
2 _1
2 -1
0 ':It
1 ':It
1
2
'%
0
4'i
46
J.
J
J.7
4
"I
J.J.
48
49
STATEr~ENTS
J.
.I.
EDCUTED=
1 1
1 -2
1 -2
Q
1 -3
.I.
J.
J.
.I.
.1.3
1
0
1
0
1 -1 -1
1 2 C
2 0 -1
1
0 -2
3
31
32
..i2
0
0
0
0
0
1
2 0
2 -1
20
::l.:EADY
2
2
2
1
~
0
0 1
0 0
0 1
0 -1
_1
2
-,
':It
..-'
0
0
C
-3
2
-1
1
_1
-,
I)
-1
.
-2
-3
':It
,
-..J
-2
1
1
/
6196
0001
© Copyright 2026 Paperzz