\name{spenv} \alias{spenv} \title{Fit the sparse envelope model.} \description{ This function fits the sparese envelope model to the responses using the maximum likelihood estimation. When the dimension of the envelope is between 1 and r-1, we implemented the algorithm in Su Z, Zhu G, Chen X and Yang Y (2016). When the dimension is r, then the envelope model degenerates to the standard multivariate linear regression. When the dimension is 0, it means that X and Y are uncorrelated, and the fitting is different. } \usage{ ModelOutput = spenv(X, Y, u) } \arguments{ \item{X}{Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous.} \item{Y}{Multivariate responses. An n by r matrix, r is the number of responses and n is number of observations. The responses must be continuous variables.} \item{u}{Dimension of the envelope. An integer between 0 and r.} \item{lambda1}{A user supplied lambda sequence for first stage.} \item{lambda2}{A user supplied lambda sequence for second stage.} \item{maxiter}{Maximum number of iterations. Default value: 100.} \item{ftol}{Tolerance parameter for F. Default value: 1e-4. } \item{init}{The initial value for the envelope subspace. An r by u matrix. Default value is the one generated by function initial_value.} \item{verbose}{Flag for print out model fitting process, logical 0 or 1. Default value: 0.} } %\details{} \value{ \item{alpha}{The estimated intercept in the envelope model. An r by 1 vector.} \item{beta}{The envelope estimator of the regression coefficients. An r by p matrix.} \item{Gamma}{The orthogonal basis of the envelope subspace. An r by u semi-orthogonal matrix.} \item{Gamma0}{The orthogonal basis of the complement of the envelope subspace. An r by r-u semi-orthogonal matrix.} \item{eta}{The coordinates of beta with respect to Gamma. A u by p matrix.} \item{Sigma}{The envelope estimator of the error covariance matrix. An r by r matrix.} \item{Omega}{The coordinates of Sigma with respect to Gamma. A u by u matrix.} \item{Omega0}{The coordinates of Sigma with respect to Gamma0. An r-u by r-u matrix.} \item{loglik}{The maximized log likelihood function. A real number.} \item{paramNum}{The number of parameters in the envelope model. A positive integer.} \item{sigRes}{The sample error covariance matrix. A r by r matrix.} \item{sigY}{The sample response covariance matrix. A r by r matrix.} \item{sigX}{The sample predictor covariance matrix. A p by p matrix.} \item{n}{The number of observations in the data. A positive integer.} \item{r}{The number of response. A nonnegative integer.} \item{u}{Dimension of the envelope. An integer between 0 and r.} \item{p}{The number of predictor. A positive integer.} \item{q}{The number of active responses. A positive integer.} \item{where_1}{The active responses chosen by the sparse envelope model.} \item{where_0}{The inactive responses chosen by the sparse envelope model.} \item{lambda}{The tuning parameters choosed by BIC.} \item{BIC_seq1}{The sequence of BIC in the first stage.} \item{BIC_seq2}{The sequence of BIC in the second stage.} \item{fit_time}{The time costs for fitting the sparse envelope model.} } \references{ The codes are implemented based on the algorithm in Su, Z., Zhu, G., Chen, X. and Yang, Y. (2016), Sparse Envelope Model: Efficient Estimation and Response Variable Selection in Multivariate Linear Regression. \emph{Biometrika}. 103, 579-593. } \author{Zhihua Su\cr Maintainer: Guangyu Zhu \email{gzhu22@ufl.edu}} \seealso{\code{choose_spenv} for choosing the dimension of envelope subspace and the tuning parameter.} \examples{ ## Berkeley data(Berkeley) X= Berkeley$X Y2 = Berkeley$Y[,c(1,2,21,23)] m1=spenv(X,Y2,1) asym.spenv(m1) } \keyword{models} \keyword{regression}