\name{choose_spenv} \alias{choose_spenv} \title{Choose u and lambda for sparse envelope model.} \description{ Select the dimension of the envelope subspace using Bayesian information criterion, Akaike information criterion and Likelihood ratio testing. } \usage{ choose_spenv(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 and LRT. And the corresponding tuning parameter chosen for the dimension.} \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 Z. Su, G. Zhu and X. Chen(2015). Su Z, Zhu G, Chen X, Yang Y. Sparse envelope model: efficient estimation and response variable selection in multivariate linear regression. Biometrika. 2016 Sep 1;103(3):579-93. } \author{Zhihua Su and Guangyu Zhu\cr Maintainer: Guangyu Zhu \email{gzhu22@ufl.edu}} \examples{ ## Berkeley data(Berkeley) X= Berkeley$X Y2 = Berkeley$Y[,c(1,2,21,23)] choose_spenv(X,Y2) m1=spenv(X,Y2,1) }