Title: | Functional Time Series: Dynamic Functional Principal Components |
---|---|
Description: | Implementations of functional dynamic principle components analysis. Related graphic tools and frequency domain methods. These methods directly use multivariate dynamic principal components implementation, following the guidelines from Hormann, Kidzinski and Hallin (2016), Dynamic Functional Principal Component <doi:10.1111/rssb.12076>. |
Authors: | Hormann S., Kidzinski L. |
Maintainer: | Kidzinski L. <[email protected]> |
License: | GPL-3 |
Version: | 1.0.1 |
Built: | 2024-08-23 06:35:49 UTC |
Source: | CRAN |
Implementation of dynamic functional principle component analysis (FDPCA), simulation of functional AR and functional MA processes and frequency domain tools for funcional data. The package is a wrapper for functionality of the multivariate package freqdom for applying frequency domain on objects from fda. Compared to freqdom some new visualization methods are added – adequate only if data has functional structure.
fda.ts package allows you to analyse functional time series objects in both time and frequency domain. The main feature is dynamic functional principal component analysis. This method allows to transform a stationary functional time series into a vector process with mutually uncorrelated component processes.
There are two key differnces between classical PCA and dynamic PCA:
Component processes returned by the dynamic procedure are mutually uncorrelated,
The mapping maximizes the long run variance of compoments, which, in case of stationary functional time series, means
that the process reconstructed from and first dynamic principal components
better approximates the original functional time series process than the first
classic principal components.
For functional data one can conveniently visualize properties of the filters, covariances or the spectral density operator.
For details we refer to the literature below and to help pages of functions fts.dpca
for estimating the components, fts.dpca.scores
for estimating scores and
fts.dpca.KLexpansion
for retrieving the signal from components.
The package fda.ts require the package freqdom provides the analogue multivariate toolset.
Hormann Siegfried, Kidzinski Lukasz and Hallin Marc. Dynamic functional principal components. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 77.2 (2015): 319-348.
Hormann Siegfried, Kidzinski Lukasz and Kokoszka Piotr. Estimation in functional lagged regression. Journal of Time Series Analysis 36.4 (2015): 541-561.
Hormann Siegfried and Kidzinski Lukasz. A note on estimation in Hilbertian linear models. Scandinavian journal of statistics 42.1 (2015): 43-62.
This function is used to estimate a collection of cross-covariances operators of two stationary functional series.
fts.cov.structure(X, Y = X, lags = 0)
fts.cov.structure(X, Y = X, lags = 0)
X |
an object of class |
Y |
an object of class |
lags |
an integer-valued vector |
Let and
be two samples of functional data. This function determines empirical lagged covariances between the series
and
. More precisely it determines
where is the empirical version of the covariance kernel
.
For a sample of size
we set
and
. Now for
and for
Since and
we can write
where is defined as for the function “cov.structure” for series of coefficient vectors
and
.
An object of class fts.timedom
. The list contains the following components:
operators
an array. Element
[,,k]
contains the covariance matrix of the coefficient vectors of the two time series related to lag .
lags
the lags vector from the arguments.
basisX
X$basis
, an object of class basis.fd
(see create.basis
)
basisY
Y$basis
, an object of class basis.fd
(see create.basis
)
The multivariate equivalent in the freqdom
package: cov.structure
# Generate an autoregressive process fts = fts.rar(d=3) # Get covariance at lag 0 fts.cov.structure(fts, lags = 0) # Get covariance at lag 10 fts.cov.structure(fts, lags = 10) # Get entire covariance structure between -20 and 20 fts.cov.structure(fts, lags = -20:20) # Compute covariance with another process fts0 = fts + fts.rma(d=3) fts.cov.structure(fts, fts0, lags = -2:2)
# Generate an autoregressive process fts = fts.rar(d=3) # Get covariance at lag 0 fts.cov.structure(fts, lags = 0) # Get covariance at lag 10 fts.cov.structure(fts, lags = 10) # Get entire covariance structure between -20 and 20 fts.cov.structure(fts, lags = -20:20) # Compute covariance with another process fts0 = fts + fts.rma(d=3) fts.cov.structure(fts, fts0, lags = -2:2)
Functional dynamic principal component analysis (FDPCA) decomposes functional time series to a vector time series with uncorrelated components. Compared to classical functional principal components, FDPCA decomposition outputs components which are uncorrelated in time, allowing simpler modeling of the processes and maximizing long run variance of the projection.
fts.dpca(X, q = 30, freq = (-1000:1000/1000) * pi, Ndpc = X$basis$nbasis)
fts.dpca(X, q = 30, freq = (-1000:1000/1000) * pi, Ndpc = X$basis$nbasis)
X |
a functional time series as a |
q |
window size for the kernel estimator, i.e. a positive integer. |
freq |
a vector containing frequencies in |
Ndpc |
is the number of principal component filters to compute as in |
This convenient function applies the FDPCA methodology and returns filters (fts.dpca.filters
), scores
(fts.dpca.scores
), the spectral density (fts.spectral.density
), variances (fts.dpca.var
) and
Karhunen-Leove expansion (fts.dpca.KLexpansion
).
See the example for understanding usage, and help pages for details on individual functions.
A list containing
scores
DPCA scores (
fts.dpca.scores
)
filters
DPCA filters (
fts.dpca.filters
)
spec.density
spectral density of
X
(fts.spectral.density
)
var
amount of variance explained by dynamic principal components (
fts.dpca.var
)
Xhat
Karhunen-Loeve expansion using
Ndpc
dynamic principal components (fts.dpca.KLexpansion
)
Hormann, S., Kidzinski, L., and Hallin, M. Dynamic functional principal components. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 77.2 (2015): 319-348.
Brillinger, D. Time Series (2001), SIAM, San Francisco.
Shumway, R., and Stoffer, D. Time series analysis and its applications: with R examples (2010), Springer Science & Business Media
# Load example PM10 data from Graz, Austria data(pm10) # loads functional time series pm10 to the environment X = center.fd(pm10) # Compute functional dynamic principal components with only one component res.dpca = fts.dpca(X, Ndpc = 1, freq=(-25:25/25)*pi) # leave default freq for higher precision plot(res.dpca$Xhat) fts.plot.filters(res.dpca$filters) # Compute functional PCA with only one component res.pca = prcomp(t(X$coefs), center = TRUE) res.pca$x[,-1] = 0 # Compute empirical variance explained var.dpca = (1 - sum( (res.dpca$Xhat$coefs - X$coefs)**2 ) / sum(X$coefs**2))*100 var.pca = (1 - sum( (res.pca$x %*% t(res.pca$rotation) - t(X$coefs) )**2 ) / sum(X$coefs**2))*100 cat("Variance explained by PCA (empirical):\t\t",var.pca,"%\n") cat("Variance explained by PCA (theoretical):\t", (1 - (res.pca$sdev[1] / sum(res.pca$sdev)))*100,"%\n") cat("Variance explained by DPCA (empirical):\t\t",var.dpca,"%\n") cat("Variance explained by DPCA (theoretical):\t",(res.dpca$var[1])*100,"%\n") # Plot filters fts.plot.filters(res.dpca$filters) # Plot spectral density (note that in case of these data it's concentrated around 0) fts.plot.operators(res.dpca$spec.density,freq = c(-2,-3:3/30 * pi,2)) # Plot covariance of X fts.plot.covariance(X) # Compare values of the first PC scores with the first DPC scores plot(res.pca$x[,1],t='l',xlab = "Time",ylab="Score", lwd = 2.5) lines(res.dpca$scores[,1], col=2, lwd = 2.5) legend(0,4,c("first PC score","first DPC score"), # puts text in the legend lty=c(1,1),lwd=c(2.5,2.5), col=1:2)
# Load example PM10 data from Graz, Austria data(pm10) # loads functional time series pm10 to the environment X = center.fd(pm10) # Compute functional dynamic principal components with only one component res.dpca = fts.dpca(X, Ndpc = 1, freq=(-25:25/25)*pi) # leave default freq for higher precision plot(res.dpca$Xhat) fts.plot.filters(res.dpca$filters) # Compute functional PCA with only one component res.pca = prcomp(t(X$coefs), center = TRUE) res.pca$x[,-1] = 0 # Compute empirical variance explained var.dpca = (1 - sum( (res.dpca$Xhat$coefs - X$coefs)**2 ) / sum(X$coefs**2))*100 var.pca = (1 - sum( (res.pca$x %*% t(res.pca$rotation) - t(X$coefs) )**2 ) / sum(X$coefs**2))*100 cat("Variance explained by PCA (empirical):\t\t",var.pca,"%\n") cat("Variance explained by PCA (theoretical):\t", (1 - (res.pca$sdev[1] / sum(res.pca$sdev)))*100,"%\n") cat("Variance explained by DPCA (empirical):\t\t",var.dpca,"%\n") cat("Variance explained by DPCA (theoretical):\t",(res.dpca$var[1])*100,"%\n") # Plot filters fts.plot.filters(res.dpca$filters) # Plot spectral density (note that in case of these data it's concentrated around 0) fts.plot.operators(res.dpca$spec.density,freq = c(-2,-3:3/30 * pi,2)) # Plot covariance of X fts.plot.covariance(X) # Compare values of the first PC scores with the first DPC scores plot(res.pca$x[,1],t='l',xlab = "Time",ylab="Score", lwd = 2.5) lines(res.dpca$scores[,1], col=2, lwd = 2.5) legend(0,4,c("first PC score","first DPC score"), # puts text in the legend lty=c(1,1),lwd=c(2.5,2.5), col=1:2)
From a given spectral density operator the dynamic principal component filter sequences are computed.
fts.dpca.filters(F, Ndpc = F$basisX$nbasis, q = 30)
fts.dpca.filters(F, Ndpc = F$basisX$nbasis, q = 30)
F |
spectral density operator, provided as an object of class |
Ndpc |
an integer |
q |
a non-negative integer. DPCA filter coefficients at lags |
Dynamic principal components are linear filters ,
.
They are defined as the Fourier coefficients of the dynamic eigenvector
of a spectral density
kernel
, i.e.
and
The index is referring to the
-th largest dynamic eigenvalue
. For a given spectral
density operator (provided as on object of class
fts.freqdom
) the function fts.dpca.filters
computes
for
q. Filters will be computed for
.
For more details we refer to Hormann et al. (2015).
An object of class fts.timedom
. The list has the following components:
operators
an array. Each matrix in this array has dimension
and is assigned to a certain lag.
For a given lag
, the rows of the matrix correspond to the coefficient vector of the filter functions.
lags
a vector with the lags of the filter coefficients.
basisX
F$basis
, hence an object of class basis.fd
(see create.basis
).
correspondence
the correspondence matrix: all scalar products between basis functions.
Hormann, S., Kidzinski, L., and Hallin, M. Dynamic functional principal components. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 77.2 (2015): 319-348.
Brillinger, D. Time Series (2001), SIAM, San Francisco.
Shumway, R.H., and Stoffer, D.S. Time Series Analysis and Its Applications (2006), Springer, New York.
The multivariate equivalent in the freqdom
package: dpca.filters
data(pm10) X = center.fd(pm10) # Compute the spectral density operator with Bartlett weights SD = fts.spectral.density(X, freq = (-50:50/50) * pi, q = 2, weight="Bartlett") filters = fts.dpca.filters(SD, 2, q = 10) # Plot filters 1 and 2 fts.plot.filters(filters, 2, one.plot = TRUE) # Recompute with a different estimate of the spectral density (largerg q) SD = fts.spectral.density(X, freq = (-50:50/50) * pi, q = 5, weight="Bartlett") filters = fts.dpca.filters(SD, 2, q = 10) # Plot filters 1 and 2 fts.plot.filters(filters, 2, one.plot = TRUE)
data(pm10) X = center.fd(pm10) # Compute the spectral density operator with Bartlett weights SD = fts.spectral.density(X, freq = (-50:50/50) * pi, q = 2, weight="Bartlett") filters = fts.dpca.filters(SD, 2, q = 10) # Plot filters 1 and 2 fts.plot.filters(filters, 2, one.plot = TRUE) # Recompute with a different estimate of the spectral density (largerg q) SD = fts.spectral.density(X, freq = (-50:50/50) * pi, q = 5, weight="Bartlett") filters = fts.dpca.filters(SD, 2, q = 10) # Plot filters 1 and 2 fts.plot.filters(filters, 2, one.plot = TRUE)
Computes the dynamic KL expansion up to a given order.
fts.dpca.KLexpansion(X, dpcs = fts.dpca.filters(fts.spectral.density(X)))
fts.dpca.KLexpansion(X, dpcs = fts.dpca.filters(fts.spectral.density(X)))
X |
a functional time series given as an object of class |
dpcs |
an object of class |
This function computes the -order dynamic functional principal components expansion, defined by
where and
are explained in
fts.dpca.filters
and are the dynamic functional PC scores as in
fts.dpca.scores
. For the sample version the sum extends over the range of lags for which the are defined.
For more details we refer to Hormann et al. (2015).
An object of class fd
.
Hormann, S., Kidzinski, L., and Hallin, M. Dynamic functional principal components. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 77.2 (2015): 319-348.
The multivariate equivalent in the freqdom
package: dpca.KLexpansion
Computes the dynamic principal component scores of a functional time series.
fts.dpca.scores(X, dpcs = fts.dpca.filters(spectral.density(X)))
fts.dpca.scores(X, dpcs = fts.dpca.filters(spectral.density(X)))
X |
a functional time series given as an object of class |
dpcs |
an object of class |
The -th dynamic principal components score sequence is defined by
where and
are explained in
fts.dpca.filters
. (The integral is not necessarily restricted to the interval , this depends on the data.) For the sample version the sum extends over the range of lags for which the
are defined.
For more details we refer to Hormann et al. (2015).
A -matix with
Ndpc = dim(dpcs$operators)[1]
. The -th column contains the
-th dynamic principal component score sequence.
Hormann, S., Kidzinski, L., and Hallin, M. Dynamic functional principal components. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 77.2 (2015): 319-348.
The multivariate equivalent in the freqdom
package: dpca.scores
Computes the proportion and cumulative proportion of variance explained by dynamic principal components.
fts.dpca.var(F)
fts.dpca.var(F)
F |
spectral density operator, provided as an object of class |
Consider a spectral density operator and let
by the
-th dynamic
eigenvalue. The proportion of variance described by the
-th dynamic principal component is given as
.
This function numerically computes the vectors
.
For more details we refer to Hormann et al. (2015).
A vector containing the .
Hormann, S., Kidzinski, L., and Hallin, M. Dynamic functional principal components. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 77.2 (2015): 319-348.
The multivariate equivalent in the freqdom
package: dpca.var
fts.freqdom
.Creates an object of class fts.freqdom
.
fts.freqdom(F, basisX, basisY = basisX)
fts.freqdom(F, basisX, basisY = basisX)
F |
an object of class freqdom. |
basisX |
an object of class |
basisY |
an object of class |
This class is used to describe a frequency domain operator (for example a spectral
density operator) on selected frequencies. Formally we consider an object of class
freqdom
and add some basis functions. Depending on the context, we
have different interpretations for the new object.
(I) In order to define an operator which maps between two functions spaces, the we
interpret F$operators
as coefficients in the basis function expansion of
the kernel of some finite rank operators
The kernels are , where
and
are the basis functions provided by the arguments basisX and basisY, respectively. Moreover, we consider frequencies
. The object this function creates corresponds to the mapping
.
(II) We may ignore basisX, and represent the linear mapping
by considering and
.
(III) We may ignore basisY, and represent the linear mapping
by considering and
.
Returns an object of class fts.freqdom
. An object of class
fts.freqdom
is a list containing the following components:
operators
returns the array
F$operators
.
basisX
returns
basisX
as given in the argument.
basisY
returns
basisY
as given in the argument.
freq
returns the vector
F$freq
.
The multivariate equivalent in the freqdom
package: freqdom
Contour plot for the kernels of cross-covariance operators.
fts.plot.covariance(X, Y = X, cor = FALSE, res = 200, lags = 0:3, nlevels = 25)
fts.plot.covariance(X, Y = X, cor = FALSE, res = 200, lags = 0:3, nlevels = 25)
X |
an object of class |
Y |
an object of class |
cor |
if |
res |
number of discretization points to evaluate functional data. |
lags |
lags to plot, dafauts |
nlevels |
number of color levels for the contour plot. |
fts = fts.rar(100) # Plot covariance operators of the time series curves # We chose resolution equal 150 for better precision fts.plot.covariance(fts, lags=0:2, res = 150) # Plot correlation operators of the time series curves fts.plot.covariance(fts, lags=0:2, cor = TRUE, res = 50) # Make the grid of levels more dense fts.plot.covariance(fts, lags=0:1, nlevels = 100)
fts = fts.rar(100) # Plot covariance operators of the time series curves # We chose resolution equal 150 for better precision fts.plot.covariance(fts, lags=0:2, res = 150) # Plot correlation operators of the time series curves fts.plot.covariance(fts, lags=0:2, cor = TRUE, res = 50) # Make the grid of levels more dense fts.plot.covariance(fts, lags=0:1, nlevels = 100)
Plot kernels
fts.plot.filters(A, Ndpc = 1, lags = -3:3, one.plot = FALSE, ...)
fts.plot.filters(A, Ndpc = 1, lags = -3:3, one.plot = FALSE, ...)
A |
a functional filter sequence given as object of class |
Ndpc |
if Ndpc = k the first k filter sequences are plotted. |
lags |
number of lags to plot. |
one.plot |
if TRUE then functional filters corresponding belonging to the respective scores will all be plotted in the same graph. |
... |
arguments |
# Load example PM10 data from Graz, Austria data(pm10) # loads functional time series pm10 to the environment X = center.fd(pm10) # Compute functional dynamic principal components with only one component res.dpca = fts.dpca(X, Ndpc = 1, freq=(-25:25/25)*pi) # leave default freq for higher precision # Plot Functional Dynamic Principal Component Filters fts.plot.filters(res.dpca$filters)
# Load example PM10 data from Graz, Austria data(pm10) # loads functional time series pm10 to the environment X = center.fd(pm10) # Compute functional dynamic principal components with only one component res.dpca = fts.dpca(X, Ndpc = 1, freq=(-25:25/25)*pi) # leave default freq for higher precision # Plot Functional Dynamic Principal Component Filters fts.plot.filters(res.dpca$filters)
Contour plot of operator kernels.
fts.plot.operators(A, res = 200, lags = 0, freq = 0, axis = "Re", nlevels = 25)
fts.plot.operators(A, res = 200, lags = 0, freq = 0, axis = "Re", nlevels = 25)
A |
an object of class |
res |
number of discretization points to evaluate functional data. |
lags |
a vector of integers. For objects of class |
freq |
a vector of frequencies in |
axis |
if |
nlevels |
number of color levels for the contour plot. |
# Load example PM10 data from Graz, Austria data(pm10) # loads functional time series pm10 to the environment X = center.fd(pm10) # Compute functional dynamic principal components with only one component res.dpca = fts.dpca(X, Ndpc = 1, freq=(-25:25/25)*pi) # leave default freq for higher precision # Plot the spectral density operator at frequencies -2, -3:3/30 * pi and 2 fts.plot.operators(res.dpca$spec.density,freq = c(-2,-3:3/30 * pi,2))
# Load example PM10 data from Graz, Austria data(pm10) # loads functional time series pm10 to the environment X = center.fd(pm10) # Compute functional dynamic principal components with only one component res.dpca = fts.dpca(X, Ndpc = 1, freq=(-25:25/25)*pi) # leave default freq for higher precision # Plot the spectral density operator at frequencies -2, -3:3/30 * pi and 2 fts.plot.operators(res.dpca$spec.density,freq = c(-2,-3:3/30 * pi,2))
Generates functional autoregressive process.
fts.rar( n = 100, d = 11, Psi = NULL, op.norms = NULL, burnin = 20, noise = "mnorm", sigma = diag(d:1)/d, df = 4 )
fts.rar( n = 100, d = 11, Psi = NULL, op.norms = NULL, burnin = 20, noise = "mnorm", sigma = diag(d:1)/d, df = 4 )
n |
number of observations to generate. |
d |
dimension of the underlying multivariate VAR model. |
Psi |
an array of |
op.norms |
a vector with non-negative scalar entries to which the |
burnin |
an integer |
noise |
|
sigma |
covariance or scale matrix of the coefficients corresponding to
functional innovations. The default value is |
df |
degrees of freqdom if |
The purpose is to simulate a functional autoregressive process of the form
Here we assume that the observations lie in a finite dimensional subspace of the function space spanned by
Fourier basis functions . That is
,
and
. Then it follows that
Hence the dynamic of the functional time series is described by a VAR() process.
In this mathematical model the law of is determined by
noise
.
The matrices Psi[,,k]
correspond to . If
op.norms
is provided, then the coefficient
matrices will be rescaled, such that the Hilbert-Schmidt norms of correspond to the vector.
An object of class fd
.
The multivariate equivalent in the freqdom
package: rar
# Generate a FAR process without burnin (starting from 0) fts = fts.rar(n = 5, d = 5, burnin = 0) plot(fts) # Generate a FAR process with burnin 50 (starting from observations # already resambling the final distribution) fts = fts.rar(n = 5, d = 5, burnin = 50) plot(fts) # Generate observations with very strong dependance fts = fts.rar(n = 100, d = 5, burnin = 50, op.norms = 0.999) plot(fts)
# Generate a FAR process without burnin (starting from 0) fts = fts.rar(n = 5, d = 5, burnin = 0) plot(fts) # Generate a FAR process with burnin 50 (starting from observations # already resambling the final distribution) fts = fts.rar(n = 5, d = 5, burnin = 50) plot(fts) # Generate observations with very strong dependance fts = fts.rar(n = 100, d = 5, burnin = 50, op.norms = 0.999) plot(fts)
Generate a functional moving average process.
fts.rma( n = 100, d = 11, Psi = NULL, op.norms = NULL, noise = "mnorm", sigma = diag(d:1)/d, df = 4 )
fts.rma( n = 100, d = 11, Psi = NULL, op.norms = NULL, noise = "mnorm", sigma = diag(d:1)/d, df = 4 )
n |
number of observations to generate. |
d |
dimension of the underlying multivariate VAR model. |
Psi |
an array of |
op.norms |
a vector with non-negative scalar entries to which the |
noise |
|
sigma |
covariance or scale matrix of the coefficients corresponding to functional innovations. The default value
is |
df |
degrees of freqdom if |
The purpose is to simulate a functional autoregressive process of the form
Here we assume that the observations lie in a finite dimensional subspace of the function space spanned by
Fourier basis functions . That is
,
and
. Then it follows that
Hence the dynamic of the functional time series is described by a VAR() process.
In this mathematical model the law of is determined by
noise
. The matrices Psi[,,k]
correspond to . If
op.norms
is provided, then the coefficient matrices will be rescaled, such that
the Hilbert-Schmidt norms of correspond to the vector.
An object of class fd
.
The multivariate equivalent in the freqdom
package: rma
# Generate a FMA process without burnin (starting from 0) fts = fts.rma(n = 5, d = 5) plot(fts) # Generate observations with very strong dependance fts = fts.rma(n = 100, d = 5, op.norms = 0.999) plot(fts) # Generate observations with very strong dependance and noise # from the multivariate t distribution fts = fts.rma(n = 100, d = 5, op.norms = 0.999, noise = "mt") plot(fts)
# Generate a FMA process without burnin (starting from 0) fts = fts.rma(n = 5, d = 5) plot(fts) # Generate observations with very strong dependance fts = fts.rma(n = 100, d = 5, op.norms = 0.999) plot(fts) # Generate observations with very strong dependance and noise # from the multivariate t distribution fts = fts.rma(n = 100, d = 5, op.norms = 0.999, noise = "mt") plot(fts)
Estimates the spectral density operator and cross spectral density operator of functional time series.
fts.spectral.density( X, Y = X, freq = (-1000:1000/1000) * pi, q = ceiling((dim(X$coefs)[2])^{ 0.33 }), weights = "Bartlett" )
fts.spectral.density( X, Y = X, freq = (-1000:1000/1000) * pi, q = ceiling((dim(X$coefs)[2])^{ 0.33 }), weights = "Bartlett" )
X |
an object of class |
Y |
an object of class |
freq |
a vector containing frequencies in |
q |
window size for the kernel estimator, i.e. a positive integer. By default we choose |
weights |
kernel used in the spectral smoothing. For possible choices see
|
Let and
be two samples of functional data. The cross-spectral density kernel between the two time series
and
is defined as
The function fts.spectral.density
determines the empirical
cross-spectral density kernel between the two time series. The estimator is of the
form
with defined in
fts.cov.structure
.
The other paremeters are as in cov.structure
.
Since and
we can write
where is defined as for the function
spectral.density
for series of coefficient vectors
and
.
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 -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
)
The multivariate equivalent in the freqdom
package: spectral.density
data(pm10) X = center.fd(pm10) # Compute the spectral density operator with Bartlett weights SD = 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 weights SD = 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 q SD = fts.spectral.density(X, freq = (-50:50/50) * pi, q = 5, weight="Tukey") fts.plot.operators(SD, freq = -2:2)
data(pm10) X = center.fd(pm10) # Compute the spectral density operator with Bartlett weights SD = 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 weights SD = 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 q SD = fts.spectral.density(X, freq = (-50:50/50) * pi, q = 5, weight="Tukey") fts.plot.operators(SD, freq = -2:2)
fts.timedom
Creates an object of class fts.timedom
. This object corresponds to a sequence of linear operators.
fts.timedom(A, basisX, basisY = basisX)
fts.timedom(A, basisX, basisY = basisX)
A |
an object of class timedom. |
basisX |
an object of class |
basisY |
an object of class |
This class is used to describe a functional linear filter, i.e. a sequence of linear operators, each of which corresponds to a certain lag.
Formally we consider an object of class timedom
and add some basis functions. Depending on the context, we have different interpretations for the new object.
(I) In order to define operators which maps between two functions spaces, the we
interpret A$operators
as coefficients in the basis function expansion of the
kernel of some finite rank operators
The kernels are , where
and
are the basis functions provided by the arguments basisX and basisY, respectively. Moreover, we consider lags
. The object this function creates corresponds to the mapping
.
(II) We may ignore basisX, and represent the linear mapping
by considering and
.
(III) We may ignore basisY, and represent the linear mapping
by considering and
.
Returns an object of class fts.freqdom
. An object of class fts.freqdom
is a list containing the following components:
operators
returns the array
A$operators
.
basisX
returns basisX as given in the argument.
basisY
returns basisY as given in the argument.
lags
returns
A$lags
.
The multivariate equivalent in the freqdom
package: timedom
Checks if an object belongs to the class fts.freqdom
.
is.fts.freqdom(X)
is.fts.freqdom(X)
X |
some object |
TRUE
if X
is of type fts.freqdom
, FALSE
otherwise
fts.freqdom
, fts.timedom
, is.fts.timedom
Checks if an object belongs to the class fts.timedom
.
is.fts.timedom(X)
is.fts.timedom(X)
X |
some object |
TRUE
if X
is of type fts.timedom
, FALSE
otherwise
fts.freqdom
, fts.timedom
, is.fts.freqdom
Concentration of partical matter of diameter 10 micrometers or smaller (PM10
)
is one of the most widely adopted measurements for assesment of ambient air quality.
In this dataset, we provide measurement of daily temporal distribution of
PM10
in Graz, Austria, collected between December 2004 and June 2005.
For the purpose of this R package, raw data of 48 observations per day, was transformed to functional objects in Fourier basis using fda package.
pm10
pm10
daily distribution functions in the
fd
format
from the fda package
Styrian Government, FA 17C Technical Environmental Protection and Safety, Air Quality Control Section,
Hormann, Siegfried, Brigitte Pfeiler, and Ernst Stadlober. Analysis and prediction of particulate matter PM10 for the winter season in Graz. Austrian Journal of Statistics 34.4 (2005): 307-326.
data(pm10) summary(pm10) plot(pm10)
data(pm10) summary(pm10) plot(pm10)