FOLD Instruction |
FOLD( options ) cseries start end newcseries newstart
FOLD computes an implied spectral density function for a lower sampling rate. For instance, it takes a spectrum based on monthly data and computes the spectrum you would observe if data were only available quarterly.
Parameters
cseries |
source series |
start, end |
range to transform, by default, range of cseries |
newcseries |
result series. Must be different from cseries |
newcstart |
start for newcseries, by default, start |
Options
FACTOR=reduction factor [1]
The ratio of sampling rates, for instance 3=(12/4) for monthly to quarterly. FOLD transforms N frequencies to (N/reduction factor frequencies).
Description
FOLD sets each frequency in newcseries equal to the sum of all the frequencies for cseries aliased with it at the lower sampling rate.
Example
*
* nords is the number of ordinates,
* nobs is the number of actual data points
*
compute nords=768
freq 5 nords
rtoc 1966:1 2017:11
# ipx
# 1
compute nobs=%nobs
fft 1
cmult(scale=1./(2*%pi*nobs)) 1 1
fold(factor=3) 1 1 nords 2
Series 2 has 768/3=256 entries, which are entries 1+257+513, 2+258+514,... of series 1.
Copyright © 2025 Thomas A. Doan