| Title: | Multivariate Functional Spatial Data |
|---|---|
| Description: | Analysis of multivariate functional spatial data, including spectral multivariate functional principal component analysis and related statistical procedures (Si-Ahmed, Idris, et al. "Principal component analysis of multivariate spatial functional data." Big Data Research 39 (2025) 100504). (Kuenzer, T., Hörmann, S., & Kokoszka, P. (2021). "Principal component analysis of spatially indexed functions." Journal of the American Statistical Association, 116(535), 1444-1456.) (Happ, C., & Greven, S. (2018). "Multivariate functional principal component analysis for data observed on different (dimensional) domains." Journal of the American Statistical Association, 113(522), 649-659.) |
| Authors: | SI-AHMED IDRIS [aut, cre], Thomas Kuenzer [ctb] (Code adapted from the fsd package), Judith AGONKOUI Christelle [ctb], HAMDAD Leila [ctb], DABO-NIANG Sophie [ctb] |
| Maintainer: | SI-AHMED IDRIS <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.1 |
| Built: | 2026-05-21 06:04:36 UTC |
| Source: | https://github.com/cran/MFSD |
Works as one would expect.
## S3 method for class 'fsd.fd' fsd1 - fsd2 = NULL## S3 method for class 'fsd.fd' fsd1 - fsd2 = NULL
fsd1, fsd2
|
functional spatial data objects |
An object of class fsd.fd.
If a single argument is provided, the result is the additive inverse of the
input object. Otherwise, it corresponds to the element-wise difference between
two functional spatial data objects.
Subsetting works as with conventional arrays. By default, dimensions can be dropped.
## S3 method for class 'fsd.fd' fsdobj[..., drop = TRUE]## S3 method for class 'fsd.fd' fsdobj[..., drop = TRUE]
fsdobj |
a functional spatial data object |
... |
the indices to take |
drop |
whether to flatten the spatial grid by dropping dimensions of length one. |
An object of class fsd.fd.
The returned object is a subset of the original functional spatial data object.
The structure of the coefficient array and the associated spatial grid is
reduced according to the selected indices. If drop = TRUE, dimensions
of length one in the spatial grid may be removed.
data("temp") plot(temp[1:2, 1:2, 1, drop = TRUE])data("temp") plot(temp[1:2, 1:2, 1, drop = TRUE])
Works as one would expect.
## S3 method for class 'fsd.fd' scalar * fsdobj## S3 method for class 'fsd.fd' scalar * fsdobj
scalar |
a scalar number |
fsdobj |
a functional spatial data object |
An object of class fsd.fd.
The result corresponds to a scalar multiplication of the functional spatial
data object, where all coefficients are multiplied by the given scalar.
Works as one would expect.
## S3 method for class 'fsd.fd' fsdobj / scalar## S3 method for class 'fsd.fd' fsdobj / scalar
fsdobj |
a functional spatial data object |
scalar |
a scalar number |
An object of class fsd.fd.
The result corresponds to a scalar division of the functional spatial data
object, where all coefficients are divided by the given scalar.
Take only every s-th element
## S3 method for class 'fsd.fd' fsdobj %/% s## S3 method for class 'fsd.fd' fsdobj %/% s
fsdobj |
a functional spatial data object |
s |
an integer or a vector with one entry for every dimension of the spatial grid. |
An object of class fsd.fd.
The returned object is a downsampled version of the input functional spatial
data object, where only every s-th spatial location is retained along
each spatial dimension.
data("temp") plot(temp %/% 3)data("temp") plot(temp %/% 3)
Works as one would expect.
## S3 method for class 'fsd.fd' fsd1 + fsd2## S3 method for class 'fsd.fd' fsd1 + fsd2
fsd1, fsd2
|
functional spatial data objects |
An object of class fsd.fd.
The result corresponds to the element-wise sum of the coefficient arrays of
the two functional spatial data objects. The spatial structure and basis are preserved.
Works as one would expect
## S3 method for class 'fsd.fd' as.fd(x, ...)## S3 method for class 'fsd.fd' as.fd(x, ...)
x |
a functional spatial data object |
... |
currently unused |
An object of class fd (from the fda package).
The returned object corresponds to a functional data object obtained by
collapsing the spatial dimensions of the input.
The coefficients matrix represents functional observations, while the
spatial structure is removed (or flattened).
Works as one would expect
as.fsd.fd(x, ...)as.fsd.fd(x, ...)
x |
a functional data object or something that can be converted into one. |
... |
currently unused |
An object of class fsd.fd.
The returned object represents functional data indexed over a spatial grid.
It contains: coefs: an array of coefficients where the first dimension
corresponds to basis coefficients and the remaining dimensions correspond
to spatial locations,
basis: a basis object describing the functional representation,
fdnames: a list describing the axes (spatial indices and function domain).
This transformation embeds classical functional data into a spatial framework.
This function is used to center spatial functional data.
center.fsd.fd(X, margins = NULL, na.rm = FALSE)center.fsd.fd(X, margins = NULL, na.rm = FALSE)
X |
The functional spatial data. |
margins |
The margins for which the centering should be done separately in every entry, in order to remove a trend. |
na.rm |
Whether or not missing values should be ignored. |
The centered data.
data("temp") T.centered = center.fsd.fd(temp) plot(mean(T.centered, margins = 1:2)) T.centered2 = center.fsd.fd(temp, margins = 1:2) plot(mean(T.centered2, margins = 1:2)) plot(mean(temp, margins = 1:2))data("temp") T.centered = center.fsd.fd(temp) plot(mean(T.centered, margins = 1:2)) T.centered2 = center.fsd.fd(temp, margins = 1:2) plot(mean(T.centered2, margins = 1:2)) plot(mean(temp, margins = 1:2))
This function is used to calculate the differences of functional data on a spatial grid.
## S3 method for class 'fsd.fd' diff(x, lag = 1, differences = 1, ..., dim = 1)## S3 method for class 'fsd.fd' diff(x, lag = 1, differences = 1, ..., dim = 1)
x |
the functional spatial data. |
lag |
the lag. |
differences |
the order of the differences. |
... |
currently unused |
dim |
the dimension with respect to which the differences are to be computed. |
An object of class '"fsd.fd"' representing the functional difference between the input functional spatial data objects.
data("temp") plot(diff(temp, dim = 1))data("temp") plot(diff(temp, dim = 1))
This function is used to estimate a covariance operator of stationary functional spatial data with respect to some lag h.
fsd.covariance(Y = NULL, h, centered = FALSE, na.rm = FALSE, unbiased = FALSE)fsd.covariance(Y = NULL, h, centered = FALSE, na.rm = FALSE, unbiased = FALSE)
Y |
the functional spatial data. Either an fd object or an array. |
h |
the spatial lag with respect to which the autocovariance is to be estimated. |
centered |
a boolean indicating whether or not the data is already centered. |
na.rm |
whether or not missing values should be ignored. |
unbiased |
whether or not to scale the estimator to be unbiased. FALSE by default. Is not used if na.rm is TRUE. |
the covariance matrix.
This function extends the possibilities of the function fd found in the package fda to include functional data on a spatial grid of arbitrary dimension r.
fsd.fd(coef = NULL, basisobj = NULL, fdnames = NULL)fsd.fd(coef = NULL, basisobj = NULL, fdnames = NULL)
coef |
an array of arbitrary dimension 1 + r, where the first dimension corresponds to basis functions. |
basisobj |
a functional basis object defining the basis. |
fdnames |
a list of length r with each member containing the labels for the dimensions of the data. |
the fsd.fd object.
This function creates a functional spatial filter
fsd.filter(laglist, operatorlist, basisobj = NULL)fsd.filter(laglist, operatorlist, basisobj = NULL)
laglist |
a list of lags. |
operatorlist |
a list of operators, i.e. matrices. |
basisobj |
a functional basis object defining the basis. |
the fsd.filter object.
This function is used to verify if a functional spatial filter is unilateral.
fsd.filter.is.unilateral(A, exclude.origin = FALSE)fsd.filter.is.unilateral(A, exclude.origin = FALSE)
A |
the functional spatial filter. |
exclude.origin |
whether to exclude the origin from the definition of unilaterality. |
a Boolean indicating whether A is unilateral or not.
This function is used to calculate the Fourier transform
fsd.fourier(covs, laglist, thlist)fsd.fourier(covs, laglist, thlist)
covs |
the covariances to be transformed |
laglist |
list of lags. |
thlist |
list of frequencies. |
the Fourier transform of the covariances.
This function is used to calculate the Fourier inverse.
fsd.fourier.inverse(evecs, thlist, laglist)fsd.fourier.inverse(evecs, thlist, laglist)
evecs |
the eigenvectors to be expanded. |
thlist |
list of frequencies. |
laglist |
list of lags. |
the filter obtained by applying the Fourier inverse on evecs.
This function performs a test on normality of some functional spatial data.
fsd.jb.test(X.spca, Npc = NULL, L = NULL, var.method = "integral")fsd.jb.test(X.spca, Npc = NULL, L = NULL, var.method = "integral")
X.spca |
a spectral principal components analysis as performed by
|
Npc |
the number of spectral principal components to use for the test. |
L |
the maximum lag to compute the covariance of the scores during the computation of the autocovariances. |
var.method |
the method that is used to calculate the long-run variance of the SFPC scores. Either "direct" or "integral". |
To ensure accuracy of numerical integration during the Fourier
transform, the frequencies of FS should be a suitably dense grid.
A list with components
T4 |
the test statistic. |
p.value |
the p-value. |
df |
the degrees of freedom. |
T4.vector |
the vector of the test statistics for each single SPC. |
This function is used to compute the norm of functional data.
fsd.norm(X)fsd.norm(X)
X |
the functional spatial data. |
an array of the norms.
This function is used to permute the order of the dimensions of the spatial grid of some functional spatial data.
fsd.perm(fsdobj, perm = NULL)fsd.perm(fsdobj, perm = NULL)
fsdobj |
the functional spatial data. |
perm |
the subscript permutation vector, i.e. a permutation of the integers 1:r. |
A numeric vector containing the permutation indices used to reorder the functional spatial data.
data("temp") fsd.plot.data(fsd.perm(temp, c(2, 1, 3)))data("temp") fsd.plot.data(fsd.perm(temp, c(2, 1, 3)))
This function is used to plot the autocovariance operator of functional spatial data along a two-dimensional plane of lags.
fsd.plot.covariance( X, basisobj = NULL, q = 0, gridsize = NULL, set.dims = NULL, plot.cor = FALSE, na.rm = FALSE, main = NULL, xlab = NULL, ylab = NULL, ... )fsd.plot.covariance( X, basisobj = NULL, q = 0, gridsize = NULL, set.dims = NULL, plot.cor = FALSE, na.rm = FALSE, main = NULL, xlab = NULL, ylab = NULL, ... )
X |
the functional spatial data. Either an fd object or an array. |
basisobj |
the basis of the functional data. |
q |
the maximal lag to be plotted. |
gridsize |
the resolution of the grid on which the kernel will be evaluated. |
set.dims |
the coordinates to be fixed. A vector of dimension r. NaN represents not fixed components. |
plot.cor |
a boolean indicating whether the correlation or the covariance should be plotted. |
na.rm |
whether or not missing values should be ignored. |
main |
title of the plot. |
xlab |
label for the x-axis. |
ylab |
label for the y-axis. |
... |
other arguments to pass to the plot function |
No return value. The function computes the covariance or correlation operator of the functional spatial data
data("temp") fsd.plot.covariance(temp, q = 3, plot.cor = TRUE, zlim = c(-1,1))data("temp") fsd.plot.covariance(temp, q = 3, plot.cor = TRUE, zlim = c(-1,1))
This function is used to plot functional spatial data on a grid of dimension r, along a two-dimensional plane of indices.
fsd.plot.data( X, basisobj = NULL, gridsize = NULL, set.dims = NULL, xlim = NULL, ylim = NULL, main = NULL, xlab = NULL, ylab = NULL )fsd.plot.data( X, basisobj = NULL, gridsize = NULL, set.dims = NULL, xlim = NULL, ylim = NULL, main = NULL, xlab = NULL, ylab = NULL )
X |
the functional spatial data. Either an fd object or an array, or a list thereof. |
basisobj |
the basis of the functional data. |
gridsize |
the number of grid points on which to evaluate the functional data. |
set.dims |
the coordinates to be fixed. A vector of dimension r. NaN represents not fixed components. |
xlim |
limits for the coordinates on the x-axis. |
ylim |
limits for the coordinates on the y-axis. |
main |
title of the plot. |
xlab |
label for the x-axis. |
ylab |
label for the y-axis. |
No return value. This function produces a graphical representation of functional spatial data.
plot.fsd.fd, fsd.plot.filters,
fsd.plot.covariance
data("temp") fsd.plot.data(temp, set.dims = c(NaN, NaN, 3))data("temp") fsd.plot.data(temp, set.dims = c(NaN, NaN, 3))
This function is used to plot functional spatial filters, along a two-dimensional plane of indices.
fsd.plot.filters( A, basisobj = NULL, gridsize = NULL, Npc = 3, Lmax = 3, set.dims = NULL, main = NULL, xlab = NULL, ylab = NULL )fsd.plot.filters( A, basisobj = NULL, gridsize = NULL, Npc = 3, Lmax = 3, set.dims = NULL, main = NULL, xlab = NULL, ylab = NULL )
A |
the filters. |
basisobj |
the basis of the functional data. |
gridsize |
the number of grid points on which to evaluate the functional data. |
Npc |
number of filters to plot. |
Lmax |
maximum lag to plot. |
set.dims |
the coordinates to be fixed. A vector of dimension r. NaN represents not fixed components. |
main |
title of the plot. |
xlab |
label for the x-axis. |
ylab |
label for the y-axis. |
No return value. This function produces a graphical representation of functional spatial filters.
This function is used to simulate a sample from a spatial functional ARMA (SFARMA) process using a normal or t-distributed noise process.
fsd.sfarma( n, Sigma = NULL, ARfilter = NULL, MAfilter = NULL, burnin = 30, basisobj = NULL, noise = "normal", do.fixed.point = FALSE, max.iter = 50, eps = 1e-05 )fsd.sfarma( n, Sigma = NULL, ARfilter = NULL, MAfilter = NULL, burnin = 30, basisobj = NULL, noise = "normal", do.fixed.point = FALSE, max.iter = 50, eps = 1e-05 )
n |
the sample size. |
Sigma |
the covariance matrix of the noise. |
ARfilter |
the functional spatial filter of the autoregressive part. |
MAfilter |
the functional spatial filter of the moving-average part. |
burnin |
the number of grid points to add on each side of the sample to achieve stationarity. |
basisobj |
the basis of the functional data. |
noise |
the noise distribution to use. Either "normal" or an integer for the degrees of freedom of a multivariate Student's t-distribution. |
do.fixed.point |
whether to always use a fixed point iteration. |
max.iter |
the maximum number of iterations in the fixed point iteration. |
eps |
the stopping criterion for the fixed point iteration. |
Please note that convergence in the fixed point iteration depends strongly on
the sample size and the structure of the AR filter. For certain choices of
parameters, even more than n iterations may be needed.
one sample of the SFARMA process.
This function performs spectral PCA on functional spatial data on a grid of dimension r.
fsd.spca( X, freq.res = 100, Npc = 3, L = 3, q = NULL, na.ignore = TRUE, return.F = FALSE, only.filters = FALSE )fsd.spca( X, freq.res = 100, Npc = 3, L = 3, q = NULL, na.ignore = TRUE, return.F = FALSE, only.filters = FALSE )
X |
the functional spatial data. Either an fd object or an array. |
freq.res |
the resolution for the computation of the spectral density. |
Npc |
the number of principal components to be computed. |
L |
the maximum lag for the filters. An integer or vector of integers. |
q |
a tuning parameter for the estimation of the the spectral density operator. An integer or vector of integers. |
na.ignore |
whether to ignore missing data points in the computation of the scores. |
return.F |
a boolean indicating whether to return the spectral density. |
only.filters |
a boolean indicating whether to compute only the filters, leaving out the scores. |
This function can be used to compute spectral PCA. By setting
q = 0, it can also be used to perform static PCA.
Setting a higher value for freq.res increases the runtime
significantly, but yields a more accurate result because of reduced
integration errors.
A list with components
F |
the spectral density. |
tuning.params |
a list of the used tuning parameters |
filters |
the SPC filters. |
scores |
the SPC scores. |
var |
the theoretical fractions of variance explained by each PC. |
X.mean |
the mean of X. |
fsd.spca.inverse, fsd.spectral.density
This function estimates the (theoretical) autocovariance for each spectral principal component score for some spatial functional data.
fsd.spca.cov(FS, L = 3)fsd.spca.cov(FS, L = 3)
FS |
the spectral density. |
L |
the maximum lag to compute the covariance of the scores |
To ensure accuracy of numerical integration during the Fourier
transform, the frequencies of F should be a suitably dense grid.
A list with components
laglist |
the list of lags. |
cov |
a matrix with the autocovariances of the principal component scores. |
This function calculates the SPC filters from a given spectral density operator.
fsd.spca.filters(FS, Npc = 1, L = 3)fsd.spca.filters(FS, Npc = 1, L = 3)
FS |
the spectral density. |
Npc |
the number of principal components to be computed. |
L |
the maximum lag for the filters, as an integer or vector of integers. |
The eigenvectors used for the calculation of the Fourier expansion
are oriented such that the sum of their coordinates over the basis of the
fd object (i.e. the entries in the coefs array) is a non-negative
real number. If the basis is not orthonormal, this is done with respect to
a virtual orthonormal basis in the background.
the SPC filters.
This function is used to reconstruct the original functional data from the
filters and the score. It applies the transposed matrices of the filter
A to the scores.
fsd.spca.inverse(A, scores, mean.X = NULL)fsd.spca.inverse(A, scores, mean.X = NULL)
A |
the filters. |
scores |
the scores as an array. |
mean.X |
the mean of X. |
X the reconstructed functional data
This function computes the scores. It applies the matrices of the filter
A to the data X.
fsd.spca.scores(X, A, na.ignore = FALSE)fsd.spca.scores(X, A, na.ignore = FALSE)
X |
the functional spatial data. Either an fd object or an array. |
A |
the filter used to compute the scores. |
na.ignore |
whether missing values in the data X should be ignored. |
the array of the scores.
This function estimates the (theoretical) fraction of the variance explained by each spectral principal component for some spatial functional data.
fsd.spca.var(FS)fsd.spca.var(FS)
FS |
the spectral density. |
To ensure accuracy of numerical integration, the frequencies of
FS should be a suitably dense grid. In order for the estimations to
conform with the actual variance explained (1 - NMSE), the tuning
parameters in the estimation of the spectral density need to be chosen
carefully.
the fraction of the variance explained by each PC.
This function is used to estimate the spectral density operator of stationary functional spatial data on a spatial frequency grid.
fsd.spectral.density(X, freq, q = NULL, na.rm = FALSE)fsd.spectral.density(X, freq, q = NULL, na.rm = FALSE)
X |
the functional spatial data. Either an fd object or an array. |
freq |
the spatial frequencies with respect to which the spectral density is to be estimated. A vector or a list of vectors defining the grid. |
q |
the size of the window of the kernel used for estimation. An integer
or a vector. For any dimension, the value |
na.rm |
whether or not missing values should be ignored. |
The spectral density is estimated employing a Bartlett kernel on
the Euclidean norm of the lags. Therefore, the lag q is the smallest
lag not to be taken into consideration.
the spectral density, i.e. a list consisting of
operators |
a list of the the spectral density operator at different spatial frequencies. |
freq |
a list of the spatial frequencies. |
basis |
the basis object of the functional data. |
estimation.q |
the tuning parameter |
This function plots functional data on a grid.
fsd.z.plot(Zlist, positions, basisobj = NULL, gridsize = 50, ...)fsd.z.plot(Zlist, positions, basisobj = NULL, gridsize = 50, ...)
Zlist |
list of arrays with coefficients. |
positions |
the positions of the single curves in space. |
basisobj |
the basis of the functional data. |
gridsize |
the number of grid points on which to evaluate the curves. |
... |
other arguments to pass to the plot function |
No return value. This function is called for its side effect of producing a graphical representation of functional data evaluated on a spatial grid.
an example taken from the variable indian which represents a list containing the maximum lag for the filters for each variable. An integer or vector of #' integers.
data(Llist)data(Llist)
Llist has a dimension of [1:22]
An object of class int [1:22].
data(Llist)data(Llist)
This function is used to calculate the mean on functional data on a spatial grid.
## S3 method for class 'fsd.fd' mean(x, trim = 0, na.rm = FALSE, ..., margins = NULL)## S3 method for class 'fsd.fd' mean(x, trim = 0, na.rm = FALSE, ..., margins = NULL)
x |
the functional spatial data. |
trim |
currently unused |
na.rm |
whether or not missing values should be ignored. |
... |
currently unused |
margins |
the margins that should not be averaged over. |
the mean of x
data("temp") plot(mean(temp)) plot(mean(temp, margins = 1:2))data("temp") plot(mean(temp)) plot(mean(temp, margins = 1:2))
This function performs multivariate PCA on functional spatial data on a grid of dimension r.
mfsd( X, freq.res = 100, SM_Npc = 3, L = 3, q = NULL, na.ignore = TRUE, return.F = FALSE, only.filters = FALSE )mfsd( X, freq.res = 100, SM_Npc = 3, L = 3, q = NULL, na.ignore = TRUE, return.F = FALSE, only.filters = FALSE )
X |
a list containing the functional spatial data. Either an fd object or an array. |
freq.res |
the resolution for the computation of the spectral density. |
SM_Npc |
the number of multivariat spatial functional principal components to be computed. |
L |
a list containing the maximum lag for the filters for each variable. An integer or vector of integers. |
q |
a list containing tuning parameter for the estimation of the the spectral density operator for each variable. An integer or vector of integers. |
na.ignore |
whether to ignore missing data points in the computation of the scores. |
return.F |
a boolean indicating whether to return the spectral density. |
only.filters |
a boolean indicating whether to compute only the filters, leaving out the scores. |
This function can be used to compute spectral PCA. By setting
q = 0, it can also be used to perform static MFPCA.
Setting a higher value for freq.res increases the runtime significantly, but yields a more
accurate result because of reduced integration errors.
A list with components
Value |
eigenvalue for each multivariate PC |
tuning.params |
a list of the used tuning parameters |
filters |
the multivariate SPC filters. |
scores |
the multivariate SPC scores. |
vm |
the theoretical fractions of variance explained by each multivariate PC. |
SML_Mean |
the mean of X. |
SM_FSD |
list of univariate spatial functional principal component analysis. |
data("X1999") data("X2000") data("qlist") data("Llist") X = list(X1999, X2000) q = list(qlist[,17], qlist[,18]) L = list(L1 = Llist[17], L2 = Llist[18]) mfsd(X = X, L = L, q = q, SM_Npc = 4)data("X1999") data("X2000") data("qlist") data("Llist") X = list(X1999, X2000) q = list(qlist[,17], qlist[,18]) L = list(L1 = Llist[17], L2 = Llist[18]) mfsd(X = X, L = L, q = q, SM_Npc = 4)
This function calculates the multivariate SPC filters from a given spectral density operator.
mfsd_Filter(SM_FSD, SM_vec, J)mfsd_Filter(SM_FSD, SM_vec, J)
SM_FSD |
list of univariate spatial functional principal component analysis. |
SM_vec |
list of variable eigenvectors. |
J |
number of functional multivariate spatial principal components. |
The univariate eigenvectors and filters are used to compute multivariate spatial function filters.
the Multivariate SPC filters.
Compute the Multivariate Scores for Spatial Functional Data.
mfsd_Scores(EEM, SM_vec, SM_FSD, X, J)mfsd_Scores(EEM, SM_vec, SM_FSD, X, J)
EEM |
concatenated scores. |
SM_vec |
list of variable eigenvectors. |
SM_FSD |
list of univariate spatial functional principal component analysis. |
X |
list of univariate spatial functional data. |
J |
number of functional multivariate spatial principal components. |
a list of the multivariate scores.
To assess the effectiveness of integrating the spatial and multivariate aspects through SMFPCA, it is common to reconstruct the original functional data from the already computed scores and filters. For each instance, we employ both the novel SMFPCA and the conventional MFPCA. We assess the effectiveness of dimension reduction using the metric known as the normalized mean squared error (NMSE) for each univariate component. NMSE* evaluates the quality of the approximation without being influenced by grid boundary effects, unlike NMSE, where the approximation is less accurate at the boundary.
mfsd.evaluation(Xspec, Xspecc, X00, Npc = 3)mfsd.evaluation(Xspec, Xspecc, X00, Npc = 3)
Xspec |
an object of class SM_object, this function is obtained by applying the mfsd function with a non-zero value of q. |
Xspecc |
an object of class M_object, this object is obtained by applying the mfsd function with q equal to zero. |
X00 |
a list containing the functional spatial data. Either an fd object or an array. |
Npc |
the number of multivariat spatial functional principal components to be computed. |
a display of the NMSE and NMSE* results from print.
To assess the effectiveness of integrating the spatial and multivariate aspects through SMFPCA, one must evaluate the effectiveness of dimension reduction using the metric known as the normalized mean squared error (NMSE) for each univariate component. NMSE* evaluates the quality of the approximation without being influenced by grid boundary effects, unlike NMSE, where the approximation is less accurate at the boundary.
mfsd.nmse(Xspec, X, Npc = 3)mfsd.nmse(Xspec, X, Npc = 3)
Xspec |
an object of class M_object, This object is obtained by applying the mfsd function with q equal to zero. |
X |
a list containing the functional spatial data. Either an fd object or an array. |
Npc |
the number of multivariat spatial functional principal components to be computed. |
a display of the NMSE and NMSE* results from print.
This function is used to plot functional spatial data on a grid of dimension r, along a two-dimensional plane of indices.
## S3 method for class 'fsd.fd' plot(x, ..., gridsize = NULL, set.dims = NULL)## S3 method for class 'fsd.fd' plot(x, ..., gridsize = NULL, set.dims = NULL)
x |
the functional spatial data. |
... |
graphical parameters. |
gridsize |
the number of grid points on which to evaluate the functional data. |
set.dims |
the coordinates to be fixed. A vector of dimension r. NaN represents not fixed components. |
No return value. This function is called for its side effect of producing graphical displays of functional spatial data.
data("temp") plot(temp)data("temp") plot(temp)
This function plots functional spatial filters along a two-dimensional plane of indices.
## S3 method for class 'fsd.filter' plot( x, xlim = NULL, ylim = NULL, main = NULL, xlab = NULL, ylab = NULL, gridsize = NULL, Npc = 3, Lmax = 3, set.dims = NULL, ... )## S3 method for class 'fsd.filter' plot( x, xlim = NULL, ylim = NULL, main = NULL, xlab = NULL, ylab = NULL, gridsize = NULL, Npc = 3, Lmax = 3, set.dims = NULL, ... )
x |
the filter object. |
xlim |
limits of the x-axis. |
ylim |
limits of the y-axis. |
main |
main title of the graph. |
xlab |
label of the x-axis. |
ylab |
label of the y-axis. |
gridsize |
number of grid points used to evaluate the functional data. |
Npc |
number of filters to plot. |
Lmax |
maximum lag to plot. |
set.dims |
coordinates to be fixed. A vector of dimension r. 'NaN' represents components that are not fixed. |
... |
additional graphical parameters. |
No return value. This function is called for its side effect of producing graphical displays of functional spatial filters.
Plot method for mfsd.fd objects
## S3 method for class 'mfsd.fd' plot( x, xlim = NULL, ylim = NULL, main = NULL, xlab = NULL, ylab = NULL, gridsize = NULL, set.dims = NULL, ... )## S3 method for class 'mfsd.fd' plot( x, xlim = NULL, ylim = NULL, main = NULL, xlab = NULL, ylab = NULL, gridsize = NULL, set.dims = NULL, ... )
x |
object of class mfsd.fd |
xlim |
limits of x axis |
ylim |
limits of y axis |
main |
title |
xlab |
x label |
ylab |
y label |
gridsize |
grid size |
set.dims |
dimension selection |
... |
additional graphical parameters |
No return value. This function is called for its side effect of producing graphical plots of the functional spatial data.
a list containing tuning parameter for the estimation of the the spectral density of indian variable
data(qlist)data(qlist)
qlist has a dimension of 2 22
An object of class "matrix" "array".
data(qlist)data(qlist)
This function is used to analyse functional spatial filters, indicating how the squared norms lie.
## S3 method for class 'fsd.filter' summary(object, use.norm = Inf, make.plot = FALSE)## S3 method for class 'fsd.filter' summary(object, use.norm = Inf, make.plot = FALSE)
object |
the filter. |
use.norm |
which norm to use for the lags. |
make.plot |
a boolean indicating whether to plot the result. |
object list with components
balls |
a data frame containing the cumulative sums of the squared norms of the filter coefficients up to some maximum lag. |
zeroplanes |
a matrix containing the sums of the squared norms of the filter coefficients lying on the (hyper-) planes with one dimension of the lag equals zero, along with the sum over all lags as comparison. |
abs.sum |
a data frame containing the cumulative sums of the norms of the filter coefficients. |
This function is used to analyse multivariate functional spatial filters, indicating how the squared norms lie.
## S3 method for class 'mfsd.filter' summary(object, use.norm = Inf, make.plot = FALSE)## S3 method for class 'mfsd.filter' summary(object, use.norm = Inf, make.plot = FALSE)
object |
containing a list of variable filters. |
use.norm |
which norm to use for the lags. |
make.plot |
a boolean indicating whether to plot the result. |
object list with components
balls |
a data frame containing the cumulative sums of the squared norms of the filter coefficients up to some maximum lag. |
zeroplanes |
a matrix containing the sums of the squared norms of the filter coefficients lying on the (hyper-) planes with one dimension of the lag equals zero, along with the sum over all lags as comparison. |
abs.sum |
a data frame containing the cumulative sums of the norms of the filter coefficients. |
CPC daily Temperature data of mean temperatures in Wyoming projected onto a B-spline basis of 36 functions for each year, from 1979 to 2017 and with a spatial resolution of 0.5 degrees.
data(temp)data(temp)
An object of class "fsd.fd".
The gridded data has been obtained by Shepard's method.
data(temp) plot(temp)data(temp) plot(temp)
This function is used to expand indices into a grid. Works similar to
expand.grid.
unfold(indexlist, r = NULL, return.array = FALSE)unfold(indexlist, r = NULL, return.array = FALSE)
indexlist |
indices to be expanded. Either a list with each member representing a dimension, or a vector. |
r |
the dimension of the grid to be created. This is only needed if indexlist is a vector. |
return.array |
a boolean indicating whether an array should be returned or a list. |
a list or an array with the coordinates of the grid.
unfold(list(11:12, 21:23), return.array = TRUE)unfold(list(11:12, 21:23), return.array = TRUE)
Spatial Functional Data of sea surface temperature (SST) data from the NOAA Optimum Interpolation Sea Surface Temperature dataset. The dataset exhibiting typical spatial dependence characterized by an exponential decay.
data(X1999)data(X1999)
An object of class "fsd.fd".
data(X1999)data(X1999)
Spatial Functional Data of sea surface temperature (SST) data from the NOAA Optimum Interpolation Sea Surface Temperature dataset. The dataset exhibiting typical spatial dependence characterized by an exponential decay.
data(X2000)data(X2000)
An object of class "fsd.fd".
data(X2000)data(X2000)
Spatial Functional Data of sea surface temperature (SST) data from the NOAA Optimum Interpolation Sea Surface Temperature dataset. The dataset exhibiting typical spatial dependence characterized by an exponential decay.
data(X2001)data(X2001)
An object of class "fsd.fd".
data(X2001)data(X2001)