Description Usage Arguments Value Author(s) References See Also Examples
MSIR estimates a set of d ≤ p orthogonal direction vectors of length p which are estimates of the basis of the dimensional reduction subspace.
1 2 |
object |
an object of class |
dim |
the dimensions of the reduced subspace used for prediction. |
newdata |
a data frame or matrix giving the data. If missing the data obtained from the call to |
... |
further arguments passed to or from other methods. |
The function returns a matrix of points projected on the subspace spanned by the estimated basis vectors.
Luca Scrucca luca.scrucca@unipg.it
Scrucca, L. (2011) Model-based SIR for dimension reduction. Computational Statistics & Data Analysis, 55(11), 3010-3026.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | n <- 200
p <- 5
b <- as.matrix(c(1,-1,rep(0,p-2)))
x <- matrix(rnorm(n*p), nrow = n, ncol = p)
y <- exp(0.5 * x%*%b) + 0.1*rnorm(n)
pairs(cbind(y,x), gap = 0)
MSIR <- msir(x, y)
summary(MSIR)
plot(MSIR, which = 1, type = "2Dplot")
all.equal(predict(MSIR), MSIR$dir)
predict(MSIR, dim = 1:2)
x0 <- matrix(rnorm(n*p), nrow = n, ncol = p)
y0 <- exp(0.5 * x0%*%b) + 0.1*rnorm(n)
plot(predict(MSIR, dim = 1, newdata = x0), y0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.