X: an object of class fd containing T functional observations.
Y: an object of class fd containing T functional observations.
freq: a vector containing frequencies in [−π,π] on which the spectral density should be evaluated. By default freq=(-1000:1000/1000)*pi.
q: window size for the kernel estimator, i.e. a positive integer. By default we choose q = max(1, floor((dim(X$coefs)[2])^{0.33})).
weights: kernel used in the spectral smoothing. For possible choices see spectral.density in package freqdom. By default the Bartlett kernel is chosen.
Returns
Returns an object of class fts.timedom. The list is containing the following components:
operators an array. Element [,,k] in the coefficient matrix of the spectral density matrix evaluated at the k-th frequency listed in freq.
lags returns the lags vector from the arguments.
basisX returns X$basis, an object of class basis.fd (see create.basis).
basisY returns Y$basis, an object of class basis.fd (see create.basis)
Details
Let X1(u),…,XT(u) and Y1(u),…,YT(u) be two samples of functional data. The cross-spectral density kernel between the two time series (Xt(u)) and (Yt(u)) is defined as
fωXY(u,v)=h∈Z∑Cov(Xh(u),Y0(v))e−ihω.
The function fts.spectral.density determines the empirical cross-spectral density kernel between the two time series. The estimator is of the form
fωXY(u,v)=∣h∣≤q∑w(∣k∣/q)chXY(u,v)e−ihω,
with chXY(u,v) defined in fts.cov.structure. The other paremeters are as in cov.structure.
Since Xt(u)=b1′(u)xt and Yt(u)=yt′b2(u) we can write
fωXY(u,v)=b1′(u)Fxy(ω)b2(v),
where Fxy(ω) is defined as for the function spectral.density for series of coefficient vectors (xt:1≤t≤T) and (yt:1≤t≤T).
Examples
data(pm10)X = center.fd(pm10)# Compute the spectral density operator with Bartlett weightsSD = fts.spectral.density(X, freq =(-50:50/50)* pi, q =2, weight="Bartlett")fts.plot.operators(SD, freq =-2:2)# Compute the spectral density operator with Tukey weightsSD = fts.spectral.density(X, freq =(-50:50/50)* pi, q =2, weight="Tukey")fts.plot.operators(SD, freq =-2:2)# Note relatively small difference between the two plots# Now, compute the spectral density operator with Tukey weights and larger qSD = fts.spectral.density(X, freq =(-50:50/50)* pi, q =5, weight="Tukey")fts.plot.operators(SD, freq =-2:2)
See Also
The multivariate equivalent in the freqdom package: spectral.density