tSIR: SIR for Tensor-Valued Observations

Description Usage Arguments Details Value Author(s) Examples

View source: R/tSIR.R

Description

Computes the tensorial SIR.

Usage

1
  tSIR(x, y, h = 10, ...)

Arguments

x

Numeric array of an order at least three. It is assumed that the last dimension corresponds to the sampling units.

y

A numeric or factor response vector.

h

The number of slices. If y is a factor the number of factor levels is automatically used as the number of slices.

...

Arguments passed on to quantile.

Details

Computes the mode-wise sliced inverse regression (SIR) estimators for a tensor-valued data set and a univariate response variable.

Value

A list with class 'tbss', inheriting from class 'bss', containing the following components:

S

Array of the same size as x containing the predictors.

W

List containing all the unmixing matrices.

Xmu

The data location.

datatype

Character string with value "iid". Relevant for plot.tbss.

Author(s)

Joni Virta, Klaus Nordhausen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(zip.train)
x <- zip.train

rows <- which(x[, 1] == 0 | x[, 1] == 3)
x0 <- x[rows, 2:257]
y0 <- as.factor(x[rows, 1])

x0 <- t(x0)
dim(x0) <- c(16, 16, length(y0))


res <- tSIR(x0, y0)
plot(res$S[1, 1, ], res$S[1, 2, ], col = y0)

tensorBSS documentation built on June 2, 2021, 9:08 a.m.