Plot in 3D the smoothing periodogram of a time series, by blocks or windows.
Usage
block.smooth.periodogram(y, x = NULL, N = NULL, S = NULL, p = 0.25,
spar.freq = 0, spar.time = 0, theta = 0, phi = 0,
xlim = NULL, ylim = NULL, zlim = NULL, ylab = "Time",
palette.col = NULL)
Arguments
y
data vector.
x
optional vector, if x=NULL then the function uses x=1:n where n is the length of y. More details in 'y' argument from persp function.
N
value corresponding to the length of the window to compute periodogram. If N=NULL then the function will use N = \textmd{trunc}(n^{0.8}), see Dahlhaus (1998) where n is the length of the y vector.
S
value corresponding to the lag with which will be taking the blocks or windows to calculate the periodogram.
p
value used if it is desired that S is proportional to N. By default p=0.25, if S and N are not entered.
spar.freq, spar.time
smoothing parameter, typically (but not necessarily) in (0,1].
theta, phi
angles defining the viewing direction. theta gives the azimuthal direction and phi the colatitude.
xlim, ylim, zlim
x-,y- and z-limits. They are NULL by default and they are optionals parameters.
ylab
title for 'y' axis. Optional argument, by default is ylab="Time". This must be character strings.
palette.col
colors palette.
Details
The number of windows of the function is M = \textmd{trunc}((n-N)/S+1), where trunc truncates de entered value and n is the length of the vector y. All windows are of the same length N, if this value isn't entered by user then is computed as N=\textmd{trunc}(n^{0.8}) (Dahlhaus).
block.smooth.periodogram computes the periodogram in each of the M windows and then smoothes it two times with smooth.spline function; the first time using spar.freq parameter and the second time with spar.time. These windows overlap between them.
The surface is then viewed by looking at the origin from a direction defined by theta and phi. If theta and phi are both zero the viewing direction is directly down the negative y axis. Changing theta will vary the azimuth and changing phi the colatitude.
Author(s)
Ricardo Olea <raolea@uc.cl>
References
Dahlhaus, R. Fitting time series models to nonstationary processes. The Annals of Statistics. 1997; Vol. 25, No. 1:1-37.
Dahlhaus, R. and Giraitis, L. On the optimal segment length for parameter estimates for locally stationary time series. Journal of Time Series Analysis. 1998; 19(6):629-655.