CACCUMULATE Instruction |
CACCUMULATE( options) cseries start end newcseries newcstart
Creates a running sum of a complex series: entry N of newcseries is the sum of the first N entries of cseries.
Parameters
cseries |
source series |
start, end |
range to transform, by default, range of cseries |
newcseries |
result series, by default, overwrites cseries |
newcstart |
start for newcseries, by default, start |
Options
STANDARDIZE/[NOSTANDARDIZE]
If you use STANDARDIZE, newcseries is normalized so it ends with 1.0. This option was known as SCALE before version 7.
Example
This is part of the @CUMPDGM procedure. The CACCUMULATE instruction cumulates the periodogram (squared Fourier transform) over frequencies 0 to \(pi\) and standardizes it to have an end value of 1.0. If the series examined is white noise, this cumulated periodogram should differ only slightly from the theoretical spectral distribution function for white noise: a straight line. The CXTREMUM instruction computes the maximum gap between the two distribution functions.
frequency 3 nords
compute half=(nords+1)/2
rtoc
# resids
# 1
clabels 1 2 3
# "Cumprdgm" "Whitenoise" "Gap"
fft 1
cmult 1 1 ;*Periodogram of resids
cacc(standardize) 1 1 half
cunits 2 ;*Spectral density of white noise (constant)
cacc(standardize) 2 1 half
csubtract 2 1 1 half 3
cxt(part=absval) 3 1 half ;*Computes extreme values of series 3
Copyright © 2025 Thomas A. Doan