\name{choose_env} \alias{choose_env} \title{Choose u for envelope model.} \description{ Select the dimension of the envelope subspace using Bayesian information criterion, Akaike information criterion and Likelihood ratio testing. } \usage{ choose_env(X, Y) } \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{dims}{A vector. The dimensions to be chosen from. The default is 0 to r.} \item{maxiter}{Maximum number of iterations. Default value: 100.} \item{ftol}{Tolerance parameter for F. Default value: 1e-2. } \item{verbose}{Flag for print out model fitting process, logical 0 or 1. Default value: 0.} } \value{ \item{result}{Dimensions of the envelope subspace chosen by BIC, AIC ,LRT(0.05) and LRT(0.01).} \item{detail}{-2*Loglik, BIC, AIC, degree of freedom and p-values for LRT test.} } \references{ The codes are implemented based on the algorithm in Section 4.3 of Cook et al (2010). Cook, R. Dennis, Bing Li, and Francesca Chiaromonte. "Envelope models for parsimonious and efficient multivariate linear regression." \emph{Statist. Sinica} 20 (2010): 927-1010. } \author{Guangyu Zhu and Zhihua Su\cr Maintainer: Guangyu Zhu \email{gzhu22@ufl.edu}} \examples{ # wheatprotein data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] choose_env(X,Y) m1 = env(X,Y,1) m1$beta }