The purpose of R package surfcov
is to enable covariance estimation
for random surfaces beyond separability, proposed in the papers
arXiv:1912.12870 and
arXiv:2007.12175.
Let
be i.i.d. matrices of size
representing discrete measurements (on a grid) of some latent random
surfaces on a 2D domain, and
be the covariance operator. The covariance is a tensor of size
,
which becomes problematic to handle for
and
as small as 100. The assumption of separability postulates that
which reduces statistical and computational burden, but is often critized as an oversimplification, since it does not allow any interaction between the two dimensions.
This package allows for efficient estimation and subsequent manipulation of two alternative models, which are both strict generalizations of separability:
When the data are stored in form of an array X
of size
,
it can be simply checked whether a given model can be potentially useful
by running
spb(X)
for the separable-plus-banded model; orscd(X)
for the
You can install the development version from GitHub with:
install.packages("devtools") # only if devtools is not yet installed
library(devtools)
install_github("TMasak/surfcov")
When the data are stored in form of an array X
of size
,
it can be simply checked whether a given model can be potentially useful
by running
spb(X)
for the separable-plus-banded model; orscd(X)
for the
In particular,
# X <- array(runif(100*20*30),c(100,20,30))
spb_est <- spb(X)
spb$d
Run cross-validation (CV) in order to pick a value of the bandwidth
,
and then fits the model with the best
found. If a value larger than 0 is returned, it means that a
separable-plus-banded model can fit the data better compared to a
separable model. If we instead of fit-based CV decide to used
prediction-based CV, it makes sense to check the gains in prediction:
# X <- array(runif(100*20*30),c(100,20,30))
spb_est <- spb(X,predict=T)
spb$d
spb$cv
The same can be done with the
-separable
model, replacing function
spb
by scd
, see ?spb
and ?scd
for a
more detailed description and examples. Note that by default, the mean
is always estimated empirically, unless other estimator of the mean is
provided.
Validity of a separable-plus-model can also be checked using a bootstrap test, e.g. by
test_spb(X,d=1)
When one of the models is fitted, a list of functions that can be useful to the user for subsequent manipulation of the estimated covariances is as follows:
adi()
solves the inverse problem involving a separable-plus-banded
covariancepcg()
solves the inverse problem involving an
apply_lhs()
applies fast an
To apply the separable-plus-banded model fast, see to_book_format
and
BXfast
. TODO:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.