Package 'BSSoverSpace'

Title: Blind Source Separation for Multivariate Spatial Data using Eigen Analysis
Description: Provides functions for blind source separation over multivariate spatial data, and useful statistics for evaluating performance of estimation on mixing matrix. 'BSSoverSpace' is based on an eigen analysis of a positive definite matrix defined in terms of multiple normalized spatial local covariance matrices, and thus can handle moderately high-dimensional random fields. This package is an implementation of the method described in Zhang, Hao and Yao (2022)<arXiv:2201.02023>.
Authors: Sixing Hao [aut, cre]
Maintainer: Sixing Hao <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2024-10-31 06:49:30 UTC
Source: CRAN

Help Index


Blind Source Separation Over Space

Description

BSSS estimates the mixing matrix of blind source separation model for multivariate spatial data.

Usage

BSSS(x, coord, kernel_type, kernel_parameter, kernel_list = NULL)

Arguments

x

A numeric matrix of dimension c(n, p), where the p columns correspond to the entries of the random field and the n rows are the observations.

coord

A numeric matrix of dimension c(n,2) where each row represents the coordinates of a point in the spatial domain. Only needed if the argument kernel_list is NULL.

kernel_type

A string indicating which kernel function to use. Either 'ring', 'ball' or 'gauss'.

kernel_parameter

A numeric vector that gives the parameters for the kernel function. At least length of one for 'ball' and 'gauss' or two for 'ring' kernel.

kernel_list

List of spatial kernel matrices with dimension c(n,n). Can be computed by the function spatial_kernel_matrix.

Details

BSSS estimates the mixing matrix by combining the information of all local covariance matrices together and conduct eigenanalysis.

Value

BSSS returns a list, including the estimation of maxing matrix, the estimated latent field, and eigenvalues of matrix W for validating the estimation. Larger gaps among first few eigenvalues of matrix W strengthens the validity of estimation. See Zhang, Hao and Yao (2022) <arXiv:2201.02023> for details.

Examples

sample_size <- 500
coords <- runif(sample_size * 2) * 50
dim(coords) <- c(sample_size, 2)
dim <- 5 # specify the dimensionality of random variable
nu <- runif(dim, 0, 6) # parameter for matern covariance function
kappa <- runif(dim, 0, 2) # parameter for matern covariance function
zs <- gen_matern_gaussian_rf(coords=coords, dim=dim, nu=nu, kappa=kappa)
mix_mat <- diag(dim) # create a diagonal matrix as the mixing matrix
xs <- t(mix_mat %*% t(zs))
example <- BSSS(xs, coords, 'ring', c(0,0.5,0.5,1,1,8))
d_score(example$mix_mat_est, mix_mat)

d score

Description

d score measures the similarity of two square matrix with same dimension. d_score equals 0 if the estimator is a column permutation of true value.

Usage

d_score(estimator, true_value)

Arguments

estimator

A square matrix, usually an estimator of the true_value matrix.

true_value

A square matrix, which the estimator is compared to.

Value

A numeric value in [0,1].

Examples

d_score(diag(3), diag(3))

Generating Gaussian random fields with Matern covariance function

Description

Generate Gaussian random fields with Matern covariance function

Usage

gen_matern_gaussian_rf(coords, dim, nu, kappa)

Arguments

coords

coordinate of target randon field to be generated

dim

dimension of target randon field to be generated

nu

parameter of matern covariance function

kappa

parameter of matern covariance function

Value

A data matrix with number of rows equal to 'coords', and number of columns equal to 'dim'.