\name{env} \alias{env} \title{Fit the envelope model.} \description{ This function fits the envelope model to the responses and predictors, using the maximum likelihood estimation. When the dimension of the envelope is between 1 and r-1, we implemented the algorithm in Cook et al. (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 = env(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{maxiter}{Maximum number of iterations. Default value: 100.} \item{ftol}{Tolerance parameter for F. Default value: 1e-2. } \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 responses. A nonnegative integer.} \item{u}{Dimension of the envelope. An integer between 0 and r.} \item{p}{The number of predictors. A positive integer.} \item{fit_time}{The time costs for fitting the envelope model.} } \references{ Cook, R. Dennis, Bing Li, and Francesca Chiaromonte. "Envelope models for parsimonious and efficient multivariate linear regression." \emph{Statist. Sinica} 20 (2010): 927-1010. The codes are implemented based on the algorithm in Cook, R. D., Forzani, L. and Su, Z. (2016), A Note on Fast Envelope Estimation. \emph{Journal of Multivariate Analysis.} 150, 42-54. } \author{Zhihua Su\cr Maintainer: Guangyu Zhu \email{gzhu22@ufl.edu}} \seealso{\code{choose_env} for choosing the dimension of envelope subspace.}