FREQUENCY Instruction |
FREQUENCY cseries length
FREQUENCY creates complex series and sets the default length for complex series.
Parameters
|
cseries |
number of complex series to create |
|
length |
complex series length. This is usually set to be a convenient length for the Fourier transform—a product of small primes (2,3,5) which is a multiple of the periodicity of the data. |
Description
You can create complex series using instructions similar to those you use for real series. However, you will probably find it much more convenient to set up the full block of series (using the cseries parameter) and then refer to them with numbers rather than with names.
You can invoke FREQUENCY any number of times during the program. Each use of FREQUENCY eliminates the previous block of complex series. This makes it possible (and desirable) to write self-contained procedures for your analysis.
Choosing length
You usually want to choose length to be a convenient number of frequencies for the data analysis. We refer to the extra length beyond the actual number of data points as padding. There are two considerations in choosing length:
•RATS can compute the Fourier transforms much faster for lengths with small prime factors (2,3 and 5) than for lengths that are products of large primes.
•The exact seasonal frequencies are included if the number of frequencies is a multiple of the number of periods per year.
The function %FREQSIZE(n) will produce a recommended size for n actual data points. This returns the smallest integer of the form \(2^mS\) which is greater than or equal to n. (S is the number of periods per year).
Whether or not you use %FREQSIZE, we recommend that, as a habit, you save the number of ordinates in a variable before doing the FREQUENCY instruction. If you need to refer to the number of ordinates in any of your instructions, you can use your variable instead. That way, you can easily modify your program to allow for a different number of ordinates. If you’re writing a procedure where you’re working with complex series provided by the user, you can find out the FREQUENCY length by using %FREQEND() function.
Examples
frequency 8 512
creates 8 complex series with 512 entries.
compute nords = 2*%freqsize(2013:12)
frequency 6 nords
This creates 6 complex series with twice the recommended length. There are some applications where using at least double the number of frequencies compared to the data length is required.
Variables Defined
|
%Z |
RECTANGULAR[COMPLEX] array with dimensions length x cseries which holds the complex series created by FREQUENCY. |
Copyright © 2026 Thomas A. Doan