SpatialPCA_EstimateLoading: Calculate loading matrix.

View source: R/SpatialPCA_EstimateLoading.R

SpatialPCA_EstimateLoadingR Documentation

Calculate loading matrix.

Description

Calculate loading matrix.

Usage

SpatialPCA_EstimateLoading(
  object,
  maxiter = 300,
  initial_tau = 1,
  fast = FALSE,
  eigenvecnum = NULL,
  SpatialPCnum = 20
)

Arguments

object

SpatialPCA object.

maxiter

Maximum iteration number. Default is 300.

initial_tau

Initial value of tau. Default is 1. Because we need tau to be positive, we calculate exp(log(tau)) during iterations.

fast

Select "TRUE" if the user wants to use low-rank approximation on the kernel matrix to accelerate the algorithm, otherwise select "FALSE".

eigenvecnum

When fast=TRUE, eigenvecnum is the number of top eigenvectors and eigenvalues to be used in low-rank approximation in the eigen decomposition step for kernel matrix. The default is NULL, if specified, it is recommended to use eigenvecnum=20 when sample size is large (e.g. >5,000). When sample size is small, eigenvecnum is suggested to explain at least 90% variance.

SpatialPCnum

Number of spatial PCs.

Value

Returns SpatialPCA object with estimated loading matrix W.


shangll123/SpatialPCA documentation built on April 17, 2024, 3:15 a.m.