scd | R Documentation |
Performs the power iteration method to find the separable expansion for
C = cov(X)
, i.e. to find the decomposition C = sigma1 A1
x
B1
+ sigma2 A2
x B2
+ ... + sigmaR AR
x
BR
. When the degree-of-separability R
is not provided,
cross-validation (CV) is performed.
scd( X, R = NULL, B = NULL, mu = NULL, predict = FALSE, maxiter = 10, maxR = NULL, Folds = NULL, perc = c(1/4, 1/4) )
X |
data array of size |
R |
integer, the degree-of-separability |
B |
array of size |
mu |
matrix of size |
predict |
flag whether prediction-based cross-validation should be used, the default is fit-based cross-validation |
maxiter |
integer, maximum number of power iterations, defaults to 10 |
maxR |
integer, maximum value of the degree-of-separability |
Folds |
number of folds for cross-validation, defaults to 10 |
perc |
vector of 2, if |
list of the following objects:list of 3:
A
- array of size R
x K1
x K1
, the first
R
temporal kernels;
B
- array of size R
x K2
x K2
, the first
R
spatial kernels;
sigma
- vector of length R
, the separable component scores
if cross-validation was conducted, the list contains also:
cv
- the CV objective values, a smaller value is better
R
- the chosen bandwidth
N <- 10 K1 <- K2 <- 10 x <- 1:K1/(K1+1) e0 <- rep(1,K1) e1 <- sin(2*pi*x) e2 <- cos(2*pi*x) X <- array(0,c(N,K1,K2)) set.seed(123) for(n in 1:N){ X[n,,] <- 2*rnorm(1)*outer(e0,e0) + rnorm(1)*outer(e1,e1) + rnorm(1)*outer(e2,e2) } SCD <- scd(X) SCD$R # the degree-of-separability chosen by fit-based CV SCD <- scd(X,predict=TRUE) SCD$R # the degree-of-separability leading to best predictions SCD <- scd(X,predict=TRUE,perc=1) SCD$R # the degree-of-separability leading to best one-step-ahead (both in # space and time) predictions
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.