predictEigenfunction: Spatial dominant patterns on new locations

Description Usage Arguments Value See Also Examples

View source: R/SpatPCA.R

Description

Estimate K eigenfunctions on new locations

Usage

1
predictEigenfunction(spatpca_object, x_new)

Arguments

spatpca_object

An spatpca class object

x_new

New location matrix.

Value

A matrix with K Eigenfunction values on new locations.

See Also

spatpca

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 1D: artificial irregular locations
x_1D <- as.matrix(seq(-5, 5, length = 10))
Phi_1D <- exp(-x_1D^2) / norm(exp(-x_1D^2), "F")
set.seed(1234)
Y_1D <- rnorm(n = 100, sd = 3) %*% t(Phi_1D) + matrix(rnorm(n = 100 * 10), 100, 10)
rm_loc <- sample(1:50, 20)
x_1Drm <- x_1D[-rm_loc]
Y_1Drm <- Y_1D[, -rm_loc]
x_1Dnew <- as.matrix(seq(-5, 5, length = 20))
cv_1D <- spatpca(x = x_1Drm, Y = Y_1Drm, tau2 = 1:100, num_cores = 2)
dominant_patterns <- predictEigenfunction(cv_1D, x_new = x_1Dnew)

SpatPCA documentation built on Jan. 31, 2021, 5:05 p.m.