Learn R Programming

SpatPCA (version 1.3.5)

spatpcaCVWithSelectedK: Internal function: M-fold CV of SpatPCA with selected K

Description

Internal function: M-fold CV of SpatPCA with selected K

Usage

spatpcaCVWithSelectedK(
  x,
  Y,
  M,
  tau1,
  tau2,
  gamma,
  shuffle_split,
  maxit,
  thr,
  l2
)

Value

A list of objects including

cv_result

A list of resultant objects produced by spatpcaCV

selected_K

Selected K based on CV.

Arguments

x

Location matrix

Y

Data matrix

M

The number of folds for cross validation; default is 5.

tau1

Vector of a non-negative smoothness parameter sequence. If NULL, 10 tau1 values in a range are used.

tau2

Vector of a non-negative sparseness parameter sequence. If NULL, none of tau2 is used.

gamma

Vector of a non-negative hyper parameter sequence for tuning eigenvalues. If NULL, 10 values in a range are used.

shuffle_split

Vector of indices for random splitting Y into training and test sets

maxit

Maximum number of iterations. Default value is 100.

thr

Threshold for convergence. Default value is \(10^{-4}\).

l2

Vector of a non-negative tuning parameter sequence for ADMM use