spatial_kernel_matrix {SpatialBSS} | R Documentation |
Computation of Spatial Kernel Matrices
Description
spatial_kernel_matrix
computes spatial kernel matrices for a given kernel function with its parameters and a set of coordinates.
Usage
spatial_kernel_matrix(coords, kernel_type = c('ring', 'ball', 'gauss'),
kernel_parameters)
Arguments
coords |
a numeric matrix of dimension |
kernel_type |
a character string indicating which kernel function to use. Either |
kernel_parameters |
a numeric vector that gives the parameters for the kernel function. At least length of one for |
Details
Two versions of local covariance matrices can be defined:
-
'lcov'
: -
'ldiff'
: -
'lcov_norm'
:with
Where correspond to the pairwise distances between coordinates,
are the
p
random field values at location ,
is the sample mean vector, and the kernel function
determines the locality. The function
spatial_kernel_matrix
computes a list of c(n,n)
matrices where each entry of these matrices correspond to the spatial kernel function evaluated at the distance between two points, mathematically the entry ij of each kernel matrix is . The following kernel functions are implemented and chosen with the argument
kernel_type
:
-
'ring'
: parameters are inner radiusand outer radius
, with
, and
:
-
'ball'
: parameter is the radius, with
:
-
'gauss'
: Gaussian function where 95% of the mass is inside the parameter, with
:
The argument kernel_type
determines the used kernel function as presented above, the argument kernel_parameters
gives the corresponding parameters for the kernel function. Specifically, if kernel_type
equals 'ball'
or 'gauss'
then kernel_parameters
is a numeric vector where each entry corresponds to one parameter. Hence, length(kernel_parameters)
spatial kernel matrices of type kernel_type
are computed. Whereas, if kernel_type
equals 'ring'
, then kernel_parameters
must be a numeric vector of even length where subsequently the inner and outer radii must be given (informally: c(r_i1, r_o1, r_i2, r_o2, ...)
). In that case length(kernel_parameters) / 2
spatial kernel matrices of type 'ring'
are computed.
The output of this function can be used with the function sbss
to avoid unnecessary computation of kernel matrices when sbss
is called multiple times with the same coordinate/kernel function setting. Additionally, the output can be used with the function local_covariance_matrix
to actually compute local covariance matrices as defined above based on a given set of spatial kernel matrices.
Value
spatial_kernel_matrix
returns a list with length of length(kernel_parameters)
(for 'ball'
and 'gauss'
kernel functions) or length(kernel_parameters) / 2
(for 'ring'
kernel function) containing numeric matrices of dimension c(n,n)
corresponding to the spatial kernel matrices.
References
Muehlmann, C., Filzmoser, P. and Nordhausen, K. (2021), Spatial Blind Source Separation in the Presence of a Drift, Submitted for publication. Preprint available at https://arxiv.org/abs/2108.13813.
Bachoc, F., Genton, M. G, Nordhausen, K., Ruiz-Gazen, A. and Virta, J. (2020), Spatial Blind Source Separation, Biometrika, 107, 627-646, doi:10.1093/biomet/asz079.
See Also
Examples
# simulate a set of coordinates
coords <- rnorm(100 * 2)
dim(coords) <- c(100, 2)
# computing two ring kernel matrices
kernel_params_ring <- c(0, 0.5, 0.5, 2)
ring_kernel_list <-
spatial_kernel_matrix(coords, 'ring', kernel_params_ring)
# computing three ball kernel matrices
kernel_params_ball <- c(0.5, 1, 2)
ball_kernel_list <-
spatial_kernel_matrix(coords, 'ball', kernel_params_ball)
# computing three gauss kernel matrices
kernel_params_gauss <- c(0.5, 1, 2)
gauss_kernel_list <-
spatial_kernel_matrix(coords, 'gauss', kernel_params_gauss)