Title: | Computing Envelope Estimators |
---|---|
Description: | Provides a general routine, envMU, which allows estimation of the M envelope of span(U) given root n consistent estimators of M and U. The routine envMU does not presume a model. This package implements response envelopes, partial response envelopes, envelopes in the predictor space, heteroscedastic envelopes, simultaneous envelopes, scaled response envelopes, scaled envelopes in the predictor space, groupwise envelopes, weighted envelopes, envelopes in logistic regression, envelopes in Poisson regression envelopes in function-on-function linear regression, envelope-based Partial Partial Least Squares, envelopes with non-constant error covariance, envelopes with t-distributed errors, reduced rank envelopes and reduced rank envelopes with non-constant error covariance. For each of these model-based routines the package provides inference tools including bootstrap, cross validation, estimation and prediction, hypothesis testing on coefficients are included except for weighted envelopes. Tools for selection of dimension include AIC, BIC and likelihood ratio testing. Background is available at Cook, R. D., Forzani, L. and Su, Z. (2016) <doi:10.1016/j.jmva.2016.05.006>. Optimization is based on a clockwise coordinate descent algorithm. |
Authors: | Minji Lee, Zhihua Su |
Maintainer: | Minji Lee <[email protected]> |
License: | GPL-2 |
Version: | 3.4.5 |
Built: | 2024-12-18 06:55:13 UTC |
Source: | CRAN |
This package contains functions for estimating envelope models including response envelopes, partial response envelopes, envelopes in the predictor space, heteroscedastic envelopes, simultaneous envelopes, scaled response envelopes, scaled envelopes in the predictor space, groupwise envelopes, weighted envelopes, envelopes in logistic regression, envelopes in poisson regression, envelopes in function-on-function linear regression, envelope-based Partial Partial Least Squares, envelopes with non-constant error covariance, envelopes with t-distributed errors, reduced rank envelopes and reduced rank envelopes with non-constant error covariance.
Package: | Renvlp |
Type: | Package |
Version: | 3.4.5 |
Date: | 2023-09-11 |
License: | GPL-2 |
Imports: | Rsolnp, orthogonalsplinebasis, pls, matrixcalc, Matrix |
Suggests: | Mass, stats |
Minji Lee and Zhihua Su.
Maintainer: Minji Lee <[email protected]>
Cook, R. D., Forzani, L. and Su, Z. (2016) A Note on Fast Envelope Estimation. Journal of Multivariate Analysis. 150, 42-54.
Cook, R. D., Li, B. and Chiaromente, F. (2010). Envelope Models for Parsimonious and Efficient Multivariate Linear Regression (with discussion). Statist. Sinica 20, 927- 1010.
Su, Z. and Cook, R.D. (2011). Partial envelopes for efficient estimation in multivariate linear regression. Biometrika 98, 133 - 146.
Cook, R. D., Helland, I. S. and Su, Z. (2013). Envelopes and Partial Least Squares Re- gression. Journal of the Royal Statistical Society: Series B 75, 851 - 877.
Su, Z. and Cook, R.D. (2013). Estimation of Multivariate Means with Heteroscedastic Error Using Envelope Models. Statistica Sinica, 23, 213-230.
Cook, R. D., Zhang, X. (2015). Simultaneous Envelopes for Multivariate Linear Regression. Technometrics 57, 11 - 25.
Cook, R. D., Su, Z. (2013). Scaled Envelopes: scale Invariant and Efficient Estimation in Multivariate Linear Regression. Biometrika 100, 939 - 954.
Cook, R. D., Su, Z. (2016). Scaled Predictor Envelopes and Partial Least Squares Regression. Technometrics 58, 155 - 165.
Park, Y., Su, Z. and Zhu, H. (2017) Groupwise envelope models for Imaging Genetic Analysis. Biometrics.
Eck, D. J. and Cook, R. D. (2017). Weighted Envelope Estimation to Handle Variability in Model Selection. Biometrika.
Cook, R. D., Zhang, X. (2015). Foundations for Envelope Models and Methods. Journal of the American Statistical Association 110, 599 - 611.
Su, Z., Li, B. and Cook, R. D. (2022+) Envelope model for function-on-function linear regression.
Park, Y., Su, Z. and Chung, D. (2022+) Envelope-based Partial Partial Least Squares with Application to Cytokine-based Biomarker Analysis for COVID-19. Statistics in Medicine.
Cook, R. D., Forzani, L. and Zhang, X. (2015). Envelopes and reduced-rank regression. Biometrika 102, 439-456.
Forzani, L. and Su, Z. (2021). Envelopes for elliptical multivariate linear regression. Statist. Sinica 31, 301-332.
Patients who were admitted to the hospital after an amitriptyline overdose.
data("amitriptyline")
data("amitriptyline")
A data frame with 17 observations on the following 7 variables.
tot
Total TCAD plasma level.
ami
Amount of amitriptyline present in TCAD plasma level.
gen
Gender:1 if female, 0 if male.
amt
Amount of antidepressants taken at time of overdose.
pr
PR wave measurement.
diap
Diastolic blood pressure.
qrs
QRS wave measurement.
This data set contains measures of side effects of amitriptyline and gender information.
Johnson, R.A., Wichern, D.W. (2007). Applied Multivariage Statistical Analysis, 6th edition.
Heights of children born in Berkeley
data("Berkeley")
data("Berkeley")
A data frame with 93 observations on the following 32 variables.
V1
Sex.
V2
Age 1.
V3
Age 1.25.
V4
Age 1.5.
V5
Age 1.75.
V6
Age 2.
V7
Age 3.
V8
Age 4.
V9
Age 5.
V10
Age 6.
V11
Age 7.
V12
Age 8.
V13
Age 8.5.
V14
Age 9.
V15
Age 9.5.
V16
Age 10.
V17
Age 10.5.
V18
Age 11.
V19
Age 11.5.
V20
Age 12.
V21
Age 12.5.
V22
Age 13.
V23
Age 13.5.
V24
Age 14.
V25
Age 14.5.
V26
Age 15.
V27
Age 15.5.
V28
Age 16.
V29
Age 16.5.
V30
Age 17.
V31
Age 17.5.
V32
Age 18.
This data set contains measurements of heights of children born in 1928-29 in Berkeley, CA.
Tuddenham, R. D. and Snyder, M. M. (1954). Physical growth of California boys and girls from birth to eighteen years. Publications in child developments. University of California, Berkeley, 1(2), 183-364.
Compute bootstrap standard error for the response envelope estimator.
boot.env(X, Y, u, B)
boot.env(X, Y, u, B)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the regression coefficients in the envelope model by bootstrapping the residuals.
The output is an r by p matrix.
bootse |
The standard error for elements in beta computed by bootstrap. |
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] u <- u.env(X, Y) u B <- 100 bootse <- boot.env(X, Y, 1, B) bootse
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] u <- u.env(X, Y) u B <- 100 bootse <- boot.env(X, Y, 1, B) bootse
Compute bootstrap standard error for the response envelope estimator that accommodates nonconstant variance.
boot.env.apweights(X, Y, u, B)
boot.env.apweights(X, Y, u, B)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the regression coefficients in the envelope model with nonconstant variance by bootstrapping the residuals.
The output is an r by p matrix.
bootse |
The standard error for elements in beta computed by bootstrap. |
data(concrete) X <- concrete[, 1:7] Y <- concrete[, 8:10] ## Not run: u <- u.env.apweights(X, Y) ## Not run: u B <- 100 ## Not run: bootse <- boot.env.apweights(X, Y, 1, B) ## Not run: bootse
data(concrete) X <- concrete[, 1:7] Y <- concrete[, 8:10] ## Not run: u <- u.env.apweights(X, Y) ## Not run: u B <- 100 ## Not run: bootse <- boot.env.apweights(X, Y, 1, B) ## Not run: bootse
Compute bootstrap standard error for the response envelope estimator with t-distributed errors.
boot.env.tcond(X, Y, u, df, B)
boot.env.tcond(X, Y, u, df, B)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
df |
Degrees of freedom of the t-distribution. A positive number that is greater than 2. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the regression coefficients in the envelope model with t-distributed errors by bootstrapping the residuals.
The output is an r by p matrix.
bootse |
The standard error for elements in beta computed by bootstrap. |
data(concrete) X <- concrete[1:78, 1:7] # The first 78 observations are training data Y <- concrete[1:78, 8:10] ## Not run: u <- u.env.tcond(X, Y, 6) ## Not run: u B <- 100 ## Not run: bootse <- boot.env.tcond(X, Y, 2, 6, B) ## Not run: bootse
data(concrete) X <- concrete[1:78, 1:7] # The first 78 observations are training data Y <- concrete[1:78, 8:10] ## Not run: u <- u.env.tcond(X, Y, 6) ## Not run: u B <- 100 ## Not run: bootse <- boot.env.tcond(X, Y, 2, 6, B) ## Not run: bootse
Compute bootstrap standard error for the Envelope-based Partial Partial Least Squares estimator.
boot.eppls(X1, X2, Y, u, B)
boot.eppls(X1, X2, Y, u, B)
X1 |
An |
X2 |
An |
Y |
An |
u |
A given dimension of the Envelope-based Partial Partial Least Squares. It should be an interger between |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the regression coefficients beta1 and beta2 in the Envelope-based Partial Partial Least Squares by bootstrapping the residuals.
The output is a list that contains the following components:
bootse1 |
The standard error for elements in beta1 computed by bootstrap. The output is an p1 by r matrix. |
bootse1 |
The standard error for elements in beta2 computed by bootstrap. The output is an p2 by r matrix. |
data(amitriptyline) Y <- amitriptyline[ , 1:2] X1 <- amitriptyline[ , 4:7] X2 <- amitriptyline[ , 3] B <- 100 ## Not run: bootse <- boot.eppls(X1, X2, Y, 2, B) ## Not run: bootse
data(amitriptyline) Y <- amitriptyline[ , 1:2] X1 <- amitriptyline[ , 4:7] X2 <- amitriptyline[ , 3] B <- 100 ## Not run: bootse <- boot.eppls(X1, X2, Y, 2, B) ## Not run: bootse
Compute bootstrap standard error for the groupwise envelope.
boot.genv(X, Y, Z, u, B)
boot.genv(X, Y, Z, u, B)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
Z |
A group indicator vector of length |
u |
Dimension of the groupwise envelope. An integer between 0 and r. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the regression coefficients in the groupwise envelope model by bootstrapping the residuals.
The output is an p by r matrix.
bootse |
The standard error for elements in beta computed by bootstrap. |
data(fiberpaper) X <- fiberpaper[ , c(5, 7)] Y <- fiberpaper[ , 1:3] Z <- as.numeric(fiberpaper[ , 6] > mean(fiberpaper[ , 6])) ## Not run: B <- 100 ## Not run: res <- boot.genv(X, Y, Z, 2, B) ## Not run: res$bootse[[1]] ## Not run: res$bootse[[2]]
data(fiberpaper) X <- fiberpaper[ , c(5, 7)] Y <- fiberpaper[ , 1:3] Z <- as.numeric(fiberpaper[ , 6] > mean(fiberpaper[ , 6])) ## Not run: B <- 100 ## Not run: res <- boot.genv(X, Y, Z, 2, B) ## Not run: res$bootse[[1]] ## Not run: res$bootse[[2]]
Compute bootstrap standard error for the heteroscedastic envelope.
boot.henv(X, Y, u, B)
boot.henv(X, Y, u, B)
X |
A group indicator vector of length |
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. |
u |
Dimension of the heteroscedastic envelope. An integer between 0 and r. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the regression coefficients in the heteroscedastic envelope model by bootstrapping the residuals.
The output is an r by p matrix.
bootse |
The standard error for elements in beta computed by bootstrap. |
data(waterstrider) X <- waterstrider[ , 1] Y <- waterstrider[ , 2:5] B <- 100 ## Not run: res <- boot.henv(X, Y, 2, B) ## Not run: res
data(waterstrider) X <- waterstrider[ , 1] Y <- waterstrider[ , 2:5] B <- 100 ## Not run: res <- boot.henv(X, Y, 2, B) ## Not run: res
Compute bootstrap standard error for the envelope estimator in logistic regression.
boot.logit.env(X, Y, u, B)
boot.logit.env(X, Y, u, B)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Response. An n by 1 matrix. The univariate response must be binary. |
u |
Dimension of the envelope. An integer between 0 and p. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the coefficients in the logistic regression envelope by the paired bootstrap.
The output is a p by 1 matrix.
bootse |
The standard error for elements in beta computed by bootstrap. |
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- as.numeric(ifelse(horseshoecrab[ , 4] > 0, 1, 0)) B <- 100 ## Not run: bootse <- boot.logit.env(X, Y, 1, B) ## Not run: bootse
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- as.numeric(ifelse(horseshoecrab[ , 4] > 0, 1, 0)) B <- 100 ## Not run: bootse <- boot.logit.env(X, Y, 1, B) ## Not run: bootse
Compute bootstrap standard error for the partial envelope estimator.
boot.penv(X1, X2, Y, u, B)
boot.penv(X1, X2, Y, u, B)
X1 |
Predictors of main interest. An n by p1 matrix, n is the number of observations, and p1 is the number of main predictors. The predictors can be univariate or multivariate, discrete or continuous. |
X2 |
Covariates, or predictors not of main interest. An n by p2 matrix, p2 is the number of covariates. |
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. |
u |
Dimension of the partial envelope. An integer between 0 and r. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the regression coefficients beta1 in the partial envelope model by bootstrapping the residuals.
The output is an r by p1 matrix.
bootse |
The standard error for elements in beta1 computed by bootstrap. |
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] B <- 100 ## Not run: bootse <- boot.penv(X1, X2, Y, 1, B) ## Not run: bootse
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] B <- 100 ## Not run: bootse <- boot.penv(X1, X2, Y, 1, B) ## Not run: bootse
Compute bootstrap standard error for the envelope estimator in poisson regression.
boot.pois.env(X, Y, u, B)
boot.pois.env(X, Y, u, B)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Response. An n by 1 matrix. The univariate response must be counts. |
u |
Dimension of the envelope. An integer between 0 and p. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the coefficients in the poisson regression envelope by the paired bootstrap.
The output is a p by 1 matrix.
bootse |
The standard error for elements in beta computed by bootstrap. |
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- horseshoecrab[ , 4] B <- 100 ## Not run: bootse <- boot.pois.env(X, Y, 1, B) ## Not run: bootse
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- horseshoecrab[ , 4] B <- 100 ## Not run: bootse <- boot.pois.env(X, Y, 1, B) ## Not run: bootse
Compute bootstrap standard error for the reduced rank envelope estimator.
boot.rrenv(X, Y, u, d, B)
boot.rrenv(X, Y, u, d, B)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
d |
The rank of the coefficient matrix. An integer between 0 and u. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the regression coefficients in the reduced rank envelope model.
The output is an r by p matrix.
bootse |
The standard error for elements in beta computed by bootstrap. |
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here B <- 100 ## Not run: bootse <- boot.rrenv(X, Y, 4, 2, B) ## Not run: bootse
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here B <- 100 ## Not run: bootse <- boot.rrenv(X, Y, 4, 2, B) ## Not run: bootse
Compute bootstrap standard error for the reduced rank envelope estimator with nonconstant error covariance.
boot.rrenv.apweights(X, Y, u, d, B)
boot.rrenv.apweights(X, Y, u, d, B)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
d |
The rank of the coefficient matrix. An integer between 0 and u. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the regression coefficients in the reduced rank envelope model that accommodates nonconstant error covariance.
The output is an r by p matrix.
bootse |
The standard error for elements in beta computed by bootstrap. |
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here B <- 10 ## Not run: bootse <- boot.rrenv.apweights(X, Y, 3, 2, B) ## Not run: bootse
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here B <- 10 ## Not run: bootse <- boot.rrenv.apweights(X, Y, 3, 2, B) ## Not run: bootse
Compute bootstrap standard error for the scaled response envelope estimator.
boot.senv(X, Y, u, B)
boot.senv(X, Y, u, B)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the scaled envelope. An integer between 0 and r. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the regression coefficients in the scaled envelope model by bootstrapping the residuals.
The output is an r by p matrix.
bootse |
The standard error for elements in beta computed by bootstrap. |
data(sales) X <- sales[, 1:3] Y <- sales[, 4:7] u <- u.senv(X, Y) u ## Not run: B <- 100 ## Not run: bootse <- boot.senv(X, Y, 2, B) ## Not run: bootse
data(sales) X <- sales[, 1:3] Y <- sales[, 4:7] u <- u.senv(X, Y) u ## Not run: B <- 100 ## Not run: bootse <- boot.senv(X, Y, 2, B) ## Not run: bootse
Compute bootstrap standard error for the simultaneous envelope estimator.
boot.stenv(X, Y, q, u, B)
boot.stenv(X, Y, q, u, B)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
q |
Dimension of the X-envelope. An integer between 0 and p. |
u |
Dimension of the Y-envelope. An integer between 0 and r. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the regression coefficients in the envelope model by bootstrapping the residuals.
The output is an p by r matrix.
bootse |
The standard error for elements in beta computed by bootstrap. |
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] u <- u.stenv(X, Y) u ## Not run: B <- 100 ## Not run: bootse <- boot.stenv(X, Y, 2, 3, B) ## Not run: bootse
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] u <- u.stenv(X, Y) u ## Not run: B <- 100 ## Not run: bootse <- boot.stenv(X, Y, 2, 3, B) ## Not run: bootse
Compute bootstrap standard error for the scaled predictor envelope estimator.
boot.sxenv(X, Y, u, R, B)
boot.sxenv(X, Y, u, R, B)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the scaled envelope in the predictor space. An integer between 0 and p. |
R |
The number of replications of the scales. A vector, the sum of all elements of R must be p. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the regression coefficients in the scaled envelope model in the predictor space by bootstrapping the residuals.
The output is an p by r matrix.
bootse |
The standard error for elements in beta computed by bootstrap. |
data(sales) Y <- sales[, 1:3] X <- sales[, 4:7] R <- rep(1, 4) u <- u.sxenv(X, Y, R) u B <- 100 ## Not run: bootse <- boot.sxenv(X, Y, 2, R, B) ## Not run: bootse
data(sales) Y <- sales[, 1:3] X <- sales[, 4:7] R <- rep(1, 4) u <- u.sxenv(X, Y, R) u B <- 100 ## Not run: bootse <- boot.sxenv(X, Y, 2, R, B) ## Not run: bootse
Compute bootstrap standard error for the predictor envelope estimator.
boot.xenv(X, Y, u, B)
boot.xenv(X, Y, u, B)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Responses. An n by r matrix, r is the number of responses. The response can be univariate or multivariate and must be continuous variable. |
u |
Dimension of the envelope. An integer between 0 and p. |
B |
Number of bootstrap samples. A positive integer. |
This function computes the bootstrap standard errors for the regression coefficients in the envelope model in predictor space by bootstrapping the residuals.
The output is a p by r matrix.
bootse |
The standard error for elements in beta computed by bootstrap. |
data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] ## Not run: B <- 100 ## Not run: bootse <- boot.xenv(X, Y, 2, B) ## Not run: bootse
data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] ## Not run: B <- 100 ## Not run: bootse <- boot.xenv(X, Y, 2, B) ## Not run: bootse
Concrete is a highly complex material. This dataset investigates the relationship between the slump, flow and 28-day Compressive Strength of concrete and concrete ingredients.
data("concrete")
data("concrete")
A data frame with 103 entries on the following 10 variables.
Cement
Cement, input gradients, kg in one M^3 concrete.
Slag
Slag, input gradients, kg in one M^3 concrete.
Fly_ash
Fly ash, input gradients, kg in one M^3 concrete.
Water
Water, input gradients, kg in one M^3 concrete.
SP
Superplasticizer, input gradients, kg in one M^3 concrete.
Coarse_Aggr
Coarse aggregate, input gradients, kg in one M^3 concrete.
Fine_Aggr
Fine aggregate, input gradients, kg in one M^3 concrete.
Slump
Slump, output variable, in centimeter.
Flow
Flow, output variable, in centimeter.
Strength
28-day Compressive Strength, in Mpa.
Concrete is the most important material in civil engineering. This dataset include 103 data points that measure three characteristics of the concrete and the amount of seven input ingradents.
UCI Machine Learning Repository: http://archive.ics.uci.edu/ml/datasets/concrete+slump+test
Yeh, I-Cheng (2007). Modeling slump flow of concrete using second-order regressions and artificial neural networks. Cement and Concrete Composites, 29(6), 474-480.
Compute the prediction error for the response envelope estimator using m-fold cross validation.
cv.env(X, Y, u, m, nperm)
cv.env(X, Y, u, m, nperm)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
m |
A positive integer that is used to indicate m-fold cross validation. |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported. As Y is multivariate, the identity inner product is used for computing the prediction errors.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] u <- u.env(X, Y) u m <- 5 nperm <- 50 cvPE <- cv.env(X, Y, 1, m, nperm) cvPE
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] u <- u.env(X, Y) u m <- 5 nperm <- 50 cvPE <- cv.env(X, Y, 1, m, nperm) cvPE
Compute the prediction error using m-fold cross validation for the response envelope estimator that accommodates nonconstant variance.
cv.env.apweights(X, Y, u, m, nperm)
cv.env.apweights(X, Y, u, m, nperm)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
m |
A positive integer that is used to indicate m-fold cross validation. |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported. As Y is multivariate, the identity inner product is used for computing the prediction errors.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(concrete) X <- concrete[, 1:7] Y <- concrete[, 8:10] ## Not run: u <- u.env.apweights(X, Y) ## Not run: u m <- 5 nperm <- 50 ## Not run: cvPE <- cv.env.apweights(X, Y, 2, m, nperm) ## Not run: cvPE
data(concrete) X <- concrete[, 1:7] Y <- concrete[, 8:10] ## Not run: u <- u.env.apweights(X, Y) ## Not run: u m <- 5 nperm <- 50 ## Not run: cvPE <- cv.env.apweights(X, Y, 2, m, nperm) ## Not run: cvPE
Compute the prediction error using m-fold cross validation for the response envelope estimator where the errors follow a t-distribution.
cv.env.tcond(X, Y, u, df, m, nperm)
cv.env.tcond(X, Y, u, df, m, nperm)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
df |
Degrees of freedom of the t-distribution. A positive number that is greater than 2. |
m |
A positive integer that is used to indicate m-fold cross validation. |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported. As Y is multivariate, the identity inner product is used for computing the prediction errors.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(concrete) X <- concrete[1:78, 1:7] # The first 78 observations are training data Y <- concrete[1:78, 8:10] ## Not run: u <- u.env.tcond(X, Y, 6) ## Not run: u m <- 5 nperm <- 50 ## Not run: cvPE <- cv.env.tcond(X, Y, 2, 6, m, nperm) ## Not run: cvPE
data(concrete) X <- concrete[1:78, 1:7] # The first 78 observations are training data Y <- concrete[1:78, 8:10] ## Not run: u <- u.env.tcond(X, Y, 6) ## Not run: u m <- 5 nperm <- 50 ## Not run: cvPE <- cv.env.tcond(X, Y, 2, 6, m, nperm) ## Not run: cvPE
Compute the prediction error for the Envelope-based Partial Partial Least Squares estimator using m-fold cross validation.
cv.eppls(X1, X2, Y, u, m, nperm)
cv.eppls(X1, X2, Y, u, m, nperm)
X1 |
Predictors of main interest. An n by p1 matrix, n is the number of observations, and p1 is the number of main predictors. The predictors can be univariate or multivariate, discrete or continuous. |
X2 |
Covariates, or predictors not of main interest. An n by p2 matrix, p2 is the number of covariates. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
m |
A positive integer that is used to indicate m-fold cross validation. |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported. As Y is multivariate, the identity inner product is used for computing the prediction errors.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(amitriptyline) Y <- amitriptyline[ , 1:2] X1 <- amitriptyline[ , 4:7] X2 <- amitriptyline[ , 3] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.eppls(X1, X2, Y, 2, m, nperm) ## Not run: cvPE
data(amitriptyline) Y <- amitriptyline[ , 1:2] X1 <- amitriptyline[ , 4:7] X2 <- amitriptyline[ , 3] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.eppls(X1, X2, Y, 2, m, nperm) ## Not run: cvPE
Compute the prediction error for the groupwise envelope estimator using m-fold cross validation.
cv.genv(X, Y, Z, u, m, nperm)
cv.genv(X, Y, Z, u, m, nperm)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
Z |
A group indicator vector of length |
u |
Dimension of the groupwise envelope. An integer between 0 and r. |
m |
A positive integer that is used to indicate |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported. As Y is multivariate, the identity inner product is used for computing the prediction errors.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(fiberpaper) X <- fiberpaper[ , c(5, 7)] Y <- fiberpaper[ , 1:3] Z <- as.numeric(fiberpaper[ , 6] > mean(fiberpaper[ , 6])) ## Not run: m <- 5 ## Not run: nperm <- 50 ## Not run: cvPE <- cv.genv(X, Y, Z, 2, m, nperm) ## Not run: cvPE
data(fiberpaper) X <- fiberpaper[ , c(5, 7)] Y <- fiberpaper[ , 1:3] Z <- as.numeric(fiberpaper[ , 6] > mean(fiberpaper[ , 6])) ## Not run: m <- 5 ## Not run: nperm <- 50 ## Not run: cvPE <- cv.genv(X, Y, Z, 2, m, nperm) ## Not run: cvPE
Compute the prediction error for the heteroscedastic envelope estimator using m-fold cross validation.
cv.henv(X, Y, u, m, nperm)
cv.henv(X, Y, u, m, nperm)
X |
A group indicator vector of length |
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. |
u |
Dimension of the heteroscedastic envelope. An integer between 0 and r. |
m |
A positive integer that is used to indicate |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported. As Y is multivariate, the identity inner product is used for computing the prediction errors.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(waterstrider) X <- waterstrider[ , 1] Y <- waterstrider[ , 2:5] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.henv(X, Y, 2, m, nperm) ## Not run: cvPE
data(waterstrider) X <- waterstrider[ , 1] Y <- waterstrider[ , 2:5] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.henv(X, Y, 2, m, nperm) ## Not run: cvPE
Compute the prediction error for the envelope estimator in logistic regression using m-fold cross validation.
cv.logit.env(X, Y, u, m, nperm)
cv.logit.env(X, Y, u, m, nperm)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Response. An n by 1 matrix. The univariate response must be binary. |
u |
Dimension of the envelope. An integer between 0 and p. |
m |
A positive integer that is used to indicate m-fold cross validation. |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- as.numeric(ifelse(horseshoecrab[ , 4] > 0, 1, 0)) m <- 5 nperm <- 50 ## Not run: cvPE <- cv.logit.env(X, Y, 1, m, nperm) ## Not run: cvPE
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- as.numeric(ifelse(horseshoecrab[ , 4] > 0, 1, 0)) m <- 5 nperm <- 50 ## Not run: cvPE <- cv.logit.env(X, Y, 1, m, nperm) ## Not run: cvPE
Compute the prediction error for the partial envelope estimator using m-fold cross validation.
cv.penv(X1, X2, Y, u, m, nperm)
cv.penv(X1, X2, Y, u, m, nperm)
X1 |
Predictors of main interest. An n by p1 matrix, n is the number of observations, and p1 is the number of main predictors. The predictors can be univariate or multivariate, discrete or continuous. |
X2 |
Covariates, or predictors not of main interest. An n by p2 matrix, p2 is the number of covariates. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
m |
A positive integer that is used to indicate m-fold cross validation. |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported. As Y is multivariate, the identity inner product is used for computing the prediction errors.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.penv(X1, X2, Y, 1, m, nperm) ## Not run: cvPE
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.penv(X1, X2, Y, 1, m, nperm) ## Not run: cvPE
Compute the prediction error for the envelope estimator in poisson regression using m-fold cross validation.
cv.pois.env(X, Y, u, m, nperm)
cv.pois.env(X, Y, u, m, nperm)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Response. An n by 1 matrix. The univariate response must be counts. |
u |
Dimension of the envelope. An integer between 0 and p. |
m |
A positive integer that is used to indicate m-fold cross validation. |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- horseshoecrab[ , 4] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.pois.env(X, Y, 1, m, nperm) ## Not run: cvPE
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- horseshoecrab[ , 4] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.pois.env(X, Y, 1, m, nperm) ## Not run: cvPE
Compute the prediction error using m-fold cross validation for the reduced rank envelope estimator.
cv.rrenv(X, Y, u, d, m, nperm)
cv.rrenv(X, Y, u, d, m, nperm)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
d |
The rank of the coefficient matrix. An integer between 0 and u. |
m |
A positive integer that is used to indicate m-fold cross validation. |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported. As Y is multivariate, the identity inner product is used for computing the prediction errors.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here m <- 5 nperm <- 50 ## Not run: cvPE <- cv.rrenv(X, Y, 4, 2, m, nperm) ## Not run: cvPE
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here m <- 5 nperm <- 50 ## Not run: cvPE <- cv.rrenv(X, Y, 4, 2, m, nperm) ## Not run: cvPE
Compute the prediction error using m-fold cross validation for the reduced rank envelope estimator that accommodates nonconstant error covariance.
cv.rrenv.apweights(X, Y, u, d, m, nperm)
cv.rrenv.apweights(X, Y, u, d, m, nperm)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
d |
The rank of the coefficient matrix. An integer between 0 and u. |
m |
A positive integer that is used to indicate m-fold cross validation. |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported. As Y is multivariate, the identity inner product is used for computing the prediction errors.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here m <- 5 nperm <- 50 ## Not run: cvPE <- cv.rrenv.apweights(X, Y, 3, 2, m, nperm) ## Not run: cvPE
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here m <- 5 nperm <- 50 ## Not run: cvPE <- cv.rrenv.apweights(X, Y, 3, 2, m, nperm) ## Not run: cvPE
Compute the prediction error for the scaled response envelope estimator using m-fold cross validation.
cv.senv(X, Y, u, m, nperm)
cv.senv(X, Y, u, m, nperm)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the scaled envelope. An integer between 0 and r. |
m |
A positive integer that is used to indicate m-fold cross validation. |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported. As Y is multivariate, the identity inner product is used for computing the prediction errors.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(sales) X <- sales[, 1:3] Y <- sales[, 4:7] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.senv(X, Y, 2, m, nperm) ## Not run: cvPE
data(sales) X <- sales[, 1:3] Y <- sales[, 4:7] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.senv(X, Y, 2, m, nperm) ## Not run: cvPE
Compute the prediction error for the simultaneous envelope estimator using m-fold cross validation.
cv.stenv(X, Y, q, u, m, nperm)
cv.stenv(X, Y, q, u, m, nperm)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Responses. An n by r matrix, r is the number of responses. The response can be univariate or multivariate and must be continuous variable. |
q |
Dimension of the X-envelope. An integer between 0 and p. |
u |
Dimension of the Y-envelope. An integer between 0 and r. |
m |
A positive integer that is used to indicate m-fold cross validation. |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension (q, u), the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported. If Y is multivariate, the identity inner product is used for computing the prediction errors.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.stenv(X, Y, 2, 3, m, nperm) ## Not run: cvPE
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.stenv(X, Y, 2, 3, m, nperm) ## Not run: cvPE
Compute the prediction error for the scaled predictor envelope estimator using m-fold cross validation.
cv.sxenv(X, Y, u, R, m, nperm)
cv.sxenv(X, Y, u, R, m, nperm)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Responses. An n by r matrix, r is the number of responses. The response can be univariate or multivariate and must be continuous variable. |
u |
Dimension of the scaled envelope. An integer between 0 and r. |
R |
The number of replications of the scales. A vector, the sum of all elements of R must be p. |
m |
A positive integer that is used to indicate m-fold cross validation. |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported. As Y is multivariate, the identity inner product is used for computing the prediction errors.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(sales) Y <- sales[, 1:3] X <- sales[, 4:7] R <- rep(1, 4) m <- 5 nperm <- 50 ## Not run: cvPE <- cv.sxenv(X, Y, 2, R, m, nperm) ## Not run: cvPE
data(sales) Y <- sales[, 1:3] X <- sales[, 4:7] R <- rep(1, 4) m <- 5 nperm <- 50 ## Not run: cvPE <- cv.sxenv(X, Y, 2, R, m, nperm) ## Not run: cvPE
Compute the prediction error for the predictor envelope estimator using m-fold cross validation.
cv.xenv(X, Y, u, m, nperm)
cv.xenv(X, Y, u, m, nperm)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Responses. An n by r matrix, r is the number of responses. The response can be univariate or multivariate and must be continuous variable. |
u |
Dimension of the envelope. An integer between 0 and p. |
m |
A positive integer that is used to indicate m-fold cross validation. |
nperm |
A positive integer indicating number of permutations of the observations, m-fold cross validation is run on each permutation. |
This function computes prediction errors using m-fold cross validation. For a fixed dimension u, the data is randomly partitioned into m parts, each part is in turn used for testing for the prediction performance while the rest m-1 parts are used for training. This process is repeated for nperm
times, and average prediction error is reported. If Y is multivariate, the identity inner product is used for computing the prediction errors.
The output is a real nonnegative number.
cvPE |
The prediction error estimated by m-fold cross validation. |
data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.xenv(X, Y, 2, m, nperm) ## Not run: cvPE
data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] m <- 5 nperm <- 50 ## Not run: cvPE <- cv.xenv(X, Y, 2, m, nperm) ## Not run: cvPE
This function outputs the rank selected by a chi-squared test developed by Bura and Cook (2003) with specified significance level for the beta.
d.select(X, Y, alpha = 0.01)
d.select(X, Y, alpha = 0.01)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
alpha |
Significance level for testing. The default is 0.01. |
This function estimate the rank of beta using a chi-squared test. The test statistic and degrees of freedom are described in Bura and Cook (2003).
rank.beta |
Rank of beta guided by the Bura-Cook estimator. |
Bura, E. and Cook, R. D. (2003). Rank estimation in reduced-rank regression. Journal of Multivariate Analysis, 87, 159 - 176.
Fit the response envelope model in multivariate linear regression with dimension u.
env(X, Y, u, asy = TRUE, init = NULL)
env(X, Y, u, asy = TRUE, init = NULL)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
asy |
Flag for computing the asymptotic variance of the envelope estimator. The default is |
init |
The user-specified value of Gamma for the envelope subspace. An r by u matrix. The default is the one generated by function envMU. |
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, the starting value and blockwise coordinate descent algorithm in Cook et al. (2016) is implemented. 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.
The output is a list that contains the following components:
beta |
The envelope estimator of the regression coefficients. |
Sigma |
The envelope estimator of the error covariance matrix. |
Gamma |
An orthonormal basis of the envelope subspace. |
Gamma0 |
An orthonormal basis of the complement of the envelope subspace. |
eta |
The coordinates of beta with respect to Gamma. |
Omega |
The coordinates of Sigma with respect to Gamma. |
Omega0 |
The coordinates of Sigma with respect to Gamma0. |
mu |
The estimated intercept. |
loglik |
The maximized log likelihood function. |
covMatrix |
The asymptotic covariance of vec(beta). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE |
The asymptotic standard error for elements in beta under the envelope model. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
ratio |
The asymptotic standard error ratio of the standard multivariate linear regression estimator over the envelope estimator, for each element in beta. |
n |
The number of observations in the data. |
Cook, R. D., Li, B. and Chiaromente, F. (2010). Envelope Models for Parsimonious and Efficient Multivariate Linear Regression (with discussion). Statist. Sinica 20, 927- 1010.
Cook, R. D., Forzani, L. and Su, Z. (2016) A Note on Fast Envelope Estimation. Journal of Multivariate Analysis. 150, 42-54.
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] u <- u.env(X, Y) u m <- env(X, Y, 1) m m$beta
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] u <- u.env(X, Y) u m <- env(X, Y, 1) m m$beta
For fixed envelope dimension u, fit the envelope model in multivariate linear regression with nonconstant error variance.
env.apweights(X, Y, u, asy = TRUE)
env.apweights(X, Y, u, asy = TRUE)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
asy |
Flag for computing the asymptotic variance of the envelope estimator. The default is |
This function fits the envelope model to the responses and predictors,
using the maximum likelihood estimation. It allows that the error covariance matrix to be nonconstant. When the dimension of the envelope is between 1 and r-1, the alternating algorithm in Forzani and Su (2021) is implemented. 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.
The output is a list that contains the following components:
beta |
The envelope estimator of the regression coefficients. |
Sigma |
The envelope estimator of the error covariance matrix. |
Gamma |
An orthogonal basis of the envelope subspace. |
Gamma0 |
An orthogonal basis of the complement of the envelope subspace. |
eta |
The coordinates of beta with respect to Gamma. |
Omega |
The coordinates of Sigma with respect to Gamma. |
Omega0 |
The coordinates of Sigma with respect to Gamma0. |
mu |
The estimated intercept. |
loglik |
The maximized log likelihood function. |
covMatrix |
The asymptotic covariance of vec(beta). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE |
The asymptotic standard error for elements in beta under the envelope model. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
ratio |
The asymptotic standard error ratio of the standard multivariate linear regression estimator (with consideration of nonconstant variance) over the envelope estimator, for each element in beta. |
n |
The number of observations in the data. |
C1 |
The estimated weights |
Forzani, L. and Su, Z. (2021). Envelopes for elliptical multivariate linear regression. Statist. Sinica 31, 301-332.
data(concrete) X <- concrete[, 1:7] Y <- concrete[, 8:10] ## Not run: u <- u.env.apweights(X, Y) ## Not run: u m <- env.apweights(X, Y, 2) m m$beta
data(concrete) X <- concrete[, 1:7] Y <- concrete[, 8:10] ## Not run: u <- u.env.apweights(X, Y) ## Not run: u m <- env.apweights(X, Y, 2) m m$beta
For fixed envelope dimension u, fit the envelope model in multivariate linear regression, where the errors follow a multivariate t-distribution.
env.tcond(X, Y, u, df, asy = TRUE)
env.tcond(X, Y, u, df, asy = TRUE)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
df |
Degrees of freedom of the t-distribution. A positive number that is greater than 2. |
asy |
Flag for computing the asymptotic variance of the envelope estimator. The default is |
This function fits the envelope model to the responses and predictors,
using the maximum likelihood estimation. The errors follow a multivariate t-distribution with scale matrix
and degrees of freedom
df
. When the dimension of the envelope is between 1 and r-1, the alternating algorithm in Forzani and Su (2021) is implemented. 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.
The output is a list that contains the following components:
beta |
The envelope estimator of the regression coefficients. |
Sigma |
The envelope estimator of the error covariance matrix. |
Gamma |
An orthogonal basis of the envelope subspace. |
Gamma0 |
An orthogonal basis of the complement of the envelope subspace. |
eta |
The coordinates of beta with respect to Gamma. |
Omega |
The coordinates of Sigma with respect to Gamma. |
Omega0 |
The coordinates of Sigma with respect to Gamma0. |
mu |
The estimated intercept. |
loglik |
The maximized log likelihood function. |
covMatrix |
The asymptotic covariance of vec(beta). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE |
The asymptotic standard error for elements in beta under the envelope model. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
ratio |
The asymptotic standard error ratio of the standard multivariate linear regression estimator (with consideration of nonconstant variance) over the envelope estimator, for each element in beta. |
n |
The number of observations in the data. |
Forzani, L. and Su, Z. (2021). Envelopes for elliptical multivariate linear regression. Statist. Sinica 31, 301-332.
data(concrete) X <- concrete[1:78, 1:7] # The first 78 observations are training data Y <- concrete[1:78, 8:10] ## Not run: u <- u.env.tcond(X, Y, 6) ## Not run: u m <- env.tcond(X, Y, 2, 6) m m$beta
data(concrete) X <- concrete[1:78, 1:7] # The first 78 observations are training data Y <- concrete[1:78, 8:10] ## Not run: u <- u.env.tcond(X, Y, 6) ## Not run: u m <- env.tcond(X, Y, 2, 6) m m$beta
Fit the Envelope-based Partial Partial Least Squares model for multivariate linear regression with dimension u.
eppls(X1, X2, Y, u, asy = TRUE, init = NULL)
eppls(X1, X2, Y, u, asy = TRUE, init = NULL)
X1 |
An |
X2 |
An |
Y |
An |
u |
A given dimension of the Envelope-based Partial Partial Least Squares. It should be an interger between |
asy |
Flag for computing the asymptotic variance of the envelope estimator. The default is |
init |
The user-specified value of Gamma for the envelope subspace. An |
This function the Envelope-based Partial Partial Least Squares model for multivariate linear regression with dimension ,
using the maximum likelihood estimation. When the dimension of the envelope is between 1 and -1, the starting value and blockwise coordinate descent algorithm in Cook et al. (2016) is implemented. When the dimension is
, 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.
The output is a list that contains the following components:
muY |
The estimator of mean of |
mu1 |
The estimator of mean of |
mu2 |
The estimator of mean of |
beta1 |
A |
beta2 |
A |
Gamma |
An |
Gamma0 |
An |
gamma |
A |
eta |
A |
Omega |
A |
Omega0 |
A |
SigmaX1 |
The estimator of error covariance matrix |
SigmaYcX |
The estimator of error covariance matrix |
loglik |
The maximized log likelihood function. |
n |
The number of observations in the data. |
covMatrix1 |
The asymptotic covariance of vec(beta1). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
covMatrix2 |
The asymptotic covariance of vec(beta2). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE1 |
The asymptotic standard error matrix for elements in |
asySE2 |
The asymptotic standard error matrix for elements in |
Park, Y., Su, Z. and Chung, D. (2022+) Envelope-based Partial Partial Least Squares with Application to Cytokine-based Biomarker Analysis for COVID-19.
data(amitriptyline) Y <- amitriptyline[ , 1:2] X1 <- amitriptyline[ , 4:7] X2 <- amitriptyline[ , 3] u <- u.eppls(X1, X2, Y) u m <- eppls(X1, X2, Y, 2) m
data(amitriptyline) Y <- amitriptyline[ , 1:2] X1 <- amitriptyline[ , 4:7] X2 <- amitriptyline[ , 3] u <- u.eppls(X1, X2, Y) u m <- eppls(X1, X2, Y, 2) m
Fit the response and predictor envelope model in function-on-function linear regression with dimensions ux and uy, using the direct estimation.
felmdir(X, Y, ux, uy, t1, t2, knots = c(0, 0.25, 0.5, 0.75, 1))
felmdir(X, Y, ux, uy, t1, t2, knots = c(0, 0.25, 0.5, 0.75, 1))
X |
Predictor function. An n by T1 matrix, T1 is number of observed time points, which is the length of t1. Here we assume that each function is observed at the same time points. |
Y |
Response function. An n by T2 matrix, T2 is number of observed time points, which is the length of t2. Here we assume that each function is observed at the same time points. |
ux |
Dimension of the predictor envelope. An integer between 0 and number of knots +2. |
uy |
Dimension of the response envelope. An integer between 0 and number of knots +2. |
t1 |
The observed time points for the predictor functions. |
t2 |
The observed time points for the response functions. |
knots |
The location of knots of the cubic splines used for estimation. Locations should be positive. The default location of the knots are 0, 0.25, 0.5, 0.75, 1. |
This function fits the envelope model to the function-on-function linear regression,
,
where X and Y are random functions in Hilbert spaces and
,
is a fixed member in
,
is a random member of
, and B:
is a linear operator. We use cubic splines as the basis for both
and
. The coefficients
and
with respect to the basis are computed. The predictor and response envelope model is fitted on the linear regression model of
on
. In this method, we do not need to estimate the eigenfunctions of
and
. Based on the estimation result, the fitted value of
is calculated. The standard function-on-function regression model also works through the linear regression model of
on
. But instead of fitting an envelope model, it fits a standard linear regression model, based on which the fitted value of
is calculated. The details are elaborated in Section 5, direct estimation, in the reference of Su et al. (2022).
The output is a list that contains the following components:
beta |
The envelope estimator of the regression coefficients in the regression of |
betafull |
The standard estimator, i.e., the OLS estimator of the regression coefficients in the regression of |
alpha |
The envelope estimator of the intercept in the regression of |
alphafull |
The standard estimator of the intercept in the regression of |
fitted.env |
The fitted value of Y computed from the functional envelope linear model. |
fitted.full |
The fitted value of Y computed from the standard function-to-function linear model. |
Su, Z., Li, B. and Cook, R. D. (2022+) Envelope model for function-on-function linear regression.
data(NJdata) dataX <- matrix(NJdata[,6], nrow = 21) X <- as.matrix(dataX[, 32:61]) dataY <- matrix(NJdata[,3], nrow = 21) Y <- as.matrix(dataY[, 32:61]) t1 <- 0:29 t2 <- t1 m <- felmdir(X, Y, 3, 1, t1, t2) head(m$fitted.env) head(m$fitted.full)
data(NJdata) dataX <- matrix(NJdata[,6], nrow = 21) X <- as.matrix(dataX[, 32:61]) dataY <- matrix(NJdata[,3], nrow = 21) Y <- as.matrix(dataY[, 32:61]) t1 <- 0:29 t2 <- t1 m <- felmdir(X, Y, 3, 1, t1, t2) head(m$fitted.env) head(m$fitted.full)
Fit the response and predictor envelope model in function-on-function linear regression with dimensions ux and uy, using Karhunen-Loeve expansion based estimation.
felmKL(X, Y, ux, uy, t1, t2, knots = c(0, 0.25, 0.5, 0.75, 1))
felmKL(X, Y, ux, uy, t1, t2, knots = c(0, 0.25, 0.5, 0.75, 1))
X |
Predictor function. An n by T1 matrix, T1 is number of observed time points, which is the length of t1. Here we assume that each function is observed at the same time points. |
Y |
Response function. An n by T2 matrix, T2 is number of observed time points, which is the length of t2. Here we assume that each function is observed at the same time points. |
ux |
Dimension of the predictor envelope. An integer between 0 and number of knots +2. |
uy |
Dimension of the response envelope. An integer between 0 and number of knots +2. |
t1 |
The observed time points for the predictor functions. |
t2 |
The observed time points for the response functions. |
knots |
The location of knots of the cubic splines used for estimation. Locations should be positive. The default location of the knots are 0, 0.25, 0.5, 0.75, 1. |
This function fits the envelope model to the function-on-function linear regression,
where X and Y are random functions in Hilbert spaces and
,
is a fixed member in
,
is a random member of
, and B:
is a linear operator. We use cubic splines as the basis for both
and
in the estimation of the eigenfunctions of
and
. The coefficients
and
with respect to the estimated eigenfunctions are computed. The predictor and response envelope model is fitted on the linear regression model of
on
. Based on its result, the fitted value of
is calculated. The standard function-on-function regression model also works through the linear regression model of
on
. But instead of fitting an envelope model, it fits a standard linear regression model, based on which the fitted value of
is calculated. The details are elaborated in Section 6, Karhunen-Lo'eve expansion based estimation, in the reference of Su et al. (2022).
The output is a list that contains the following components:
beta |
The envelope estimator of the regression coefficients in the regression of |
betafull |
The standard estimator, i.e., the OLS estimator of the regression coefficients in the regression of |
alpha |
The envelope estimator of the intercept in the regression of |
alphafull |
The standard estimator of the intercept in the regression of |
phihat.cord |
The estimated coordinates of eigenfunctions of |
psihat.cord |
The estimated coordinates of eigenfunctions of |
fitted.env |
The fitted value of Y computed from the functional envelope linear model. |
fitted.full |
The fitted value of Y computed from the standard function-to-function linear model. |
Su, Z., Li, B. and Cook, R. D. (2022+) Envelope model for function-on-function linear regression.
data(NJdata) dataX <- matrix(NJdata[,6], nrow = 21) X <- as.matrix(dataX[, 32:61]) dataY <- matrix(NJdata[,3], nrow = 21) Y <- as.matrix(dataY[, 32:61]) t1 <- 0:29 t2 <- t1 m <- felmKL(X, Y, 4, 3, t1, t2) head(m$fitted.env) head(m$fitted.full)
data(NJdata) dataX <- matrix(NJdata[,6], nrow = 21) X <- as.matrix(dataX[, 32:61]) dataY <- matrix(NJdata[,3], nrow = 21) Y <- as.matrix(dataY[, 32:61]) t1 <- 0:29 t2 <- t1 m <- felmKL(X, Y, 4, 3, t1, t2) head(m$fitted.env) head(m$fitted.full)
Pulp and paper property
data("fiberpaper")
data("fiberpaper")
A data frame with 62 observations on the following 8 variables.
V1
Breaking length.
V2
Elastic modulus.
V3
Stress at failure.
V4
Burst strength.
V5
Arithmetic fiber length.
V6
Long fiber fraction.
V7
Fine fiber fraction.
V8
Zero span tensile.
This data set contains measurements of properties of pulp fibers and the paper made from them.
Johnson, R.A. and Wichern, D.W. (2007). Applied Multivariate Statistical Analysis, 6th edition.
Fit the groupwise envelope model in multivariate linear regression with dimension u. The groupwise envelope model is designed to accommodate both distinct regression coefficients and distinct error structures for different groups.
genv(X, Y, Z, u, asy = TRUE, fit = TRUE, init = NULL)
genv(X, Y, Z, u, asy = TRUE, fit = TRUE, init = NULL)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
Z |
A group indicator vector of length |
u |
Dimension of the groupwise envelope. An integer between 0 and r. |
asy |
Flag for computing the asymptotic variance of the envelope estimator. The default is |
fit |
Flag for computing the fitted response. The default is |
init |
The user-specified value of Gamma for the groupwise envelope subspace. An r by u matrix. The default is the one generated by function genvMU. |
This function fits the groupwise envelope model to the responses and predictors,
for l = 1, ..., L, using the maximum likelihood estimation. When the dimension of the groupwise envelope is between 1 and r-1, the starting value and blockwise coordinate descent algorithm in Cook et al. (2016) is implemented. 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. When L is 1, the groupwise envelope model degenerates to the envelope model in Cook et al. (2010).
The output is a list that contains the following components:
beta |
A list of |
Sigma |
A list of the estimator of error covariance matrix. |
Gamma |
An orthonormal basis of the groupwise envelope subspace. |
Gamma0 |
An orthonormal basis of the complement of the groupwise envelope subspace. |
eta |
The coordinates of beta with respect to Gamma. |
Omega |
The coordinates of Sigma with respect to Gamma. |
Omega0 |
The coordinates of Sigma with respect to Gamma0. |
mu |
The estimator of group mean. A |
loglik |
The maximized log likelihood function. |
covMatrix |
A list of the asymptotic covariance of vec(beta). The covariance
matrix returned are asymptotic. For the actual standard errors,
multiply by 1 / n. |
asySE |
A list of the asymptotic standard error for elements in beta under
the groupwise envelope model. The standard errors returned are
asymptotic, for actual standard errors, multiply by 1 / sqrt(n).
|
ratio |
A list of the asymptotic standard error ratio of the standard
multivariate linear regression estimator over the groupwise envelope
estimator, for each element in beta. |
groupInd |
A matrix containing the unique values of group indicators. The matrix has p rows. |
n |
The number of observations in the data. |
ng |
The number of observations in each group. |
Yfit |
Fitted responses. |
Park, Y., Su, Z. and Zhu, H. (2017) Groupwise envelope models for Imaging Genetic Analysis. Biometrics, to appear.
Cook, R. D., Li, B. and Chiaromente, F. (2010). Envelope Models for Parsimonious and Efficient Multivariate Linear Regression (with discussion). Statist. Sinica 20, 927- 1010.
Cook, R. D., Forzani, L. and Su, Z. (2016) A Note on Fast Envelope Estimation. Journal of Multivariate Analysis. 150, 42-54.
data(fiberpaper) X <- fiberpaper[ , c(5, 7)] Y <- fiberpaper[ , 1:3] Z <- as.numeric(fiberpaper[ , 6] > mean(fiberpaper[ , 6])) ## Not run: u <- u.genv(X, Y, Z) ## Not run: u ## Not run: m <- genv(X, Y, Z, 2)
data(fiberpaper) X <- fiberpaper[ , c(5, 7)] Y <- fiberpaper[ , 1:3] Z <- as.numeric(fiberpaper[ , 6] > mean(fiberpaper[ , 6])) ## Not run: u <- u.genv(X, Y, Z) ## Not run: u ## Not run: m <- genv(X, Y, Z, 2)
Fit the heteroscedastic envelope model derived to incorporate heteroscedastic error structure in the context of estimating multivariate means for different groups with dimension u.
henv(X, Y, u, asy = TRUE, fit = TRUE, init = NULL)
henv(X, Y, u, asy = TRUE, fit = TRUE, init = NULL)
X |
A group indicator vector of length |
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. |
u |
Dimension of the heteroscedastic envelope. An integer between 0 and r. |
asy |
Flag for computing the asymptotic variance of the envelope estimator. The default is |
fit |
Flag for computing the fitted response. The default is |
init |
The user-specified value of Gamma for the heteroscedastic envelope subspace. An r by u matrix. The default is the one generated by function henvMU. |
This function fits the heteroscedastic envelope model to the responses,
for i = 1, ..., p, using the maximum likelihood estimation. When the dimension of the heteroscedastic envelope is between 1 and r-1, the starting value and blockwise coordinate descent algorithm in Cook et al. (2016) is implemented. When the dimension is r, then the envelope model degenerates to the standard multivariate linear regression for comparing group means. When the dimension is 0, it means there is no any group effect, and the fitting is different.
The output is a list that contains the following components:
beta |
The heteroscedastic envelope estimator of the group main effect. An r by p matix, the ith column of the matrix contains the main effect for the ith group. |
Sigma |
A list of the heteroscedastic envelope estimator of the error
covariance matrix. |
Gamma |
An orthonormal basis of the heteroscedastic envelope subspace. |
Gamma0 |
An orthonormal basis of the complement of the heteroscedastic envelope subspace. |
eta |
A list of the coordinates of beta with respect to Gamma. |
Omega |
A list of the coordinates of Sigma with respect to Gamma.
|
Omega0 |
The coordinates of Sigma with respect to Gamma0. |
mu |
The heteroscedastic envelope estimator of the grand mean. A r by 1 matrix. |
mug |
A list of the heteroscedastic envelope estimator of the group mean. An r by p matix, the ith column of the matrix contains the mean for the ith group. |
loglik |
The maximized log likelihood function. |
covMatrix |
The asymptotic covariance of (mu, vec(beta)')'. An r(p + 1) by r(p + 1) matrix. The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE |
The asymptotic standard error for elements in beta under the heteroscedastic envelope model. An r by p matrix. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
ratio |
The asymptotic standard error ratio of the standard multivariate linear regression for comparing group means over the heteroscedastic envelope estimator, for each element in beta. An r by p matrix. |
groupInd |
A matrix containing the unique values of group indicators. The matrix has p rows. |
n |
The number of observations in the data. |
ng |
The number of observations in each group. |
Yfit |
Fitted responses. |
Su, Z. and Cook, R. D. (2013) Estimation of Multivariate Means with Heteroscedastic Error Using Envelope Models. Statistica Sinica, 23, 213-230.
Cook, R. D., Li, B. and Chiaromente, F. (2010). Envelope Models for Parsimonious and Efficient Multivariate Linear Regression (with discussion). Statist. Sinica 20, 927- 1010.
Cook, R. D., Forzani, L. and Su, Z. (2016) A Note on Fast Envelope Estimation. Journal of Multivariate Analysis. 150, 42-54.
data(waterstrider) X <- waterstrider[ , 1] Y <- waterstrider[ , 2:5] ## Not run: u <- u.henv(X, Y) ## Not run: u ## Not run: m <- henv(X, Y, 2)
data(waterstrider) X <- waterstrider[ , 1] Y <- waterstrider[ , 2:5] ## Not run: u <- u.henv(X, Y) ## Not run: u ## Not run: m <- henv(X, Y, 2)
The number of satellite male crabs near a female crab upon characteristic of the female horseshoe crabs.
data("horseshoecrab")
data("horseshoecrab")
A data frame with 173 observations on the following 5 variables.
V1
Color.
V2
Condition of spine.
V3
Width of shell.
V4
Satellite.
V5
Weight.
This data set contains the number of satellite male crabs and characteristics of the female horseshoe crabs.
Agresti, A. (2007). An Introduction to Categorical Data Analysis, 2nd edition.
Fit the envelope model in logistic regression with dimension u.
logit.env(X, Y, u, asy = TRUE, init = NULL)
logit.env(X, Y, u, asy = TRUE, init = NULL)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Response. An n by 1 matrix. The univariate response must be binary. |
u |
Dimension of the envelope. An integer between 0 and p. |
asy |
Flag for computing the asymptotic variance of the envelope estimator. The default is |
init |
The user-specified value of Gamma for the envelope subspace in logistic regression. An p by u matrix. The default is the one generated by function logit.envMU. |
This function fits the envelope model in logistic regression,
using the maximum likelihood estimation. When the dimension of the envelope is between 1 and p-1, the starting value and blockwise coordinate descent algorithm in Cook et al. (2016) is implemented. This model works the best when X is multivariate normal.
The output is a list that contains the following components:
beta |
The envelope estimator of the canonical parameter. |
SigmaX |
The envelope estimator of the covariance matrix of X. |
Gamma |
An orthonormal basis of the envelope subspace. |
Gamma0 |
An orthonormal basis of the complement of the envelope subspace. |
eta |
The estimated beta of the canonical parameter with respect to Gamma. |
Omega |
The coordinates of SigmaX with respect to Gamma. |
Omega0 |
The coordinates of SigmaX with respect to Gamma0. |
mu |
The estimated intercept of the canonical parameter. |
loglik |
The maximized log likelihood function. |
covMatrix |
The asymptotic covariance of vec(beta). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE |
The asymptotic standard error for elements in beta under the envelope model. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
ratio |
The asymptotic standard error ratio of the standard multivariate linear regression estimator over the envelope estimator, for each element in beta. |
n |
The number of observations in the data. |
Cook, R. D., Zhang, X. (2015). Foundations for Envelope Models and Methods. Journal of the American Statistical Association 110, 599 - 611.
Cook, R. D., Forzani, L. and Su, Z. (2016) A Note on Fast Envelope Estimation. Journal of Multivariate Analysis. 150, 42-54.
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- as.numeric(ifelse(horseshoecrab[ , 4] > 0, 1, 0)) ## Not run: u <- u.logit.env(X, Y) ## Not run: u ## Not run: m <- logit.env(X, Y, 1) ## Not run: m$beta
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- as.numeric(ifelse(horseshoecrab[ , 4] > 0, 1, 0)) ## Not run: u <- u.logit.env(X, Y) ## Not run: u ## Not run: m <- logit.env(X, Y, 1) ## Not run: m$beta
Daily COVID-19 infections, weather information as well as mobility of people for all 21 counties in May and June, 2020.
data(NJdata)
data(NJdata)
A data frame with 1281 entries on the following 9 variables.
key
The FIPS (Federal Information Processing System) county codes.
date
Date of measurements.
mobility_retail_and_recreation
Percentage change in visits to restaurants, cafes, shopping centers, theme parks, museums, libraries, and movie theaters compared to baseline. The baseline is the median value, for the corresponding day of the week, during the 5-week period Jan 3-Feb 6, 2020.
mobility_grocery_and_pharmacy
Percentage change in visits to places like grocery markets, food warehouses, farmers markets, specialty food shops, drug stores, and pharmacies compared to baseline. The baseline is the median value, for the corresponding day of the week, during the 5-week period Jan 3-Feb 6, 2020.
mobility_workplaces
Percentage change in visits to places of work compared to baseline. The baseline is the median value, for the corresponding day of the week, during the 5-week period Jan 3-Feb 6, 2020.
new_confirmed
Count of new cases confirmed after positive test on this date. Values can be negative, typically indicating a correction or an adjustment in the way they were measured. For example, a case might have been incorrectly flagged as recovered one date so it will be subtracted from the following date.
new_deceased
Count of new deaths from a positive COVID-19 case on this date. Values can be negative, typically indicating a correction or an adjustment in the way they were measured. For example, a case might have been incorrectly flagged as recovered one date so it will be subtracted from the following date.
average_temperature
Recorded hourly average temperature, in celsius.
rainfall
Rainfall during the entire day, in millimeters.
This dataset contains COVID-19 new confirmed cases and deceased cases, average temperature and total rainfall, as well as the movement of people to different categories of places for each date-region pair.
https://github.com/open-covid-19/data#open-covid-19-dataset
Fit the partial envelope model in multivariate linear regression with dimension u. The partial envelope model focuses on the coefficients of main interest.
penv(X1, X2, Y, u, asy = TRUE, init = NULL)
penv(X1, X2, Y, u, asy = TRUE, init = NULL)
X1 |
Predictors of main interest. An n by p1 matrix, n is the number of observations, and p1 is the number of main predictors. The predictors can be univariate or multivariate, discrete or continuous. |
X2 |
Covariates, or predictors not of main interest. An n by p2 matrix, p2 is the number of covariates. |
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. |
u |
Dimension of the partial envelope. An integer between 0 and r. |
asy |
Flag for computing the asymptotic variance of the partial envelope estimator. The default is |
init |
The user-specified value of Gamma for the partial envelope subspace. An r by u matrix. The default is the one generated by function envMU. |
This function fits the partial envelope model to the responses Y and predictors X1 and X2,
using the maximum likelihood estimation. When the dimension of the envelope is between 1 and r - 1, we implemented the algorithm in Su and Cook (2011), but the partial envelope subspace is estimated using the blockwise coordinate descent algorithm in Cook et al. (2016). When the dimension is r, then the partial envelope model degenerates to the standard multivariate linear regression with Y as the responses and both X1 and X2 as predictors. When the dimension is 0, X1 and Y are uncorrelated, and the fitting is the standard multivariate linear regression with Y as the responses and X2 as the predictors.
The output is a list that contains the following components:
beta1 |
The partial envelope estimator of beta1, which is the regression coefficients for X1. |
beta2 |
The partial envelope estimator of beta2, which is the regression coefficients for X2. |
Sigma |
The partial envelope estimator of the error covariance matrix. |
Gamma |
An orthonormal basis of the partial envelope subspace. |
Gamma0 |
An orthonormal basis of the complement of the partial envelope subspace. |
eta |
The coordinates of beta1 with respect to Gamma. |
Omega |
The coordinates of Sigma with respect to Gamma. |
Omega0 |
The coordinates of Sigma with respect to Gamma0. |
mu |
The estimated intercept in the partial envelope model. |
loglik |
The maximized log likelihood function. |
covMatrix |
The asymptotic covariance of vec(beta), while beta = (beta1, beta2). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE1 |
The asymptotic standard error for elements in beta1 under the partial envelope model. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
asySE2 |
The asymptotic standard error for elements in beta2 under the partial envelope model. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
ratio |
The asymptotic standard error ratio of the stanard multivariate linear regression estimator over the partial envelope estimator, for each element in beta1. |
n |
The number of observations in the data. |
Su, Z. and Cook, R.D. (2011). Partial envelopes for efficient estimation in multivariate linear regression. Biometrika 98, 133 - 146.
Cook, R. D., Forzani, L. and Su, Z. (2016) A Note on Fast Envelope Estimation. Journal of Multivariate Analysis. 150, 42-54.
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] u <- u.penv(X1, X2, Y) u m <- penv(X1, X2, Y, 1) m m$beta1
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] u <- u.penv(X1, X2, Y) u m <- penv(X1, X2, Y, 1) m m$beta1
Fit the envelope model in poisson regression with dimension u.
pois.env(X, Y, u, asy = TRUE, init = NULL)
pois.env(X, Y, u, asy = TRUE, init = NULL)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Response. An n by 1 matrix. The univariate response must be counts. |
u |
Dimension of the envelope. An integer between 0 and p. |
asy |
Flag for computing the asymptotic variance of the envelope estimator. The default is |
init |
The user-specified value of Gamma for the envelope subspace in poisson regression. An p by u matrix. The default is the one generated by function pois.envMU. |
This function fits the envelope model in poisson regression,
using the maximum likelihood estimation. When the dimension of the envelope is between 1 and p-1, the starting value and blockwise coordinate descent algorithm in Cook et al. (2016) is implemented. This model works the best when X is multivariate normal.
The output is a list that contains the following components:
beta |
The envelope estimator of the canonical parameter. |
SigmaX |
The envelope estimator of the covariance matrix of X. |
Gamma |
An orthonormal basis of the envelope subspace. |
Gamma0 |
An orthonormal basis of the complement of the envelope subspace. |
eta |
The estimated beta of the canonical parameter with respect to Gamma. |
Omega |
The coordinates of SigmaX with respect to Gamma. |
Omega0 |
The coordinates of SigmaX with respect to Gamma0. |
mu |
The estimated intercept of the canonical parameter. |
loglik |
The maximized log likelihood function. |
covMatrix |
The asymptotic covariance of vec(beta). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE |
The asymptotic standard error for elements in beta under the envelope model. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
ratio |
The asymptotic standard error ratio of the standard multivariate linear regression estimator over the envelope estimator, for each element in beta. |
n |
The number of observations in the data. |
Cook, R. D., Zhang, X. (2015). Foundations for Envelope Models and Methods. Journal of the American Statistical Association 110, 599 - 611.
Cook, R. D., Forzani, L. and Su, Z. (2016) A Note on Fast Envelope Estimation. Journal of Multivariate Analysis. 150, 42-54.
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- horseshoecrab[ , 4] ## Not run: u <- u.pois.env(X, Y) ## Not run: u m <- pois.env(X, Y, 1) m$beta
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- horseshoecrab[ , 4] ## Not run: u <- u.pois.env(X, Y) ## Not run: u m <- pois.env(X, Y, 1) m$beta
Perform estimation or prediction under the response envelope model.
pred.env(m, Xnew)
pred.env(m, Xnew)
m |
A list containing estimators and other statistics inherited from env. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
This function evaluates the envelope model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
covMatrix.pred |
The covariance matrix of the predicted value at Xnew. |
SE.pred |
The standard error of the predicted value at Xnew. |
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] u <- u.env(X, Y) u m <- env(X, Y, 1) m X <- as.matrix(X) pred.res <- pred.env(m, X[2, ]) pred.res
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] u <- u.env(X, Y) u m <- env(X, Y, 1) m X <- as.matrix(X) pred.res <- pred.env(m, X[2, ]) pred.res
Perform estimation or prediction under the response envelope model with accommodation to nonconstant variance.
pred.env.apweights(m, Xnew)
pred.env.apweights(m, Xnew)
m |
A list containing estimators and other statistics inherited from env.apweights. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
This function evaluates the envelope model with nonconstant variance at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
covMatrix.pred |
The covariance matrix of the predicted value at Xnew. |
SE.pred |
The standard error of the predicted value at Xnew. |
data(concrete) X <- concrete[, 1:7] Y <- concrete[, 8:10] ## Not run: u <- u.envapweights(X, Y) ## Not run: u m <- env.apweights(X, Y, 2) m X <- as.matrix(X) pred.res <- pred.env.apweights(m, X[2, ]) pred.res
data(concrete) X <- concrete[, 1:7] Y <- concrete[, 8:10] ## Not run: u <- u.envapweights(X, Y) ## Not run: u m <- env.apweights(X, Y, 2) m X <- as.matrix(X) pred.res <- pred.env.apweights(m, X[2, ]) pred.res
Perform estimation or prediction under the response envelope model, where the errors follow a multivariate t-distribution.
pred.env.tcond(m, Xnew)
pred.env.tcond(m, Xnew)
m |
A list containing estimators and other statistics inherited from env.tcond. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
This function evaluates the envelope model with t distributed errors at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
covMatrix.pred |
The covariance matrix of the predicted value at Xnew. |
SE.pred |
The standard error of the predicted value at Xnew. |
data(concrete) X <- concrete[1:78, 1:7] # The first 78 observations are training data Y <- concrete[1:78, 8:10] ## Not run: u <- u.env.tcond(X, Y, 6) ## Not run: u m <- env.tcond(X, Y, 2, 6) m X <- as.matrix(X) pred.res <- pred.env.tcond(m, X[2, ]) pred.res
data(concrete) X <- concrete[1:78, 1:7] # The first 78 observations are training data Y <- concrete[1:78, 8:10] ## Not run: u <- u.env.tcond(X, Y, 6) ## Not run: u m <- env.tcond(X, Y, 2, 6) m X <- as.matrix(X) pred.res <- pred.env.tcond(m, X[2, ]) pred.res
Perform estimation or prediction under the Envelope-based Partial Partial Least Squares.
pred.eppls(m, X1new, X2new)
pred.eppls(m, X1new, X2new)
m |
A list containing estimators and other statistics inherited from eppls. |
X1new |
The value of X1 with which to estimate or predict Y. A p1 dimensional vector. |
X2new |
The value of X2 with which to estimate or predict Y. A p2 dimensional vector. |
This function evaluates the partial envelope model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at X1new and X2new. |
covMatrix.estm |
The covariance matrix of the fitted value at X1new and X2new. |
SE.estm |
The standard error of the fitted value at X1new and X2new. |
covMatrix.pred |
The covariance matrix of the predicted value at X1new and X2new. |
SE.pred |
The standard error of the predicted value at X1new and X2new. |
Park, Y., Su, Z. and Chung, D. (2022+) Envelope-based Partial Partial Least Squares with Application to Cytokine-based Biomarker Analysis for COVID-19.
data(amitriptyline) Y <- amitriptyline[ , 1:2] X1 <- amitriptyline[ , 4:7] X2 <- amitriptyline[ , 3] u <- u.eppls(X1, X2, Y) u m <- eppls(X1, X2, Y, 2) pred.res <- pred.eppls(m, X1[1, ], X2[1]) pred.res
data(amitriptyline) Y <- amitriptyline[ , 1:2] X1 <- amitriptyline[ , 4:7] X2 <- amitriptyline[ , 3] u <- u.eppls(X1, X2, Y) u m <- eppls(X1, X2, Y, 2) pred.res <- pred.eppls(m, X1[1, ], X2[1]) pred.res
Perform estimation or prediction under the functional envelope linear model, using the direct estimation.
pred.felmdir(X, Y, ux, uy, t1, t2, Xnew, knots = c(0, 0.25, 0.5, 0.75, 1))
pred.felmdir(X, Y, ux, uy, t1, t2, Xnew, knots = c(0, 0.25, 0.5, 0.75, 1))
X |
Predictor function. An n by T1 matrix, T1 is number of observed time points, which is the length of t1. Here we assume that each function is observed at the same time points. |
Y |
Response function. An n by T2 matrix, T2 is number of observed time points, which is the length of t2. Here we assume that each function is observed at the same time points. |
ux |
Dimension of the predictor envelope. An integer between 0 and number of knots +2. |
uy |
Dimension of the response envelope. An integer between 0 and number of knots +2. |
t1 |
The observed time points for the predictor functions. |
t2 |
The observed time points for the response functions. |
Xnew |
The value of X with which to estimate or predict Y. A T1 dimensional vector. The observed time points should be the same as those of X. |
knots |
The location of knots of the cubic splines used for estimation. Locations should be positive. The default location of the knots are 0, 0.25, 0.5, 0.75, 1. |
This function evaluates the functional envelope linear model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided. The estimation method uses the direct estimation in Su et al. (2022) with cubic splines.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. The fitted or predicted values are at the same observation points as Y. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
covMatrix.pred |
The covariance matrix of the predicted value at Xnew. |
SE.pred |
The standard error of the predicted value at Xnew. |
Su, Z., Li, B. and Cook, R. D. (2022+) Envelope model for function-on-function linear regression.
data(NJdata) dataX <- matrix(NJdata[,6], nrow = 21) X <- as.matrix(dataX[, 32:61]) dataY <- matrix(NJdata[,3], nrow = 21) Y <- as.matrix(dataY[, 32:61]) t1 <- 0:29 t2 <- t1 m <- pred.felmdir(X, Y, 3, 1, t1, t2, X[1,]) m$value m$SE.estm m$SE.pred
data(NJdata) dataX <- matrix(NJdata[,6], nrow = 21) X <- as.matrix(dataX[, 32:61]) dataY <- matrix(NJdata[,3], nrow = 21) Y <- as.matrix(dataY[, 32:61]) t1 <- 0:29 t2 <- t1 m <- pred.felmdir(X, Y, 3, 1, t1, t2, X[1,]) m$value m$SE.estm m$SE.pred
Perform estimation or prediction under the functional envelope linear model, using Karhunen-Loeve expansion based estimation.
pred.felmKL(X, Y, ux, uy, t1, t2, Xnew, knots = c(0, 0.25, 0.5, 0.75, 1))
pred.felmKL(X, Y, ux, uy, t1, t2, Xnew, knots = c(0, 0.25, 0.5, 0.75, 1))
X |
Predictor function. An n by T1 matrix, T1 is number of observed time points, which is the length of t1. Here we assume that each function is observed at the same time points. |
Y |
Response function. An n by T2 matrix, T2 is number of observed time points, which is the length of t2. Here we assume that each function is observed at the same time points. |
ux |
Dimension of the predictor envelope. An integer between 0 and number of knots +2. |
uy |
Dimension of the response envelope. An integer between 0 and number of knots +2. |
t1 |
The observed time points for the predictor functions. |
t2 |
The observed time points for the response functions. |
Xnew |
The value of X with which to estimate or predict Y. A T1 dimensional vector. The observed time points should be the same as those of X. |
knots |
The location of knots of the cubic splines used for estimation. Locations should be positive. The default location of the knots are 0, 0.25, 0.5, 0.75, 1. |
This function evaluates the functional envelope linear model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided. The estimation method uses the Karhunen-Loeve expansion based estimation in Su et al. (2022) with cubic splines.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. The fitted or predicted values are at the same observation points as Y. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
covMatrix.pred |
The covariance matrix of the predicted value at Xnew. |
SE.pred |
The standard error of the predicted value at Xnew. |
Su, Z., Li, B. and Cook, R. D. (2022+) Envelope model for function-on-function linear regression.
data(NJdata) dataX <- matrix(NJdata[,6], nrow = 21) X <- as.matrix(dataX[, 32:61]) dataY <- matrix(NJdata[,3], nrow = 21) Y <- as.matrix(dataY[, 32:61]) t1 <- 0:29 t2 <- t1 m <- pred.felmKL(X, Y, 4, 3, t1, t2, X[1,]) m$value m$SE.estm m$SE.pred
data(NJdata) dataX <- matrix(NJdata[,6], nrow = 21) X <- as.matrix(dataX[, 32:61]) dataY <- matrix(NJdata[,3], nrow = 21) Y <- as.matrix(dataY[, 32:61]) t1 <- 0:29 t2 <- t1 m <- pred.felmKL(X, Y, 4, 3, t1, t2, X[1,]) m$value m$SE.estm m$SE.pred
Perform estimation or prediction under the groupwise envelope model.
pred.genv(m, Xnew, Znew)
pred.genv(m, Xnew, Znew)
m |
A list containing estimators and other statistics inherited from env. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
Znew |
A group indicator of X. |
This function evaluates the envelope model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew with a group indicator Z = Znew, or prediction: predict Y when X = Xnew with a group indicator Z = Znew. The covariance matrix and the standard errors are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Znew. |
covMatrix.estm |
The covariance matrix of the fitted value at Znew. |
SE.estm |
The standard error of the fitted value at Znew. |
covMatrix.pred |
The covariance matrix of the predicted value at Znew. |
SE.pred |
The standard error of the predicted value at Znew. |
data(fiberpaper) X <- fiberpaper[ , c(5, 7)] Y <- fiberpaper[ , 1:3] Z <- as.numeric(fiberpaper[ , 6] > mean(fiberpaper[ , 6])) u <- u.genv(X, Y, Z) u m <- genv(X, Y, Z, 2) m X <- as.matrix(X) pred.res <- pred.genv(m, X[2, ], Z[2]) pred.res
data(fiberpaper) X <- fiberpaper[ , c(5, 7)] Y <- fiberpaper[ , 1:3] Z <- as.numeric(fiberpaper[ , 6] > mean(fiberpaper[ , 6])) u <- u.genv(X, Y, Z) u m <- genv(X, Y, Z, 2) m X <- as.matrix(X) pred.res <- pred.genv(m, X[2, ], Z[2]) pred.res
Perform estimation or prediction under the heteroscedastic envelope model.
pred.henv(m, Xnew)
pred.henv(m, Xnew)
m |
A list containing estimators and other statistics inherited from henv. |
Xnew |
The value of X with which to estimate or predict Y. An r by 1 vector. |
This function evaluates the heteroscedastic envelope model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
covMatrix.pred |
The covariance matrix of the predicted value at Xnew. |
SE.pred |
The standard error of the predicted value at Xnew. |
data(waterstrider) X <- waterstrider[ , 1] Y <- waterstrider[ , 2:5] ## Not run: m <- henv(X, Y, 2) ## Not run: pred.res <- pred.henv(m, X[2])
data(waterstrider) X <- waterstrider[ , 1] Y <- waterstrider[ , 2:5] ## Not run: m <- henv(X, Y, 2) ## Not run: pred.res <- pred.henv(m, X[2])
Perform estimation or prediction under the envelope model in logistic regression.
pred.logit.env(m, Xnew)
pred.logit.env(m, Xnew)
m |
A list containing estimators and other statistics inherited from xenv. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
This function evaluates the envelope model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew. The covariance matrix of estimation and the standard errors of estimation are also provided.
The output is a list that contains following components.
value |
The fitted value or predicted value evaluated at Xnew. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- as.numeric(ifelse(horseshoecrab[ , 4] > 0, 1, 0)) m <- logit.env(X, Y, 1) pred.res <- pred.logit.env(m, X[1, ]) pred.res
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- as.numeric(ifelse(horseshoecrab[ , 4] > 0, 1, 0)) m <- logit.env(X, Y, 1) pred.res <- pred.logit.env(m, X[1, ]) pred.res
Perform estimation or prediction under the partial envelope model.
pred.penv(m, X1new, X2new)
pred.penv(m, X1new, X2new)
m |
A list containing estimators and other statistics inherited from penv. |
X1new |
The value of X1 with which to estimate or predict Y. A p1 dimensional vector. |
X2new |
The value of X2 with which to estimate or predict Y. A p2 dimensional vector. |
This function evaluates the partial envelope model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at X1new and X2new. |
covMatrix.estm |
The covariance matrix of the fitted value at X1new and X2new. |
SE.estm |
The standard error of the fitted value at X1new and X2new. |
covMatrix.pred |
The covariance matrix of the predicted value at X1new and X2new. |
SE.pred |
The standard error of the predicted value at X1new and X2new. |
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] m <- penv(X1, X2, Y, 1) pred.res <- pred.penv(m, X1[1], X2[1, ]) pred.res
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] m <- penv(X1, X2, Y, 1) pred.res <- pred.penv(m, X1[1], X2[1, ]) pred.res
Perform estimation or prediction under the envelope model in poisson regression.
pred.pois.env(m, Xnew)
pred.pois.env(m, Xnew)
m |
A list containing estimators and other statistics inherited from xenv. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
This function evaluates the envelope in poisson regression at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix of estimation and the standard errors of estimation are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- horseshoecrab[ , 4] m <- pois.env(X, Y, 1) pred.res <- pred.pois.env(m, X[1, ]) pred.res
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- horseshoecrab[ , 4] m <- pois.env(X, Y, 1) pred.res <- pred.pois.env(m, X[1, ]) pred.res
Perform estimation or prediction under the reduced rank envelope model.
pred.rrenv(m, Xnew)
pred.rrenv(m, Xnew)
m |
A list containing estimators and other statistics inherited from rrenv. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
This function evaluates the reduced rank envelope model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
covMatrix.pred |
The covariance matrix of the predicted value at Xnew. |
SE.pred |
The standard error of the predicted value at Xnew. |
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here m <- rrenv(X, Y, 4, 2) m X <- as.matrix(X) pred.res <- pred.rrenv(m, X[2, ]) pred.res
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here m <- rrenv(X, Y, 4, 2) m X <- as.matrix(X) pred.res <- pred.rrenv(m, X[2, ]) pred.res
Perform estimation or prediction under the reduced rank envelope model with nonconstant error covariance.
pred.rrenv.apweights(m, Xnew)
pred.rrenv.apweights(m, Xnew)
m |
A list containing estimators and other statistics inherited from rrenv.apweights. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
This function evaluates the reduced rank envelope model that accommodates nonconstant error covariance at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
covMatrix.pred |
The covariance matrix of the predicted value at Xnew. |
SE.pred |
The standard error of the predicted value at Xnew. |
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here ## Not run: m <- rrenv.apweights(X, Y, 3, 2) ## Not run: m ## Not run: X <- as.matrix(X) ## Not run: pred.res <- pred.rrenv.apweights(m, X[2, ]) ## Not run: pred.res
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here ## Not run: m <- rrenv.apweights(X, Y, 3, 2) ## Not run: m ## Not run: X <- as.matrix(X) ## Not run: pred.res <- pred.rrenv.apweights(m, X[2, ]) ## Not run: pred.res
Perform estimation or prediction under the scaled response envelope model.
pred.senv(m, Xnew)
pred.senv(m, Xnew)
m |
A list containing estimators and other statistics inherited from scale.env. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
This function evaluates the scaled envelope model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
covMatrix.pred |
The covariance matrix of the predicted value at Xnew. |
SE.pred |
The standard error of the predicted value at Xnew. |
data(sales) X <- sales[, 1:3] Y <- sales[, 4:7] m <- senv(X, Y, 2) pred.res <- pred.senv(m, X[2, ]) pred.res
data(sales) X <- sales[, 1:3] Y <- sales[, 4:7] m <- senv(X, Y, 2) pred.res <- pred.senv(m, X[2, ]) pred.res
Perform estimation or prediction under the simultaneous envelope model.
pred.stenv(m, Xnew)
pred.stenv(m, Xnew)
m |
A list containing estimators and other statistics inherited from stenv. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
This function evaluates the simultaneous envelope model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
covMatrix.pred |
The covariance matrix of the predicted value at Xnew. |
SE.pred |
The standard error of the predicted value at Xnew. |
data(fiberpaper) X <- fiberpaper[ , 5:7] Y <- fiberpaper[ , 1:4] m <- stenv(X, Y, 2, 3) m pred.res <- pred.stenv(m, X[1, ]) pred.res
data(fiberpaper) X <- fiberpaper[ , 5:7] Y <- fiberpaper[ , 1:4] m <- stenv(X, Y, 2, 3) m pred.res <- pred.stenv(m, X[1, ]) pred.res
Perform estimation or prediction under the scaled predictor envelope model.
pred.sxenv(m, Xnew)
pred.sxenv(m, Xnew)
m |
A list containing estimators and other statistics inherited from stenv. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
This function evaluates the scaled envelope model in the predictor space at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
covMatrix.pred |
The covariance matrix of the predicted value at Xnew. |
SE.pred |
The standard error of the predicted value at Xnew. |
data(sales) Y <- sales[, 1:3] X <- sales[, 4:7] R <- rep(1, 4) m <- sxenv(X, Y, 2, R) pred.res <- pred.sxenv(m, X[1, ]) pred.res
data(sales) Y <- sales[, 1:3] X <- sales[, 4:7] R <- rep(1, 4) m <- sxenv(X, Y, 2, R) pred.res <- pred.sxenv(m, X[1, ]) pred.res
Perform estimation or prediction under the predictor envelope model.
pred.xenv(m, Xnew)
pred.xenv(m, Xnew)
m |
A list containing estimators and other statistics inherited from xenv. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
This function evaluates the envelope model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
covMatrix.pred |
The covariance matrix of the predicted value at Xnew. |
SE.pred |
The standard error of the predicted value at Xnew. |
data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] m <- xenv(X, Y, 2) m pred.res <- pred.xenv(m, X[1, ]) pred.res
data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] m <- xenv(X, Y, 2) m pred.res <- pred.xenv(m, X[1, ]) pred.res
Perform estimation or prediction under the envelope model through partial envelope model.
pred2.env(X, Y, u, Xnew)
pred2.env(X, Y, u, Xnew)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
The dimension of the constructed partial envelope model. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
This function evaluates the envelope model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. The covariance matrix and the standard errors are also provided. Compared to predict.env, this function performs prediction through partial envelope model, which can be more accurate if the partial envelope is of smaller dimension and contains less variant material information. The constructed partial envelope model is obtained by the following: Let A0 by a p by p-1 matrix, such that A = (Xnew, A0) has full rank. Let phi1 = beta * Xnew, phi2 = beta * A0, phi = (phi1, phi2) and X = inverse of A * X = (Z1, Z2')'. Then the model Y = alpha + beta * X + epsilon can be reparameterized as Y = alpha + phi1 * Z1 + phi2 * Z2 + epsilon. We then fit a partial envelope model with Z1 as the predictor of interest, and predict at (Z1, Z2')' = inverse of A * Xnew.
The output is a list that contains following components.
value |
The fitted value or the predicted value evaluated at Xnew. |
covMatrix.estm |
The covariance matrix of the fitted value at Xnew. |
SE.estm |
The standard error of the fitted value at Xnew. |
covMatrix.pred |
The covariance matrix of the predicted value at Xnew. |
SE.pred |
The standard error of the predicted value at Xnew. |
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] u <- u.pred2.env(X, Y, X[10, ]) pred.res <- pred2.env(X, Y, u$u.bic, X[10, ]) pred.res$SE.estm pred.res$SE.pred
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] u <- u.pred2.env(X, Y, X[10, ]) pred.res <- pred2.env(X, Y, u$u.bic, X[10, ]) pred.res$SE.estm pred.res$SE.pred
Fit the reduced-rank envelope model with rank d and fixed envelope dimension u.
rrenv(X, Y, u, d, asy = TRUE)
rrenv(X, Y, u, d, asy = TRUE)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
d |
The rank of the coefficient matrix. An integer between 0 and u. |
asy |
Flag for computing the asymptotic variance of the reduced rank envelope estimator. The default is |
This function fits the reduced rank envelope model to the responses and predictors,
using the maximum likelihood estimation. The errors follow a normal distribution. When 0 < d < u < r, the estimation procedure in Cook et al. (2015) is implemented. When d < u = r, then the model is equivalent to a reduced rank regression model. When d = u, or d = p < r, then B can be taken as the identity matrix and the model reduces to a response envelope model. When the dimension is d = u = r, then the envelope model degenerates to the standard multivariate linear regression. When the u = 0, it means that X and Y are uncorrelated, and the fitting is different. If the error covariance matrix is nonconstant, see the function
rrenv.apweights
.
The output is a list that contains the following components:
Gamma |
An orthogonal basis of the envelope subspace. |
Gamma0 |
An orthogonal basis of the complement of the envelope subspace. |
mu |
The estimated intercept. |
beta |
The envelope estimator of the regression coefficients. |
Sigma |
The envelope estimator of the error covariance matrix. |
eta |
The eta matrix in the coefficient matrix. |
B |
The B matrix in the coefficient matrix. |
Omega |
The coordinates of Sigma with respect to Gamma. |
Omega0 |
The coordinates of Sigma with respect to Gamma0. |
loglik |
The maximized log likelihood function. |
covMatrix |
The asymptotic covariance of vec(beta). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE |
The asymptotic standard error for elements in beta under the reduced rank envelope model. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
ratio |
The asymptotic standard error ratio of the standard multivariate linear regression estimator (with consideration of nonconstant variance) over the envelope estimator, for each element in beta. |
n |
The number of observations in the data. |
Cook, R. D., Forzani, L. and Zhang, X. (2015). Envelopes and reduced-rank regression. Biometrika 102, 439-456.
Forzani, L. and Su, Z. (2021). Envelopes for elliptical multivariate linear regression. Statist. Sinica 31, 301-332.
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here d <- d.select(X, Y, 0.01) d ## Not run: u <- u.rrenv(X, Y, 2) ## Not run: u m <- rrenv(X, Y, 4, 2) m m$beta
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here d <- d.select(X, Y, 0.01) d ## Not run: u <- u.rrenv(X, Y, 2) ## Not run: u m <- rrenv(X, Y, 4, 2) m m$beta
For rank d and fixed envelope dimension u, fit the reduced-rank envelope model with nonconstant error variance.
rrenv.apweights(X, Y, u, d, asy = TRUE)
rrenv.apweights(X, Y, u, d, asy = TRUE)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the envelope. An integer between 0 and r. |
d |
The rank of the coefficient matrix. An integer between 0 and u. |
asy |
Flag for computing the asymptotic variance of the reduced rank envelope estimator. The default is |
This function fits the reduced rank envelope model to the responses and predictors,
using the maximum likelihood estimation. The errors follow a normal distribution. It allows that the error covariance matrix to be nonconstant. When 0 < d < u < r, the estimation procedure in Cook et al. (2015) is implemented. When d < u = r, then the model is equivalent to a reduced rank regression model. When d = u, or d = p < r, then B can be taken as the identity matrix and the model reduces to a response envelope model. When the dimension is d = u = r, then the envelope model degenerates to the standard multivariate linear regression. When the u = 0, it means that X and Y are uncorrelated, and the fitting is different.
The output is a list that contains the following components:
Gamma |
An orthogonal basis of the envelope subspace. |
Gamma0 |
An orthogonal basis of the complement of the envelope subspace. |
mu |
The estimated intercept. |
beta |
The envelope estimator of the regression coefficients. |
Sigma |
The envelope estimator of the error covariance matrix. |
eta |
The eta matrix in the coefficient matrix. |
B |
The B matrix in the coefficient matrix. |
Omega |
The coordinates of Sigma with respect to Gamma. |
Omega0 |
The coordinates of Sigma with respect to Gamma0. |
loglik |
The maximized log likelihood function. |
covMatrix |
The asymptotic covariance of vec(beta). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE |
The asymptotic standard error for elements in beta under the reduced rank envelope model. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
ratio |
The asymptotic standard error ratio of the standard multivariate linear regression estimator (with consideration of nonconstant variance) over the envelope estimator, for each element in beta. |
n |
The number of observations in the data. |
C1 |
The estimated weights |
Cook, R. D., Forzani, L. and Zhang, X. (2015). Envelopes and reduced-rank regression. Biometrika 102, 439-456.
Forzani, L. and Su, Z. (2021). Envelopes for elliptical multivariate linear regression. Statist. Sinica 31, 301-332.
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here d <- d.select(X, Y, 0.01) d ## Not run: u <- u.rrenv.apweights(X, Y, 2) ## Not run: u ## Not run: m <- rrenv.apweights(X, Y, 3, 2) ## Not run: m ## Not run: m$beta
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here d <- d.select(X, Y, 0.01) d ## Not run: u <- u.rrenv.apweights(X, Y, 2) ## Not run: u ## Not run: m <- rrenv.apweights(X, Y, 3, 2) ## Not run: m ## Not run: m$beta
On the performance of a firm's sales staff
data("sales")
data("sales")
A data frame with 50 observations on the following 7 variables.
V1
Index of sales growth.
V2
Index of sales profitability.
V3
Index of new account sales.
V4
Score on creativity.
V5
Score on mechanical reasoning test.
V6
Score on abstract reasoning test.
V7
Score on Mathematics test.
This data set contains 3 measures of performance and 4 tests scores.
Johnson, R.A., Wichern, D.W. (2007). Applied Multivariage Statistical Analysis, 6th edition.
Fit the scaled response envelope model in multivariate linear regression with dimension u. The scaled response envelope model is a scale-invariant version of the response envelope model.
senv(X, Y, u, asy = TRUE, init = NULL)
senv(X, Y, u, asy = TRUE, init = NULL)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the scaled envelope. An integer between 0 and r. |
asy |
Flag for computing the asymptotic variance of the envelope estimator. The default is |
init |
The user-specified value of Gamma for the scaled envelope subspace. An r by u matrix. The default is the one generated by function senvMU. |
This function fits the scaled envelope model to the responses and predictors,
using the maximum likelihood estimation. When the dimension of the scaled envelope is between 1 and r-1, the starting value and blockwise coordinate descent algorithm in Cook et al. (2016) is implemented. When the dimension is r, then the scaled 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.
The output is a list that contains the following components:
beta |
The scaled envelope estimator of the regression coefficients. |
Sigma |
The scaled envelope estimator of the error covariance matrix. |
Lambda |
The matrix of estimated scale. |
Gamma |
An orthonormal basis of the scaled envelope subspace. |
Gamma0 |
An orthonormal basis of the complement of the scaled envelope subspace. |
eta |
The coordinates of beta with respect to Gamma. |
Omega |
The coordinates of Sigma with respect to Gamma. |
Omega0 |
The coordinates of Sigma with respect to Gamma0. |
mu |
The estimated intercept. |
loglik |
The maximized log likelihood function. |
covMatrix |
The asymptotic covariance of vec(beta). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE |
The asymptotic standard error for elements in beta under the envelope model. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
ratio |
The asymptotic standard error ratio of the standard multivariate linear regression estimator over the envelope estimator, for each element in beta. |
n |
The number of observations in the data. |
Cook, R. D., Su, Z. (2013). Scaled Envelopes: scale Invariant and Efficient Estimation in Multivariate Linear Regression. Biometrika 100, 939 - 954.
Cook, R. D., Forzani, L. and Su, Z. (2016) A Note on Fast Envelope Estimation. Journal of Multivariate Analysis. 150, 42-54.
data(sales) X <- sales[, 1:3] Y <- sales[, 4:7] u <- u.senv(X, Y) u m <- senv(X, Y, 2) m$beta
data(sales) X <- sales[, 1:3] Y <- sales[, 4:7] u <- u.senv(X, Y) u m <- senv(X, Y, 2) m$beta
Fit the simultaneous envelope model in multivariate linear regression with dimension (q, u).
stenv(X, Y, q, u, asy = TRUE, Pinit = NULL, Ginit = NULL)
stenv(X, Y, q, u, asy = TRUE, Pinit = NULL, Ginit = NULL)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
q |
Dimension of the X-envelope. An integer between 0 and p. |
u |
Dimension of the Y-envelope. An integer between 0 and r. |
asy |
Flag for computing the asymptotic variance of the envelope estimator. The default is |
Pinit |
The user-specified value of Phi for the X-envelope subspace. An p by q matrix. The default is the one generated by function stenvMU. |
Ginit |
The user-specified value of Gamma for the Y-envelope subspace. An r by u matrix. The default is the one generated by function stenvMU. |
This function fits the envelope model to the responses and predictors simultaneously,
using the maximum likelihood estimation. When the dimension of the Y-envelope is between 1 and r-1 and the dimension of the X-envelope is between 1 and p-1, the starting value and blockwise coordinate descent algorithm in Cook et al. (2016) is implemented. When the dimension is (p, r), then the envelope model degenerates to the standard multivariate linear regression. When the dimension of the Y-envelope is r, then the envelope model degenerates to the standard envelope model. When the dimension of X-envelope is p, then the envelope model degenerates to the envelope model in the predictor space. When the dimension is 0, it means that X and Y are uncorrelated, and the fitting is different.
The output is a list that contains the following components:
beta |
The envelope estimator of the regression coefficients. |
SigmaYcX |
The envelope estimator of the error covariance matrix. |
SigmaX |
The envelope estimator of the covariance matrix of X. |
Gamma |
An orthonormal basis of the Y-envelope subspace. |
Gamma0 |
An orthonormal basis of the complement of the Y-envelope subspace. |
eta |
The coordinates of beta with respect to Gamma and Phi. |
Omega |
The coordinates of SigmaYcX with respect to Gamma. |
Omega0 |
The coordinates of SigmaYcX with respect to Gamma0. |
mu |
The estimated intercept. |
Phi |
An orthonormal basis of the X-envelope subspace. |
Phi0 |
An orthonormal basis of the complement of the X-envelope subspace. |
Delta |
The coordinates of SigmaX with respect to Phi. |
Delta0 |
The coordinates of SigmaX with respect to Phi0. |
loglik |
The maximized log likelihood function. |
covMatrix |
The asymptotic covariance of vec(beta). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE |
The asymptotic standard error for elements in beta under the envelope model. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
ratio |
The asymptotic standard error ratio of the standard multivariate linear regression estimator over the envelope estimator, for each element in beta. |
n |
The number of observations in the data. |
Cook, R. D., Zhang, X. (2015). Simultaneous Envelopes for Multivariate Linear Regression. Technometrics 57, 11 - 25.
Cook, R. D., Forzani, L. and Su, Z. (2016) A Note on Fast Envelope Estimation. Journal of Multivariate Analysis. 150, 42-54.
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] u <- u.stenv(X, Y) u m <- stenv(X, Y, 2, 3) m m$beta
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] u <- u.stenv(X, Y) u m <- stenv(X, Y, 2, 3) m m$beta
Fit the scaled predictor envelope model in multivariate linear regression with dimension u. The scaled predictor envelope model is a scale-invariant version of the predictor envelope model.
sxenv(X, Y, u, R, asy = TRUE, init = NULL)
sxenv(X, Y, u, R, asy = TRUE, init = NULL)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u |
Dimension of the scaled envelope in the predictor space. An integer between 0 and p. |
R |
The number of replications of the scales. A vector, the sum of all elements of R must be p. |
asy |
Flag for computing the asymptotic variance of the envelope estimator. The default is |
init |
The user-specified value of Gamma for the scaled envelope subspace in the predictor space. An p by u matrix. The default is the one generated by function sxenvMU. |
This function fits the scaled envelope model in the predictor space to the responses and predictors,
using the maximum likelihood estimation. When the dimension of the scaled envelope in the predictor space is between 1 and p-1, the starting value and blockwise coordinate descent algorithm in Cook et al. (2016) is implemented. When the dimension is p, then the scaled envelope model in the predictor space 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.
The output is a list that contains the following components:
beta |
The scaled envelope estimator of the regression coefficients. |
Sigma |
The scaled envelope estimator of the error covariance matrix. |
Lambda |
The matrix of estimated scale. |
Gamma |
An orthonormal basis of the scaled envelope subspace. |
Gamma0 |
An orthonormal basis of the complement of the scaled envelope subspace. |
eta |
The coordinates of beta with respect to Gamma. |
Omega |
The coordinates of Sigma with respect to Gamma. |
Omega0 |
The coordinates of Sigma with respect to Gamma0. |
muY |
The mean of Y. |
muX |
The mean of X. |
loglik |
The maximized log likelihood function. |
covMatrix |
The asymptotic covariance of vec(beta). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE |
The asymptotic standard error for elements in beta under the envelope model. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
ratio |
The asymptotic standard error ratio of the standard multivariate linear regression estimator over the envelope estimator, for each element in beta. |
n |
The number of observations in the data. |
Cook, R. D., Su, Z. (2016). Scaled Predictor Envelopes and Partial Least Squares Regression. Technometrics 58, 155 - 165.
Cook, R. D., Forzani, L. and Su, Z. (2016) A Note on Fast Envelope Estimation. Journal of Multivariate Analysis. 150, 42-54.
data(sales) Y <- sales[, 1:3] X <- sales[, 4:7] R <- rep(1, 4) u <- u.sxenv(X, Y, R) u m <- sxenv(X, Y, 2, R) m$beta
data(sales) Y <- sales[, 1:3] X <- sales[, 4:7] R <- rep(1, 4) u <- u.sxenv(X, Y, R) u m <- sxenv(X, Y, 2, R) m$beta
This function tests the null hypothesis L * beta * R = A versus the alternative hypothesis L * beta * R ~= A, where beta is estimated under the response envelope model.
testcoef.env(m, L, R, A)
testcoef.env(m, L, R, A)
m |
A list containing estimators and other statistics inherited from env. |
L |
The matrix multiplied to beta on the left. It is a d1 by r matrix, while d1 is less than or equal to r. |
R |
The matrix multiplied to beta on the right. It is a p by d2 matrix, while d2 is less than or equal to p. |
A |
The matrix on the right hand side of the equation. It is a d1 by d2 matrix. |
Note that inputs L
, R
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta R = A, versus Ha: L beta R != A. The beta is estimated by the envelope model. If L = Ir, R = Ip and A = 0, then the test is equivalent to the standard F test on if beta = 0. The test statistic used is vec(L beta R - A) hatSigma^-1 vec(L beta R - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta R - A). The reference distribution is chi-squared distribution with degrees of freedom d1 * d2.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta R). |
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] m <- env(X, Y, 1) m L <- diag(6) R <- as.matrix(1) A <- matrix(0, 6, 1) test.res <- testcoef.env(m, L, R, A) test.res
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] m <- env(X, Y, 1) m L <- diag(6) R <- as.matrix(1) A <- matrix(0, 6, 1) test.res <- testcoef.env(m, L, R, A) test.res
This function tests the null hypothesis L * beta * R = A versus the alternative hypothesis L * beta * R ~= A, where beta is estimated under the response envelope model with nonconstant error variance.
testcoef.env.apweights(m, L, R, A)
testcoef.env.apweights(m, L, R, A)
m |
A list containing estimators and other statistics inherited from env.apweights. |
L |
The matrix multiplied to beta on the left. It is a d1 by r matrix, while d1 is less than or equal to r. |
R |
The matrix multiplied to beta on the right. It is a p by d2 matrix, while d2 is less than or equal to p. |
A |
The matrix on the right hand side of the equation. It is a d1 by d2 matrix. |
Note that inputs L
, R
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta R = A, versus Ha: L beta R != A. The beta is estimated by the envelope model with nonconstant errors. If L = Ir, R = Ip and A = 0, then the test is equivalent to the standard F test on if beta = 0. The test statistic used is vec(L beta R - A) hatSigma^-1 vec(L beta R - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta R - A). The reference distribution is chi-squared distribution with degrees of freedom d1 * d2.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta R). |
data(concrete) X <- concrete[, 1:7] Y <- concrete[, 8:10] m <- env.apweights(X, Y, 2) m L <- diag(3) R <- matrix(1, 7, 1) A <- matrix(0, 3, 1) test.res <- testcoef.env.apweights(m, L, R, A) test.res
data(concrete) X <- concrete[, 1:7] Y <- concrete[, 8:10] m <- env.apweights(X, Y, 2) m L <- diag(3) R <- matrix(1, 7, 1) A <- matrix(0, 3, 1) test.res <- testcoef.env.apweights(m, L, R, A) test.res
This function tests the null hypothesis L * beta * R = A versus the alternative hypothesis L * beta * R ~= A, where beta is estimated under the response envelope model with t-distributed errors.
testcoef.env.tcond(m, L, R, A)
testcoef.env.tcond(m, L, R, A)
m |
A list containing estimators and other statistics inherited from env.tcond. |
L |
The matrix multiplied to beta on the left. It is a d1 by r matrix, while d1 is less than or equal to r. |
R |
The matrix multiplied to beta on the right. It is a p by d2 matrix, while d2 is less than or equal to p. |
A |
The matrix on the right hand side of the equation. It is a d1 by d2 matrix. |
Note that inputs L
, R
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta R = A, versus Ha: L beta R != A. The beta is estimated by the envelope model with t-distributed errors. If L = Ir, R = Ip and A = 0, then the test is equivalent to the standard F test on if beta = 0. The test statistic used is vec(L beta R - A) hatSigma^-1 vec(L beta R - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta R - A). The reference distribution is chi-squared distribution with degrees of freedom d1 * d2.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta R). |
data(concrete) X <- concrete[1:78, 1:7] # The first 78 observations are training data Y <- concrete[1:78, 8:10] m <- env.tcond(X, Y, 2, 6) m L <- diag(3) R <- matrix(1, 7, 1) A <- matrix(0, 3, 1) test.res <- testcoef.env.tcond(m, L, R, A) test.res
data(concrete) X <- concrete[1:78, 1:7] # The first 78 observations are training data Y <- concrete[1:78, 8:10] m <- env.tcond(X, Y, 2, 6) m L <- diag(3) R <- matrix(1, 7, 1) A <- matrix(0, 3, 1) test.res <- testcoef.env.tcond(m, L, R, A) test.res
This function tests the null hypothesis L * beta * R = A versus the alternative hypothesis L * beta * R ~= A, where beta is estimated under the groupwise envelope model.
testcoef.genv(m, L, R, A)
testcoef.genv(m, L, R, A)
m |
A list containing estimators and other statistics inherited from genv. |
L |
The matrix multiplied to beta on the left. It is a d1 by r matrix, while d1 is less than or equal to r. |
R |
The matrix multiplied to beta on the right. It is a p by d2 matrix, while d2 is less than or equal to p. |
A |
The matrix on the right hand side of the equation. It is a d1 by d2 matrix. |
Note that inputs L
, R
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta[[i]] R = A, versus Ha: L beta[[i]] R != A. The beta is estimated by the groupwise envelope model. If L = Ir, R = Ip and A = 0, then the test is equivalent to the standard F test on if beta[[i]] = 0. The test statistic used is vec(L beta R - A) hatSigma^-1 vec(L beta R - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta R - A). The reference distribution is chi-squared distribution with degrees of freedom d1 * d2.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta R). |
data(fiberpaper) X <- fiberpaper[ , c(5, 7)] Y <- fiberpaper[ , 1:3] Z <- as.numeric(fiberpaper[ , 6] > mean(fiberpaper[ , 6])) u <- u.genv(X, Y, Z) u m <- genv(X, Y, Z, 2) m L <- diag(3) R <- diag(2) A <- matrix(0, 3, 2) test.res <- testcoef.genv(m, L, R, A) test.res
data(fiberpaper) X <- fiberpaper[ , c(5, 7)] Y <- fiberpaper[ , 1:3] Z <- as.numeric(fiberpaper[ , 6] > mean(fiberpaper[ , 6])) u <- u.genv(X, Y, Z) u m <- genv(X, Y, Z, 2) m L <- diag(3) R <- diag(2) A <- matrix(0, 3, 2) test.res <- testcoef.genv(m, L, R, A) test.res
This function tests the null hypothesis L * beta * R = A versus the alternative hypothesis L * beta * R ~= A, where beta is estimated under the heteroscedastic envelope model.
testcoef.henv(m, L, R, A)
testcoef.henv(m, L, R, A)
m |
A list containing estimators and other statistics inherited from genv. |
L |
The matrix multiplied to beta on the left. It is a d1 by r matrix, while d1 is less than or equal to r. |
R |
The matrix multiplied to beta on the right. It is a p by d2 matrix, while d2 is less than or equal to p. |
A |
The matrix on the right hand side of the equation. It is a d1 by d2 matrix. |
Note that inputs L
, R
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta R = A, versus Ha: L beta R != A. The beta is estimated by the heteroscedastic envelope model. If L = Ir, R = Ip and A = 0, then the test is equivalent to the standard F test on if beta = 0. The test statistic used is vec(L beta R - A) hatSigma^-1 vec(L beta R - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta R - A). The reference distribution is chi-squared distribution with degrees of freedom d1 * d2.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta R). |
data(waterstrider) X <- waterstrider[ , 1] Y <- waterstrider[ , 2:5] ## Not run: m <- henv(X, Y, 2) ## Not run: m L <- diag(4) R <- matrix(c(1, -1, 0), 3, 1) A <- matrix(0, 4, 1) ## Not run: test.res <- testcoef.henv(m, L, R, A) ## Not run: test.res
data(waterstrider) X <- waterstrider[ , 1] Y <- waterstrider[ , 2:5] ## Not run: m <- henv(X, Y, 2) ## Not run: m L <- diag(4) R <- matrix(c(1, -1, 0), 3, 1) A <- matrix(0, 4, 1) ## Not run: test.res <- testcoef.henv(m, L, R, A) ## Not run: test.res
This function tests the null hypothesis L * beta = A versus the alternative hypothesis L * beta ~= A, where beta is estimated under the envelope model in logistic regression.
testcoef.logit.env(m, L, A)
testcoef.logit.env(m, L, A)
m |
A list containing estimators and other statistics inherited from logit.env. |
L |
The matrix multiplied to beta on the left. It is a d1 by p matrix, while d1 is less than or equal to p. |
A |
The matrix on the right hand side of the equation. It is a d1 by 1 matrix. |
Note that inputs L
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta = A, versus Ha: L beta != A. The beta is estimated by the envelope model in predictor space. If L = Ip and A = 0, then the test is equivalent to the standard F test on if beta = 0. The test statistic used is vec(L beta - A) hatSigma^-1 vec(L beta - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta - A). The reference distribution is chi-squared distribution with degrees of freedom d1.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta). |
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- as.numeric(ifelse(horseshoecrab[ , 4] > 0, 1, 0)) m <- logit.env(X, Y, 1) L <- diag(7) A <- matrix(0, 7, 1) test.res <- testcoef.logit.env(m, L, A) test.res
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- as.numeric(ifelse(horseshoecrab[ , 4] > 0, 1, 0)) m <- logit.env(X, Y, 1) L <- diag(7) A <- matrix(0, 7, 1) test.res <- testcoef.logit.env(m, L, A) test.res
This function tests the null hypothesis L * beta1 * R = A versus the alternative hypothesis L * beta1 * R ~= A, where beta is estimated under the partial envelope model.
testcoef.penv(m, L, R, A)
testcoef.penv(m, L, R, A)
m |
A list containing estimators and other statistics inherited from penv. |
L |
The matrix multiplied to beta on the left. It is a d1 by r matrix, while d1 is less than or equal to r. |
R |
The matrix multiplied to beta on the right. It is a p1 by d2 matrix, while d2 is less than or equal to p1. |
A |
The matrix on the right hand side of the equation. It is a d1 by d2 matrix. |
Note that inputs L
, R
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta1 R = A, versus Ha: L beta1 R != A. The beta is estimated by the partial envelope model. If L = Ir, R = Ip1 and A = 0, then the test is equivalent to the standard F test on if beta1 = 0. The test statistics used is vec(L beta1 R - A) hatSigma^-1 vec(L beta1 R - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta1 R - A). The reference distribution is chi-squared distribution with degrees of freedom d1 * d2.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta1 R). |
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] m <- penv(X1, X2, Y, 1) m L <- diag(4) R <- as.matrix(1) A <- matrix(0, 4, 1) test.res <- testcoef.penv(m, L, R, A) test.res
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] m <- penv(X1, X2, Y, 1) m L <- diag(4) R <- as.matrix(1) A <- matrix(0, 4, 1) test.res <- testcoef.penv(m, L, R, A) test.res
This function tests the null hypothesis L * beta = A versus the alternative hypothesis L * beta ~= A, where beta is estimated under the envelope model in poisson regression.
testcoef.pois.env(m, L, A)
testcoef.pois.env(m, L, A)
m |
A list containing estimators and other statistics inherited from pois.env. |
L |
The matrix multiplied to beta on the left. It is a d1 by p matrix, while d1 is less than or equal to p. |
A |
The matrix on the right hand side of the equation. It is a d1 by 1 matrix. |
Note that inputs L
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta = A, versus Ha: L beta != A. The beta is estimated by the envelope model in predictor space. If L = Ip and A = 0, then the test is equivalent to the standard F test on if beta = 0. The test statistic used is vec(L beta - A) hatSigma^-1 vec(L beta - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta - A). The reference distribution is chi-squared distribution with degrees of freedom d1.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta). |
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- horseshoecrab[ , 4] m <- pois.env(X, Y, 1) L <- diag(7) A <- matrix(0, 7, 1) test.res <- testcoef.pois.env(m, L, A) test.res
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- horseshoecrab[ , 4] m <- pois.env(X, Y, 1) L <- diag(7) A <- matrix(0, 7, 1) test.res <- testcoef.pois.env(m, L, A) test.res
This function tests the null hypothesis L * beta * R = A versus the alternative hypothesis L * beta * R ~= A, where beta is estimated under the reduced rank envelope model.
testcoef.rrenv(m, L, R, A)
testcoef.rrenv(m, L, R, A)
m |
A list containing estimators and other statistics inherited from rrenv. |
L |
The matrix multiplied to beta on the left. It is a d1 by r matrix, while d1 is less than or equal to r. |
R |
The matrix multiplied to beta on the right. It is a p by d2 matrix, while d2 is less than or equal to p. |
A |
The matrix on the right hand side of the equation. It is a d1 by d2 matrix. |
Note that inputs L
, R
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta R = A, versus Ha: L beta R != A. The beta is estimated by the reduced rank envelope model. If L = Ir, R = Ip and A = 0, then the test is equivalent to the standard F test on if beta = 0. The test statistic used is vec(L beta R - A) hatSigma^-1 vec(L beta R - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta R - A). The reference distribution is chi-squared distribution with degrees of freedom d1 * d2.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta R). |
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here m <- rrenv(X, Y, 4, 2) m L <- diag(4) R <- matrix(1, 11, 1) A <- matrix(0, 4, 1) test.res <- testcoef.rrenv(m, L, R, A) test.res
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here m <- rrenv(X, Y, 4, 2) m L <- diag(4) R <- matrix(1, 11, 1) A <- matrix(0, 4, 1) test.res <- testcoef.rrenv(m, L, R, A) test.res
This function tests the null hypothesis L * beta * R = A versus the alternative hypothesis L * beta * R ~= A, where beta is estimated under the reduced rank envelope model with nonconstant error variance.
testcoef.rrenv.apweights(m, L, R, A)
testcoef.rrenv.apweights(m, L, R, A)
m |
A list containing estimators and other statistics inherited from rrenv.apweights. |
L |
The matrix multiplied to beta on the left. It is a d1 by r matrix, while d1 is less than or equal to r. |
R |
The matrix multiplied to beta on the right. It is a p by d2 matrix, while d2 is less than or equal to p. |
A |
The matrix on the right hand side of the equation. It is a d1 by d2 matrix. |
Note that inputs L
, R
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta R = A, versus Ha: L beta R != A. The beta is estimated by the reduced rank envelope model that accommodates nonconstant error variance. If L = Ir, R = Ip and A = 0, then the test is equivalent to the standard F test on if beta = 0. The test statistic used is vec(L beta R - A) hatSigma^-1 vec(L beta R - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta R - A). The reference distribution is chi-squared distribution with degrees of freedom d1 * d2.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta R). |
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here ## Not run: m <- rrenv.apweights(X, Y, 3, 2) ## Not run: m L <- diag(4) R <- matrix(1, 11, 1) A <- matrix(0, 4, 1) ## Not run: test.res <- testcoef.rrenv.apweights(m, L, R, A) ## Not run: test.res
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here ## Not run: m <- rrenv.apweights(X, Y, 3, 2) ## Not run: m L <- diag(4) R <- matrix(1, 11, 1) A <- matrix(0, 4, 1) ## Not run: test.res <- testcoef.rrenv.apweights(m, L, R, A) ## Not run: test.res
This function tests the null hypothesis L * beta * R = A versus the alternative hypothesis L * beta * R ~= A, where beta is estimated under the scaled response envelope model.
testcoef.senv(m, L, R, A)
testcoef.senv(m, L, R, A)
m |
A list containing estimators and other statistics inherited from scale.env. |
L |
The matrix multiplied to beta on the left. It is a d1 by r matrix, while d1 is less than or equal to r. |
R |
The matrix multiplied to beta on the right. It is a p by d2 matrix, while d2 is less than or equal to p. |
A |
The matrix on the right hand side of the equation. It is a d1 by d2 matrix. |
Note that inputs L
, R
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta R = A, versus Ha: L beta R != A. The beta is estimated by the scaled envelope model. If L = Ir, R = Ip and A = 0, then the test is equivalent to the standard F test on if beta = 0. The test statistic used is vec(L beta R - A) hatSigma^-1 vec(L beta R - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta R - A). The reference distribution is chi-squared distribution with degrees of freedom d1 * d2.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta R). |
data(sales) X <- sales[, 1:3] Y <- sales[, 4:7] m <- senv(X, Y, 2) L <- diag(4) R <- as.matrix(c(1, 0, 0)) A <- matrix(0, 4, 1) test.res <- testcoef.senv(m, L, R, A) test.res
data(sales) X <- sales[, 1:3] Y <- sales[, 4:7] m <- senv(X, Y, 2) L <- diag(4) R <- as.matrix(c(1, 0, 0)) A <- matrix(0, 4, 1) test.res <- testcoef.senv(m, L, R, A) test.res
This function tests the null hypothesis L * beta * R = A versus the alternative hypothesis L * beta * R ~= A, where beta is estimated under the simultaneous envelope model.
testcoef.stenv(m, L, R, A)
testcoef.stenv(m, L, R, A)
m |
A list containing estimators and other statistics inherited from stenv. |
L |
The matrix multiplied to beta on the left. It is a d1 by p matrix, while d1 is less than or equal to p. |
R |
The matrix multiplied to beta on the right. It is an r by d2 matrix, while d2 is less than or equal to r. |
A |
The matrix on the right hand side of the equation. It is a d1 by d2 matrix. |
Note that inputs L
, R
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta R = A, versus Ha: L beta R != A. The beta is estimated by the simultaneous envelope model. If L = Ip, R = Ir and A = 0, then the test is equivalent to the standard F test on if beta = 0. The test statistic used is vec(L beta R - A) hatSigma^-1 vec(L beta R - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta R - A). The reference distribution is chi-squared distribution with degrees of freedom d1 * d2.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta R). |
data(fiberpaper) X <- fiberpaper[ , 5:7] Y <- fiberpaper[ , 1:4] m <- stenv(X, Y, 2, 3) L <- diag(3) R <- as.matrix(c(1, 0, 0, 0), nrow = 4) A <- matrix(0, 3, 1) test.res <- testcoef.stenv(m, L, R, A) test.res
data(fiberpaper) X <- fiberpaper[ , 5:7] Y <- fiberpaper[ , 1:4] m <- stenv(X, Y, 2, 3) L <- diag(3) R <- as.matrix(c(1, 0, 0, 0), nrow = 4) A <- matrix(0, 3, 1) test.res <- testcoef.stenv(m, L, R, A) test.res
This function tests the null hypothesis L * beta * R = A versus the alternative hypothesis L * beta * R ~= A, where beta is estimated under the scaled predictor envelope model.
testcoef.sxenv(m, L, R, A)
testcoef.sxenv(m, L, R, A)
m |
A list containing estimators and other statistics inherited from scale.xenv. |
L |
The matrix multiplied to beta on the left. It is a d1 by p matrix, while d1 is less than or equal to p. |
R |
The matrix multiplied to beta on the right. It is an r by d2 matrix, while d2 is less than or equal to r. |
A |
The matrix on the right hand side of the equation. It is a d1 by d2 matrix. |
Note that inputs L
, R
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta R = A, versus Ha: L beta R != A. The beta is estimated by the scaled envelope model in the predictor space. If L = Ip, R = Ir and A = 0, then the test is equivalent to the standard F test on if beta = 0. The test statistic used is vec(L beta R - A) hatSigma^-1 vec(L beta R - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta R - A). The reference distribution is chi-squared distribution with degrees of freedom d1 * d2.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta R). |
data(sales) Y <- sales[, 1:3] X <- sales[, 4:7] R <- rep(1, 4) u <- u.sxenv(X, Y, R) u m <- sxenv(X, Y, 2, R) L <- diag(4) R <- as.matrix(c(1, 0, 0)) A <- matrix(0, 4, 1) test.res <- testcoef.sxenv(m, L, R, A) test.res
data(sales) Y <- sales[, 1:3] X <- sales[, 4:7] R <- rep(1, 4) u <- u.sxenv(X, Y, R) u m <- sxenv(X, Y, 2, R) L <- diag(4) R <- as.matrix(c(1, 0, 0)) A <- matrix(0, 4, 1) test.res <- testcoef.sxenv(m, L, R, A) test.res
This function tests the null hypothesis L * beta * R = A versus the alternative hypothesis L * beta * R ~= A, where beta is estimated under the predictor envelope model.
testcoef.xenv(m, L, R, A)
testcoef.xenv(m, L, R, A)
m |
A list containing estimators and other statistics inherited from xenv. |
L |
The matrix multiplied to beta on the left. It is a d1 by p matrix, while d1 is less than or equal to p. |
R |
The matrix multiplied to beta on the right. It is an r by d2 matrix, while d2 is less than or equal to r. |
A |
The matrix on the right hand side of the equation. It is a d1 by d2 matrix. |
Note that inputs L
, R
and A
must be matrices, if not, use as.matrix
to convert them.
This function tests for hypothesis H0: L beta R = A, versus Ha: L beta R != A. The beta is estimated by the envelope model in predictor space. If L = Ip, R = Ir and A = 0, then the test is equivalent to the standard F test on if beta = 0. The test statistic used is vec(L beta R - A) hatSigma^-1 vec(L beta R - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta R - A). The reference distribution is chi-squared distribution with degrees of freedom d1 * d2.
The output is a list that contains following components.
chisqStatistic |
The test statistic. |
dof |
The degrees of freedom of the reference chi-squared distribution. |
pValue |
p-value of the test. |
covMatrix |
The covariance matrix of vec(L beta R). |
data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] m <- xenv(X, Y, 2) m L <- diag(6) R <- as.matrix(1) A <- matrix(0, 6, 1) test.res <- testcoef.xenv(m, L, R, A) test.res
data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] m <- xenv(X, Y, 2) m L <- diag(6) R <- as.matrix(1) A <- matrix(0, 6, 1) test.res <- testcoef.xenv(m, L, R, A) test.res
This function outputs dimensions selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) and likelihood ratio testing with specified significance level for the response envelope model.
u.env(X, Y, alpha = 0.01)
u.env(X, Y, alpha = 0.01)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
alpha |
Significance level for testing. The default is 0.01. |
u.aic |
Dimension of the envelope subspace selected by AIC. |
u.bic |
Dimension of the envelope subspace selected by BIC. |
u.lrt |
Dimension of the envelope subspace selected by the likelihood ratio testing procedure. |
loglik.seq |
Log likelihood for dimension from 0 to r. |
aic.seq |
AIC value for dimension from 0 to r. |
bic.seq |
BIC value for dimension from 0 to r. |
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] u <- u.env(X, Y) u
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] u <- u.env(X, Y) u
This function outputs dimensions selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) and likelihood ratio testing with specified significance level for the response envelope model that accommodates nonconstant variance.
u.env.apweights(X, Y, alpha = 0.01)
u.env.apweights(X, Y, alpha = 0.01)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
alpha |
Significance level for testing. The default is 0.01. |
u.aic |
Dimension of the envelope subspace selected by AIC. |
u.bic |
Dimension of the envelope subspace selected by BIC. |
u.lrt |
Dimension of the envelope subspace selected by the likelihood ratio testing procedure. |
loglik.seq |
Log likelihood for dimension from 0 to r. |
aic.seq |
AIC value for dimension from 0 to r. |
bic.seq |
BIC value for dimension from 0 to r. |
data(concrete) X <- concrete[, 1:7] Y <- concrete[, 8:10] ## Not run: u <- u.env.apweights(X, Y) ## Not run: u
data(concrete) X <- concrete[, 1:7] Y <- concrete[, 8:10] ## Not run: u <- u.env.apweights(X, Y) ## Not run: u
This function outputs dimensions selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) and likelihood ratio testing with specified significance level for the response envelope model with t-distributed errors.
u.env.tcond(X, Y, df, alpha = 0.01)
u.env.tcond(X, Y, df, alpha = 0.01)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
df |
Degrees of freedom of the t-distribution. A positive number that is greater than 2. |
alpha |
Significance level for testing. The default is 0.01. |
u.aic |
Dimension of the envelope subspace selected by AIC. |
u.bic |
Dimension of the envelope subspace selected by BIC. |
u.lrt |
Dimension of the envelope subspace selected by the likelihood ratio testing procedure. |
loglik.seq |
Log likelihood for dimension from 0 to r. |
aic.seq |
AIC value for dimension from 0 to r. |
bic.seq |
BIC value for dimension from 0 to r. |
data(concrete) X <- concrete[1:78, 1:7] # The first 78 observations are training data Y <- concrete[1:78, 8:10] ## Not run: u <- u.env.tcond(X, Y, 6) ## Not run: u
data(concrete) X <- concrete[1:78, 1:7] # The first 78 observations are training data Y <- concrete[1:78, 8:10] ## Not run: u <- u.env.tcond(X, Y, 6) ## Not run: u
This function outputs dimensions selected by Bayesian information criterion (BIC) for the Envelope-based Partial Partial Least Squares.
u.eppls(X1, X2, Y)
u.eppls(X1, X2, Y)
X1 |
An |
X2 |
An |
Y |
An |
u.bic |
Dimension of the Envelope-based Partial Partial Least Squares. |
bic.seq |
BIC value for dimension from |
Park, Y., Su, Z. and Chung, D. (2022+) Envelope-based Partial Partial Least Squares with Application to Cytokine-based Biomarker Analysis for COVID-19.
data(amitriptyline) Y <- amitriptyline[ , 1:2] X1 <- amitriptyline[ , 4:7] X2 <- amitriptyline[ , 3] u <- u.eppls(X1, X2, Y) u
data(amitriptyline) Y <- amitriptyline[ , 1:2] X1 <- amitriptyline[ , 4:7] X2 <- amitriptyline[ , 3] u <- u.eppls(X1, X2, Y) u
Fit the dimensions of the response and predictor envelopes in function-on-function linear regression, under direct estimation.
u.felmdir(X, Y, t1, t2, knots = c(0, 0.25, 0.5, 0.75, 1))
u.felmdir(X, Y, t1, t2, knots = c(0, 0.25, 0.5, 0.75, 1))
X |
Predictor function. An n by T1 matrix, T1 is number of observed time points, which is the length of t1. Here we assume that each function is observed at the same time points. |
Y |
Response function. An n by T2 matrix, T2 is number of observed time points, which is the length of t2. Here we assume that each function is observed at the same time points. |
t1 |
The observed time points for the predictor functions. |
t2 |
The observed time points for the response functions. |
knots |
The location of knots of the cubic splines used for estimation. Locations should be positive. The default location of the knots are 0, 0.25, 0.5, 0.75, 1. |
This function finds the dimension of the predictor and response envelope model by Bayesian information criterion (BIC) performed on the direct estimation. To be more specific, consider the envelope model to the function-on-function linear regression,
where X and Y are random functions in Hilbert spaces and
,
is a fixed member in
,
is a random member of
, and B:
is a linear operator. We use cubic splines as the basis for both
and
. The coefficients
and
with respect to the basis are computed. The predictor and response envelope model is fitted on the linear regression model of
on
, and the dimensions of the predictor and response envelopes are calculated using BIC. The details are included in Section 7 of Su et al. (2022).
The output is a list that contains the following components:
ux |
The estimated dimension of the predictor envelope. |
uy |
The estimated dimension of the response envelope. |
beta |
The envelope estimator of the regression coefficients in the regression of |
betafull |
The standard estimator, i.e., the OLS estimator of the regression coefficients in the regression of |
alpha |
The envelope estimator of the intercept in the regression of |
alphafull |
The standard estimator of the intercept in the regression of |
Su, Z., Li, B. and Cook, R. D. (2022+) Envelope model for function-on-function linear regression.
data(NJdata) dataX <- matrix(NJdata[,6], nrow = 21) X <- as.matrix(dataX[, 32:61]) dataY <- matrix(NJdata[,3], nrow = 21) Y <- as.matrix(dataY[, 32:61]) t1 <- 0:29 t2 <- t1 ## Not run: m <- u.felmdir(X, Y, t1, t2) ## Not run: m$ux ## Not run: m$uy
data(NJdata) dataX <- matrix(NJdata[,6], nrow = 21) X <- as.matrix(dataX[, 32:61]) dataY <- matrix(NJdata[,3], nrow = 21) Y <- as.matrix(dataY[, 32:61]) t1 <- 0:29 t2 <- t1 ## Not run: m <- u.felmdir(X, Y, t1, t2) ## Not run: m$ux ## Not run: m$uy
Fit the dimensions of the response and predictor envelopes in function-on-function linear regression, under Karhunen-Loeve expansion based estimation.
u.felmKL(X, Y, t1, t2, knots = c(0, 0.25, 0.5, 0.75, 1))
u.felmKL(X, Y, t1, t2, knots = c(0, 0.25, 0.5, 0.75, 1))
X |
Predictor function. An n by T1 matrix, T1 is number of observed time points, which is the length of t1. Here we assume that each function is observed at the same time points. |
Y |
Response function. An n by T2 matrix, T2 is number of observed time points, which is the length of t2. Here we assume that each function is observed at the same time points. |
t1 |
The observed time points for the predictor functions. |
t2 |
The observed time points for the response functions. |
knots |
The location of knots of the cubic splines used for estimation. Locations should be positive. The default location of the knots are 0, 0.25, 0.5, 0.75, 1. |
This function finds the dimension of the predictor and response envelope model by Bayesian information criterion (BIC) performed on the Karhunen-Lo'eve expansion based estimation. To be more specific, consider the envelope model to the function-on-function linear regression,
where X and Y are random functions in Hilbert spaces and
,
is a fixed member in
,
is a random member of
, and B:
is a linear operator. We use cubic splines as the basis for both
and
in the estimation of the eigenfunctions of
and
. The coefficients
and
with respect to the estimated eigenfunctions are computed. The predictor and response envelope model is fitted on the linear regression model of
on
, and the dimensions of the predictor and response envelopes are calculated using BIC. The details are included in Section 7 of Su et al. (2022).
The output is a list that contains the following components:
ux |
The estimated dimension of the predictor envelope. |
uy |
The estimated dimension of the response envelope. |
beta |
The envelope estimator of the regression coefficients in the regression of |
betafull |
The standard estimator, i.e., the OLS estimator of the regression coefficients in the regression of |
alpha |
The envelope estimator of the intercept in the regression of |
alphafull |
The standard estimator of the intercept in the regression of |
Su, Z., Li, B. and Cook, R. D. (2022+) Envelope model for function-on-function linear regression.
data(NJdata) dataX <- matrix(NJdata[,6], nrow = 21) X <- as.matrix(dataX[, 32:61]) dataY <- matrix(NJdata[,3], nrow = 21) Y <- as.matrix(dataY[, 32:61]) t1 <- 0:29 t2 <- t1 ## Not run: m <- u.felmKL(X, Y, t1, t2) ## Not run: m$ux ## Not run: m$uy
data(NJdata) dataX <- matrix(NJdata[,6], nrow = 21) X <- as.matrix(dataX[, 32:61]) dataY <- matrix(NJdata[,3], nrow = 21) Y <- as.matrix(dataY[, 32:61]) t1 <- 0:29 t2 <- t1 ## Not run: m <- u.felmKL(X, Y, t1, t2) ## Not run: m$ux ## Not run: m$uy
This function outputs dimensions selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) and likelihood ratio testing with specified significance level for the groupwise envelope model.
u.genv(X, Y, Z, alpha = 0.01)
u.genv(X, Y, Z, alpha = 0.01)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
Z |
A group indicator vector of length |
alpha |
Significance level for testing. The default is 0.01. |
u.aic |
Dimension of the groupwise envelope subspace selected by AIC. |
u.bic |
Dimension of the groupwise envelope subspace selected by BIC. |
u.lrt |
Dimension of the groupwise envelope subspace selected by the likelihood ratio testing procedure. |
loglik.seq |
Log likelihood for dimension from 0 to r. |
aic.seq |
AIC value for dimension from 0 to r. |
bic.seq |
BIC value for dimension from 0 to r. |
data(fiberpaper) X <- fiberpaper[ , c(5, 7)] Y <- fiberpaper[ , 1:3] Z <- as.numeric(fiberpaper[ , 6] > mean(fiberpaper[ , 6])) u <- u.genv(X, Y, Z) u
data(fiberpaper) X <- fiberpaper[ , c(5, 7)] Y <- fiberpaper[ , 1:3] Z <- as.numeric(fiberpaper[ , 6] > mean(fiberpaper[ , 6])) u <- u.genv(X, Y, Z) u
This function outputs dimensions selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) and likelihood ratio testing with specified significance level for the heteroscedastic envelope model.
u.henv(X, Y, alpha = 0.01)
u.henv(X, Y, alpha = 0.01)
X |
A group indicator vector of length |
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. |
alpha |
Significance level for testing. The default is 0.01. |
u.aic |
Dimension of the heteroscedastic envelope subspace selected by AIC. |
u.bic |
Dimension of the heteroscedastic envelope subspace selected by BIC. |
u.lrt |
Dimension of the heteroscedastic envelope subspace selected by the likelihood ratio testing procedure. |
loglik.seq |
Log likelihood for dimension from 0 to r. |
aic.seq |
AIC value for dimension from 0 to r. |
bic.seq |
BIC value for dimension from 0 to r. |
data(waterstrider) X <- waterstrider[ , 1] Y <- waterstrider[ , 2:5] ## Not run: u <- u.henv(X, Y) ## Not run: u
data(waterstrider) X <- waterstrider[ , 1] Y <- waterstrider[ , 2:5] ## Not run: u <- u.henv(X, Y) ## Not run: u
This function outputs dimensions selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) and likelihood ratio testing with specified significance level for the envelope model in logistic regression.
u.logit.env(X, Y, alpha = 0.01)
u.logit.env(X, Y, alpha = 0.01)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Response. An n by 1 matrix. The univariate response must be binary. |
alpha |
Significance level for testing. The default is 0.01. |
u.aic |
Dimension of the envelope subspace selected by AIC. |
u.bic |
Dimension of the envelope subspace selected by BIC. |
u.lrt |
Dimension of the envelope subspace selected by the likelihood ratio testing procedure. |
loglik.seq |
Log likelihood for dimension from 0 to p. |
aic.seq |
AIC value for dimension from 0 to p. |
bic.seq |
BIC value for dimension from 0 to p. |
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- as.numeric(ifelse(horseshoecrab[ , 4] > 0, 1, 0)) ## Not run: u <- u.logit.env(X, Y) ## Not run: u
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- as.numeric(ifelse(horseshoecrab[ , 4] > 0, 1, 0)) ## Not run: u <- u.logit.env(X, Y) ## Not run: u
This function outputs dimensions selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) and likelihood ratio testing with specified significance level for the partial envelope model.
u.penv(X1, X2, Y, alpha = 0.01)
u.penv(X1, X2, Y, alpha = 0.01)
X1 |
Predictors of main interest. An n by p1 matrix, n is the number of observations, and p1 is the number of main predictors. The predictors can be univariate or multivariate, discrete or continuous. |
X2 |
Covariates, or predictors not of main interest. An n by p2 matrix, p2 is the number of covariates. |
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. |
alpha |
Significance level for testing. The default is 0.01. |
u.aic |
Dimension of the partial envelope subspace selected by AIC. |
u.bic |
Dimension of the partial envelope subspace selected by BIC. |
u.lrt |
Dimension of the partial envelope subspace selected by the likelihood ratio testing procedure. |
loglik.seq |
Log likelihood for dimension from 0 to r. |
aic.seq |
AIC value for dimension from 0 to r. |
bic.seq |
BIC value for dimension from 0 to r. |
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] u <- u.penv(X1, X2, Y) u
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] u <- u.penv(X1, X2, Y) u
This function outputs dimensions selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) and likelihood ratio testing with specified significance level for the envelope model in poisson regression.
u.pois.env(X, Y, alpha = 0.01)
u.pois.env(X, Y, alpha = 0.01)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Response. An n by 1 matrix. The univariate response must be counts. |
alpha |
Significance level for testing. The default is 0.01. |
u.aic |
Dimension of the envelope subspace selected by AIC. |
u.bic |
Dimension of the envelope subspace selected by BIC. |
u.lrt |
Dimension of the envelope subspace selected by the likelihood ratio testing procedure. |
loglik.seq |
Log likelihood for dimension from 0 to p. |
aic.seq |
AIC value for dimension from 0 to p. |
bic.seq |
BIC value for dimension from 0 to p. |
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- horseshoecrab[ , 4] ## Not run: u <- u.pois.env(X, Y) ## Not run: u
data(horseshoecrab) X1 <- as.numeric(horseshoecrab[ , 1] == 2) X2 <- as.numeric(horseshoecrab[ , 1] == 3) X3 <- as.numeric(horseshoecrab[ , 1] == 4) X4 <- as.numeric(horseshoecrab[ , 2] == 2) X5 <- as.numeric(horseshoecrab[ , 2] == 3) X6 <- horseshoecrab[ , 3] X7 <- horseshoecrab[ , 5] X <- cbind(X1, X2, X3, X4, X5, X6, X7) Y <- horseshoecrab[ , 4] ## Not run: u <- u.pois.env(X, Y) ## Not run: u
This function outputs dimensions selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) and likelihood ratio testing with specified significance level for the constructed partial envelope model.
u.pred2.env(X, Y, Xnew, alpha = 0.01)
u.pred2.env(X, Y, Xnew, alpha = 0.01)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
alpha |
Significance level for testing. The default is 0.01. |
u.aic |
Dimension of the constructed partial envelope subspace selected by AIC. |
u.bic |
Dimension of the constructed partial envelope subspace selected by BIC. |
u.lrt |
Dimension of the constructed partial envelope subspace selected by the likelihood ratio testing procedure. |
loglik.seq |
Log likelihood for dimension from 0 to r. |
aic.seq |
AIC value for dimension from 0 to r. |
bic.seq |
BIC value for dimension from 0 to r. |
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] u <- u.pred2.env(X, Y, X[10, ]) u
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] u <- u.pred2.env(X, Y, X[10, ]) u
This function outputs the envelope dimension selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) and likelihood ratio testing with specified significance level for the reduced rank envelope model.
u.rrenv(X, Y, d, alpha = 0.01)
u.rrenv(X, Y, d, alpha = 0.01)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
d |
The rank of the coefficient matrix. An integer between 0 and r. |
alpha |
Significance level for testing. The default is 0.01. |
u.aic |
Dimension of the envelope subspace selected by AIC. |
u.bic |
Dimension of the envelope subspace selected by BIC. |
u.lrt |
Dimension of the envelope subspace selected by the likelihood ratio testing procedure. |
loglik.seq |
Log likelihood for dimension from d to r. |
aic.seq |
AIC value for dimension from d to r. |
bic.seq |
BIC value for dimension from d to r. |
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here d <- d.select(X, Y, 0.01) d ## Not run: u <- u.rrenv(X, Y, 2) ## Not run: u
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here d <- d.select(X, Y, 0.01) d ## Not run: u <- u.rrenv(X, Y, 2) ## Not run: u
This function outputs the envelope dimension selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) and likelihood ratio testing with specified significance level for the reduced rank envelope model with nonconstant error variance.
u.rrenv.apweights(X, Y, d, alpha = 0.01)
u.rrenv.apweights(X, Y, d, alpha = 0.01)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
d |
The rank of the coefficient matrix. An integer between 0 and r. |
alpha |
Significance level for testing. The default is 0.01. |
u.aic |
Dimension of the envelope subspace selected by AIC. |
u.bic |
Dimension of the envelope subspace selected by BIC. |
u.lrt |
Dimension of the envelope subspace selected by the likelihood ratio testing procedure. |
loglik.seq |
Log likelihood for dimension from d to r. |
aic.seq |
AIC value for dimension from d to r. |
bic.seq |
BIC value for dimension from d to r. |
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here d <- d.select(X, Y, 0.01) d ## Not run: u <- u.rrenv.apweights(X, Y, 2) ## Not run: u
data(vehicles) X <- vehicles[, 1:11] Y <- vehicles[, 12:15] X <- scale(X) Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here d <- d.select(X, Y, 0.01) d ## Not run: u <- u.rrenv.apweights(X, Y, 2) ## Not run: u
This function outputs dimensions selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) for the scaled response envelope model.
u.senv(X, Y)
u.senv(X, Y)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
u.aic |
Dimension of the scaled envelope subspace selected by AIC. |
u.bic |
Dimension of the scaled envelope subspace selected by BIC. |
aic.seq |
AIC value for dimension from 0 to r. |
bic.seq |
BIC value for dimension from 0 to r. |
data(sales) X <- sales[, 1:3] Y <- sales[, 4:7] u <- u.senv(X, Y) u
data(sales) X <- sales[, 1:3] Y <- sales[, 4:7] u <- u.senv(X, Y) u
This function outputs dimensions selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) and likelihood ratio testing with specified significance level for the simultaneous envelope model.
u.stenv(X, Y, alpha = 0.01)
u.stenv(X, Y, alpha = 0.01)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
alpha |
Significance level for testing. The default is 0.01. |
d |
Rank of beta selected by the Bura-Cook estimator. |
u.aic |
Dimension of the simultaneous envelope subspace selected by AIC. |
u.bic |
Dimension of the simultaneous envelope subspace selected by BIC. |
u.lrt |
Dimension of the simultaneous envelope subspace selected by the likelihood ratio testing procedure. |
loglik.mat |
Log likelihood for dimension from (1, 1) to (p, r). |
aic.mat |
AIC value for dimension from (1, 1) to (p, r). |
bic.mat |
BIC value for dimension from (1, 1) to (p, r). |
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] u <- u.stenv(X, Y) u
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] u <- u.stenv(X, Y) u
This function outputs dimensions selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) for the scaled predictor envelope model.
u.sxenv(X, Y, R)
u.sxenv(X, Y, R)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
R |
The number of replications of the scales. A vector, the sum of all elements of R must be p. |
u.aic |
Dimension of the scaled envelope subspace in the predictor space selected by AIC. |
u.bic |
Dimension of the scaled envelope subspace in the predictor space selected by BIC. |
aic.seq |
AIC value for dimension from 0 to p. |
bic.seq |
BIC value for dimension from 0 to p. |
data(sales) Y <- sales[, 1:3] X <- sales[, 4:7] R <- rep(1, 4) u <- u.sxenv(X, Y, R) u
data(sales) Y <- sales[, 1:3] X <- sales[, 4:7] R <- rep(1, 4) u <- u.sxenv(X, Y, R) u
This function outputs dimensions selected by Akaike information criterion (AIC), Bayesian information criterion (BIC) and likelihood ratio testing with specified significance level for the predictor envelope model.
u.xenv(X, Y, alpha = 0.01)
u.xenv(X, Y, alpha = 0.01)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Responses. An n by r matrix, r is the number of responses. The response can be univariate or multivariate and must be continuous variable. |
alpha |
Significance level for testing. The default is 0.01. |
u.aic |
Dimension of the envelope subspace selected by AIC. |
u.bic |
Dimension of the envelope subspace selected by BIC. |
u.lrt |
Dimension of the envelope subspace selected by the likelihood ratio testing procedure. |
loglik.seq |
Log likelihood for dimension from 0 to p. |
aic.seq |
AIC value for dimension from 0 to p. |
bic.seq |
BIC value for dimension from 0 to p. |
data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] u <- u.xenv(X, Y) u
data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] u <- u.xenv(X, Y) u
This dataset consists of 15 characteristics for 30 vehicles.
data("vehicles")
data("vehicles")
A data frame with 30 entries on the following 15 variables.
turbo
Indicator for vehicles with turbo aspiration.
two.doors
Indicator for vehicles with two doors.
hatchback
Indicator for hatchback vehicles.
wheel.base
Wheelbase of the vehicle.
length
Length of the vehicle.
width
Width of the vehicle.
height
Height of the vehicle.
curb.weight
Curb weight of the vehicle.
eng.size
Engine size of the vehicle.
horsepower
Horsepower of the vehicle.
peak.rpm
Peak revolutions per minute.
price
Price in dollars.
symbol
Insurance risk rating. A value of +3 indicates that the auto is risky, -3 that it is probably pretty safe.
city.mpg
Fuel efficiency in city.
highway.mpg
Fuel efficiency in highway.
This dataset is a subset of the vehicles dataset in the R package plsdepot.
1) 1985 Model Import Car and Truck Specifications, 1985 Ward's Automotive Yearbook. 2) Personal Auto Manuals, Insurance Services Office, 160 Water Street, New York, NY 10038. 3) Insurance Collision Report, Insurance Institute for Highway Safety, Watergate 600, Washington, DC 20037.
Machine Learning Repository. http://archive.ics.uci.edu/ml/datasets/Automobile
Measures of characteristics of the water striders
data("waterstrider")
data("waterstrider")
A data frame with 90 observations on the following 9 variables.
V1
Index of water strider species.
V2
Logarithm of length of the first antennal segment.
V3
Logarithm of length of the second antennal segment.
V4
Logarithm of length of the third antennal segment.
V5
Logarithm of length of the fourth antennal segment.
V6
Logarithm of length of fomora of middle leg.
V7
Logarithm of length of tibiae of middle leg.
V8
Logarithm of length of fomora of hind leg.
V9
Logarithm of length of tibiae of hind leg.
This data set contains 8 measures of water striders and an indicator of the species of water striders.
Klingenberg, C. R. and Spence, J. R. (1993). Heterochrony and Allometry Lessons from the Water Strider Genus Limnoporus. Evolution 47, 1834-1853
Compute the weighted response envelope estimator with weights computed from BIC.
weighted.env(X, Y, bstrpNum = 0, min.u = 1, max.u = ncol(as.matrix(Y)), boot.resi = "full")
weighted.env(X, Y, bstrpNum = 0, min.u = 1, max.u = ncol(as.matrix(Y)), boot.resi = "full")
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
bstrpNum |
Number of bootstrap samples. A positive integer. |
min.u |
Lower bound of the range of u to compute bootstrap error. A postive integer between 1 and p. This argument is relevant only when |
max.u |
Upper bound of the range of u to compute bootstrap error. A postive integer between 1 and p. This argument is relevant only when |
boot.resi |
A string that can be "full" or "weighted" indicating the model from which the residuals are calculated. If the input is "full", then the residuals are obtained using the standard estimators; and if the input is "weighted", then the residuals are obtained using the weighted envelope estimators. This argument is for computing residuals in residual bootstrap, and it is relevant only when |
This function computes the weighted envelope estimator in a standard multivariate linear regression. And the weighted envelope estimator takes the form
where is the envelope estimator of
with
and
's are the weights computed from BIC values
where is the BIC criterion evaluated at the envelope estimator
. For details, see Eck and Cook (2017).
The variation of the weighted envelope estimator is estimated by residual bootstrap. The user can specify the range for bootstrap (
min.u
, max.u
), if the weights outside of the range are small.
The output is a list that contains the following components:
beta |
The weighted envelope estimator of the regression coefficients. |
mu |
The weighted estimated intercept. |
Sigma |
The weighted envelope estimator of the error covariance matrix. |
w |
Weights computed based on BIC. |
loglik |
The log likelihood function computed with weighted envelope estimator. |
n |
The number of observations in the data. |
bootse |
The standard error for elements in beta computed by residual bootstrap. This output is available only when |
ratios |
The boostrap standard error ratio of the standard multivariate linear regression estimator over the weighted envelope estimator for each element in beta. This output is available only when |
bic_select |
A table that lists how many times BIC selected each candidate dimension. If BIC never selects a dimension, this dimension does not appear on the table. This output is available only when |
Eck, D. J. and Cook, R. D. (2017). Weighted Envelope Estimation to Handle Variability in Model Selection. Biometrika. To appear.
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] m <- weighted.env(X, Y) m$w m$beta ## Not run: m2 <- weighted.env(X, Y, bstrpNum = 100, min.u = 1, max.u = 6, boot.resi = "full") ## Not run: m2$bic_select ## Not run: m2$bootse
data(wheatprotein) X <- wheatprotein[, 8] Y <- wheatprotein[, 1:6] m <- weighted.env(X, Y) m$w m$beta ## Not run: m2 <- weighted.env(X, Y, bstrpNum = 100, min.u = 1, max.u = 6, boot.resi = "full") ## Not run: m2$bic_select ## Not run: m2$bootse
Compute the weighted partial envelope estimator with weights computed from BIC.
weighted.penv(X1, X2, Y, bstrpNum = 0, min.u = 1, max.u = ncol(as.matrix(Y)), boot.resi = "full")
weighted.penv(X1, X2, Y, bstrpNum = 0, min.u = 1, max.u = ncol(as.matrix(Y)), boot.resi = "full")
X1 |
Predictors of main interest. An n by p1 matrix, n is the number of observations, and p1 is the number of main predictors. The predictors can be univariate or multivariate, discrete or continuous. |
X2 |
Covariates, or predictors not of main interest. An n by p2 matrix, p2 is the number of covariates. |
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. |
bstrpNum |
Number of bootstrap samples. A positive integer. |
min.u |
Lower bound of the range of u to compute bootstrap error. A postive integer between 1 and p. This argument is relevant only when |
max.u |
Upper bound of the range of u to compute bootstrap error. A postive integer between 1 and p. This argument is relevant only when |
boot.resi |
A string that can be "full" or "weighted" indicating the model from which the residuals are calculated. If the input is "full", then the residuals are obtained using the standard estimators; and if the input is "weighted", then the residuals are obtained using the weighted envelope estimators. This argument is for computing residuals in residual bootstrap, and it is relevant only when |
This function computes the weighted partial envelope estimator in a standard multivariate linear regression. And the weighted partial envelope estimator takes the form
where is the partial envelope estimator of
with
and
's are the weights computed from BIC values
where is the BIC criterion evaluated at the partial envelope estimator
. For details, see Eck and Cook (2017).
The variation of the weighted partial envelope estimator is estimated by residual bootstrap. The user can specify the range for bootstrap (
min.u
, max.u
), if the weights outside of the range are small.
The output is a list that contains the following components:
beta |
The weighted partial envelope estimator of the regression coefficients. |
mu |
The weighted estimated intercept. |
Sigma |
The weighted partial envelope estimator of the error covariance matrix. |
w |
Weights computed based on BIC. |
loglik |
The log likelihood function computed with weighted partial envelope estimator. |
n |
The number of observations in the data. |
bootse |
The standard error for elements in beta1 computed by residual bootstrap. This output is available only when |
ratios |
The boostrap standard error ratio of the standard multivariate linear regression estimator over the weighted partial envelope estimator for each element in beta1. This output is available only when |
bic_select |
A table that lists how many times BIC selected each candidate dimension. If BIC never selects a dimension, this dimension does not appear on the table. This output is available only when |
Eck, D. J. and Cook, R. D. (2017). Weighted Envelope Estimation to Handle Variability in Model Selection. Biometrika. To appear.
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] m <- weighted.penv(X1, X2, Y) m$w m$beta1 m2 <- penv(X1, X2, Y, 2) m2$beta1 ## Not run: m3 <- weighted.penv(X1, X2, Y, bstrpNum = 100, boot.resi = "full") ## Not run: m3$w ## Not run: m3$bic_select ## Not run: m3$bootse ## Not run: boot.penv(X1, X2, Y, 2, 100)
data(fiberpaper) X1 <- fiberpaper[, 7] X2 <- fiberpaper[, 5:6] Y <- fiberpaper[, 1:4] m <- weighted.penv(X1, X2, Y) m$w m$beta1 m2 <- penv(X1, X2, Y, 2) m2$beta1 ## Not run: m3 <- weighted.penv(X1, X2, Y, bstrpNum = 100, boot.resi = "full") ## Not run: m3$w ## Not run: m3$bic_select ## Not run: m3$bootse ## Not run: boot.penv(X1, X2, Y, 2, 100)
Perform estimation or prediction through weighted partial envelope model.
weighted.pred.env(X, Y, Xnew)
weighted.pred.env(X, Y, Xnew)
X |
Predictors. An n by p matrix, p is the number of predictors. The predictors can be univariate or multivariate, discrete or continuous. |
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. |
Xnew |
The value of X with which to estimate or predict Y. A p dimensional vector. |
This function evaluates the envelope model at new value Xnew. It can perform estimation: find the fitted value when X = Xnew, or prediction: predict Y when X = Xnew. But it does not provide the estimation or prediction error. This function performs prediction using the same procedure as in pred2.env, except that the partial envelope estimator with dimension u is replaced by a weighted partial envelope estimator. The weights are decided based on BIC values.
value |
The fitted value or the predicted value evaluated at Xnew. |
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] ## Not run: pred.res <- weighted.pred.env(X, Y, X[10, ])
data(fiberpaper) X <- fiberpaper[, 5:7] Y <- fiberpaper[, 1:4] ## Not run: pred.res <- weighted.pred.env(X, Y, X[10, ])
Compute the weighted predictor envelope estimator with weights computed from BIC.
weighted.xenv(X, Y, bstrpNum = 0, min.u = 1, max.u = ncol(as.matrix(X)), boot.resi = "full")
weighted.xenv(X, Y, bstrpNum = 0, min.u = 1, max.u = ncol(as.matrix(X)), boot.resi = "full")
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Responses. An n by r matrix, r is the number of responses. The response can be univariate or multivariate and must be continuous variable. |
bstrpNum |
Number of bootstrap samples. A positive integer. |
min.u |
Lower bound of the range of u to compute bootstrap error. A postive integer between 1 and p. This argument is relevant only when |
max.u |
Upper bound of the range of u to compute bootstrap error. A postive integer between 1 and p. This argument is relevant only when |
boot.resi |
A string that can be "full" or "weighted" indicating the model from which the residuals are calculated. If the input is "full", then the residuals are obtained using the standard estimators; and if the input is "weighted", then the residuals are obtained using the weighted predictor envelope estimators. This argument is for computing residuals in residual bootstrap, and it is relevant only when |
This function computes the weighted predictor envelope estimator in a standard multivariate linear regression. And the weighted predictor envelope estimator takes the form
where is the predictor envelope estimator of
with
and
's are the weights computed from BIC values
where is the BIC criterion evaluated at the predictor envelope estimator
. For details, see Eck and Cook (2017).
The variation of the weighted predictor envelope estimator is estimated by residual bootstrap. The user can specify the range for bootstrap (
min.u
, max.u
), if the weights outside of the range are small.
The output is a list that contains the following components:
beta |
The weighted predictor envelope estimator of the regression coefficients. |
mu |
The weighted estimated intercept. |
SigmaX |
The weighted predictor envelope estimator of the covariance matrix of X. |
SigmaYcX |
The weighted predictor envelope estimator of the error covariance matrix. |
w |
Weights computed based on BIC. |
loglik |
The log likelihood function computed with weighted predictor envelope estimator. |
n |
The number of observations in the data. |
bootse |
The standard error for elements in beta computed by residual bootstrap. This output is available only when |
ratios |
The boostrap standard error ratio of the standard multivariate linear regression estimator over the weighted predictor envelope estimator for each element in beta. This output is available only when |
bic_select |
A table that lists how many times BIC selected each candidate dimension. If BIC never selects a dimension, this dimension does not appear on the table. This output is available only when |
Eck, D. J. and Cook, R. D. (2017). Weighted Envelope Estimation to Handle Variability in Model Selection. Biometrika. To appear.
data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] m <- weighted.xenv(X, Y) m$w m$beta ## Not run: m2 <- weighted.xenv(X, Y, bstrpNum = 100, min.u = 2, max.u = 4, boot.resi = "full") ## Not run: m2$w ## Not run: m2$bootse
data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] m <- weighted.xenv(X, Y) m$w m$beta ## Not run: m2 <- weighted.xenv(X, Y, bstrpNum = 100, min.u = 2, max.u = 4, boot.resi = "full") ## Not run: m2$w ## Not run: m2$bootse
The protein content of ground wheat samples.
data(wheatprotein)
data(wheatprotein)
A data frame with 50 observations on the following 8 variables.
V1
Measurements of the reflectance of NIR radiation by the wheat samples at 1680nm. The measurements were made on the log(1/reflectance) scale.
V2
Measurements of the reflectance of NIR radiation by the wheat samples at 1806nm.
V3
Measurements of the reflectance of NIR radiation by the wheat samples at 1932nm.
V4
Measurements of the reflectance of NIR radiation by the wheat samples at 2058nm.
V5
Measurements of the reflectance of NIR radiation by the wheat samples at 2184nm.
V6
Measurements of the reflectance of NIR radiation by the wheat samples at 2310nm.
V7
The protein content of each sample (in percent).
V8
Binary indicator, 0 for high protein content and 1 for low protein content. The cut off point is if the protein content is smaller than 9.75.
The data are the result of an experiment to calibrate a near infrared reflectance (NIR) instrument for measuring the protein content of ground wheat samples. The protein content of each sample (in percent) was measured by the standard Kjeldahl method. In Fearn (1983), the problem is to find a linear combination of the measurements that predicts protein content. The estimated coefficients can then be entered into the instrument allowing the protein content of future samples to be read directly. The first 24 cases were used for calibration and the last 26 samples were used for prediction.
Fearn, T. (1983). A misuse of ridge regression in the calibration of a near infrared reflectance instrument.
Fit the predictor envelope model in linear regression with dimension u.
xenv(X, Y, u, asy = TRUE, init = NULL)
xenv(X, Y, u, asy = TRUE, init = NULL)
X |
Predictors. An n by p matrix, p is the number of predictors and n is number of observations. The predictors must be continuous variables. |
Y |
Responses. An n by r matrix, r is the number of responses. The response can be univariate or multivariate and must be continuous variable. |
u |
Dimension of the envelope. An integer between 0 and p. |
asy |
Flag for computing the asymptotic variance of the envelope estimator. The default is |
init |
The user-specified value of Gamma for the envelope subspace in the predictor space. An p by u matrix. The default is the one generated by function envMU. |
This function fits the envelope model in the predictor space,
using the maximum likelihood estimation. When the dimension of the envelope is between 1 and p-1, the starting value and blockwise coordinate descent algorithm in Cook et al. (2016) is implemented. When the dimension is p, 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.
The output is a list that contains the following components:
beta |
The envelope estimator of the regression coefficients. |
SigmaX |
The envelope estimator of the covariance matrix of X. |
Gamma |
An orthonormal basis of the envelope subspace. |
Gamma0 |
An orthonormal basis of the complement of the envelope subspace. |
eta |
The estimated eta. According to the envelope parameterization, beta = Gamma * Omega^-1 * eta. |
Omega |
The coordinates of SigmaX with respect to Gamma. |
Omega0 |
The coordinates of SigmaX with respect to Gamma0. |
mu |
The estimated intercept. |
SigmaYcX |
The estimated conditional covariance matrix of Y given X. |
loglik |
The maximized log likelihood function. |
covMatrix |
The asymptotic covariance of vec(beta). The covariance matrix returned are asymptotic. For the actual standard errors, multiply by 1 / n. |
asySE |
The asymptotic standard error for elements in beta under the envelope model. The standard errors returned are asymptotic, for actual standard errors, multiply by 1 / sqrt(n). |
ratio |
The asymptotic standard error ratio of the standard multivariate linear regression estimator over the envelope estimator, for each element in beta. |
n |
The number of observations in the data. |
Cook, R. D., Helland, I. S. and Su, Z. (2013). Envelopes and Partial Least Squares Re- gression. Journal of the Royal Statistical Society: Series B 75, 851 - 877.
Cook, R. D., Forzani, L. and Su, Z. (2016) A Note on Fast Envelope Estimation. Journal of Multivariate Analysis. 150, 42-54.
simpls.fit
for partial least squares (PLS).
## Fit the envelope in the predictor space data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] u <- u.xenv(X, Y) u m <- xenv(X, Y, 4) m m$beta ## Fit the partial least squares ## Not run: m1 <- pls::simpls.fit(X, Y, 4) ## Not run: m1$coefficients
## Fit the envelope in the predictor space data(wheatprotein) X <- wheatprotein[, 1:6] Y <- wheatprotein[, 7] u <- u.xenv(X, Y) u m <- xenv(X, Y, 4) m m$beta ## Fit the partial least squares ## Not run: m1 <- pls::simpls.fit(X, Y, 4) ## Not run: m1$coefficients