spb | R Documentation |
Estimates components of cov(X) = A1 x A2 + B
where B
is banded
by d
. If bandwidth d
is not provided, it is estimated via
cross-validation.
CV can be either fit-based, i.e tailored to minimize mean squared estimation
error, or prediction-based, i.e. tailored to minimize the mean squared
prediction error. The fit-based CV is faster.
B
is considered stationary by default, this can be
changed by toggling stationary=F
.
spb( X, d = NULL, stationary = TRUE, mu = NULL, predict = FALSE, maxd = NULL, mind = NULL, Folds = NULL, perc = c(1/4, 1/4) )
X |
data array of size |
d |
the bandwidth, an integer between |
stationary |
a flag whether the banded part should be stationary,
defaults to |
mu |
matrix of size |
predict |
flag whether prediction-based cross-validation should be used, the default is fit-based cross-validation |
maxd |
integer, maximum bandwidth considered by CV, defaults to
|
mind |
minimum bandwidth considered by CV, defaults to zero |
Folds |
number of folds for cross-validation, defaults to 10 |
perc |
vector of 2, if |
a list of objects, depending on stationary
and d
:
A1
- matrix of size K1
x K1
, the temporal kernel
A2
- matrix of size K2
x K2
, the spatial kernel
B
- matrix of size d
x d
, i.e. the symbol of
the banded part, if stationary=T
. If stationary=F
, then
the value depends on d
: for d=1
it is a matrix of size
K1
x K2
representing location-wise variances, while for
d>1
a structure produced by banded_nonstat_est is returned
if cross-validation was conducted, the list contains also:
cv
- the CV objective values: a larger value is better for fit-based
CV and a smaller value is better for the prediction-based CV (when
predict=T
)
d
- the chosen bandwidth
N <- 100 K1 <- K2 <- 7 X <- array(rnorm(N*K1*K2),c(N,K1,K2)) A1 <- array(0,c(K1,K1)) A1[,1] <- 1 A1[,2] <- -3:3 A1 <- A1 %*% t(A1) A2 <- A1 <- mat_root(A1) for(n in 1:N){ X[n,,] <- A1 %*% X[n,,] %*% A2 + matrix(rnorm(K1*K2),K1) } # we have separable-plus-banded model, where B is stationary and d=1 Chat <- spb(X) Chat$d # estimated bandwidth by fit-based CV Chat <- spb(X,stationary=FALSE) # when we do not use stationarity Chat$d # estimated bandwidth by fit-based CV without stationarity
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.