Learn R Programming

tensorBSS (version 0.3.9)

tSIR: SIR for Tensor-Valued Observations

Description

Computes the tensorial SIR.

Usage

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

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.

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.

Author

Joni Virta, Klaus Nordhausen

Details

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

Examples

Run this code
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)

Run the code above in your browser using DataLab