# Sliced inverse regression

Sliced inverse regression (SIR) is a tool for dimensionality reduction in the field of multivariate statistics.
In statistics, regression analysis is a method of studying the relationship between a response variable y and its input variable ${\underline {x}}$, which is a p-dimensional vector. There are several approaches in the category of regression. For example, parametric methods include multiple linear regression, and non-parametric methods include local smoothing.
As the number of observations needed to use local smoothing methods scales exponentially with high-dimensional data (as p grows), reducing the number of dimensions can make the operation computable. Dimensionality reduction aims to achieve this by showing only the most important dimension of the data. SIR uses the inverse regression curve, $E({\underline {x}}\,|\,y)$, to perform a weighted principal component analysis.

## Model

Given a response variable $\,Y$ and a (random) vector $X\in \mathbb {R} ^{p}$ of explanatory variables, SIR is based on the model
    $Y=f(\beta _{1}^{\top }X,\ldots ,\beta _{k}^{\top }X,\varepsilon )\quad \quad \quad \quad \quad (1)$
where $\beta _{1},\ldots ,\beta _{k}$ are unknown projection vectors, $\,k$ is an unknown number smaller than $\,p$, $\;f$ is an unknown function on $\mathbb {R} ^{k+1}$as it only depends on$\,k$ arguments, and $\varepsilon$ is a random variable representing error with $E[\varepsilon |X]=0$ and a finite variance of $\sigma ^{2}$. The model describes an ideal solution, where $\,Y$ depends on $X\in \mathbb {R} ^{p}$ only through a$\,k$ dimensional subspace; i.e., one can reduce the dimension of the explanatory variables from$\,p$ to a smaller number$\,k$ without losing any information.
An equivalent version of $\,(1)$ is: the conditional distribution of $\,Y$ given $\,X$ depends on $\,X$ only through the $\,k$ dimensional random vector $(\beta _{1}^{\top }X,\ldots ,\beta _{k}^{\top }X)$. It is assumed that this reduced vector is as informative as the original $\,X$ in explaining $\,Y$.
The unknown $\,\beta _{i}'s$ are called the effective dimension reducing directions (EDR-directions). The space that is spanned by these vectors is denoted by the effective dimension reducing space (EDR-space).

## Relevant linear algebra background

Given ${\underline {a}}_{1},\ldots ,{\underline {a}}_{r}\in \mathbb {R} ^{n}$, then $V:=L({\underline {a}}_{1},\ldots ,{\underline {a}}_{r})$, the set of all linear combinations of these vectors is called a linear subspace and is therefore a vector space. The equation says that vectors ${\underline {a}}_{1},\ldots ,{\underline {a}}_{r}$ span $\,V$, but the vectors that span space $\,V$ are not unique.
The dimension of $\,V(\in \mathbb {R} ^{n})$ is equal to the maximum number of linearly independent vectors in $\,V$. A set of $\,n$ linear independent vectors of $\mathbb {R} ^{n}$ makes up a basis of $\mathbb {R} ^{n}$. The dimension of a vector space is unique, but the basis itself is not. Several bases can span the same space. Dependent vectors can still span a space, but the linear combinations of the latter are only suitable to a set of vectors lying on a straight line.

## Inverse regression

Computing the inverse regression curve (IR) means instead of looking for
* $\,E[Y|X=x]$, which is a curve in $\mathbb {R} ^{p}$
it is actually
* $\,E[X|Y=y]$, which is also a curve in $\mathbb {R} ^{p}$, but consisting of $\,p$ one-dimensional regressions.
The center of the inverse regression curve is located at $\,E[E[X|Y]]=E[X]$. Therefore, the centered inverse regression curve is
* $\,E[X|Y=y]-E[X]$
which is a $\,p$ dimensional curve in $\mathbb {R} ^{p}$.

## Inverse regression versus dimension reduction

The centered inverse regression curve lies on a $\,k$-dimensional subspace spanned by $\,\Sigma _{xx}\beta _{i}\,'s$. This is a connection between the model and inverse regression.
Given this condition and $\,(1)$, the centered inverse regression curve $\,E[X|Y=y]-E[X]$ is contained in the linear subspace spanned by $\,\Sigma _{xx}\beta _{k}(k=1,\ldots ,K)$, where $\,\Sigma _{xx}=Cov(X)$.

## Estimation of the EDR-directions

After having had a look at all the theoretical properties, the aim now is to estimate the EDR-directions. For that purpose, weighted principal component analyses are needed. If the sample means $\,{\hat {m}}_{h}\,'s$, $\,X$ would have been standardized to $\,Z=\Sigma _{xx}^{-1/2}\{X-E(X)\}$. Corresponding to the theorem above, the IR-curve $\,m_{1}(y)=E[Z|Y=y]$ lies in the space spanned by $\,(\eta _{1},\ldots ,\eta _{k})$, where $\,\eta _{i}=\Sigma _{xx}^{1/2}\beta _{i}$. As a consequence, the covariance matrix $\,cov[E[Z|Y]]$ is degenerate in any direction orthogonal to the $\,\eta _{i}\,'s$. Therefore, the eigenvectors $\,\eta _{k}(k=1,\ldots ,K)$ associated with the largest$\,K$ eigenvalues are the standardized EDR-directions.

## Algorithm

The algorithm to estimate the EDR-directions via SIR is as follows.
1. Let $\,\Sigma _{xx}$ be the covariance matrix of $\,X$. Standardize $\,X$ to
    $\,Z=\Sigma _{xx}^{-1/2}\{X-E(X)\}$
($\,(1)$ can also be rewritten as
    $Y=f(\eta _{1}^{\top }Z,\ldots ,\eta _{k}^{\top }Z,\varepsilon )$
where $\,\eta _{k}=\beta _{k}\Sigma _{xx}^{1/2}\quad \forall \;k$.)
2. Divide the range of $\,y_{i}$ into $\,S$ non-overlapping slices $\,H_{s}(s=1,\ldots ,S).\;n_{s}$ is the number of observations within each slice and $\,I_{H_{s}}$ is the indicator function for the slice:
    $n_{s}=\sum _{i=1}^{n}I_{H_{s}}(y_{i})$
3. Compute the mean of $\,z_{i}$ over all slices, which is a crude estimate $\,{\hat {m}}_{1}$ of the inverse regression curve $\,m_{1}$:
    $\,{\bar {z}}_{s}=n_{s}^{-1}\sum _{i=1}^{n}z_{i}I_{H_{s}}(y_{i})$
4. Calculate the estimate for $\,Cov\{m_{1}(y)\}$:
    $\,{\hat {V}}=n^{-1}\sum _{i=1}^{S}n_{s}{\bar {z}}_{s}{\bar {z}}_{s}^{\top }$
5. Identify the eigenvalues $\,{\hat {\lambda }}_{i}$ and the eigenvectors $\,{\hat {\eta }}_{i}$ of $\,{\hat {V}}$, which are the standardized EDR-directions.
6. Transform the standardized EDR-directions back to the original scale. The estimates for the EDR-directions are given by:
    $\,{\hat {\beta }}_{i}={\hat {\Sigma }}_{xx}^{-1/2}{\hat {\eta }}_{i}$
(which are not necessarily orthogonal)