| Statistics Toolbox™ | ![]() |
b = mvregress(X,Y)
[b,SIGMA] = mvregress(X,Y)
[b,SIGMA,RESID] = mvregress(X,Y)
[b,SIGMA,RESID,COVB] = mvregress(...)
[b,SIGMA,RESID,objective] = mvregress(...)
[...] = mvregress(X,Y,param1,val1,param2,val2,...)
b = mvregress(X,Y) returns a vector b of coefficient estimates for a multivariate regression of the d-dimensional responses in Y on the predictors in X. If d = 1, X can be an n-by-p matrix of p predictors at each of n observations. If d ≥ 1, X can be a cell array of length n, with each cell containing a d-by-p design matrix for one multivariate observation. If all observations have the same d-by-p design matrix, X can be a single cell. Y is n-by-d. b is p-by-1.
Note To include a constant term in a model, X should contain a column of 1s. |
mvregress treats NaNs in X or Y as missing values. Missing values in X are ignored. Missing values in Y are handled according to the value of the 'algorithm' parameter described below.
[b,SIGMA] = mvregress(X,Y) also returns a d-by-d matrix SIGMA for the estimated covariance of Y.
[b,SIGMA,RESID] = mvregress(X,Y) also returns an n-by-d matrix RESID of residuals.
The RESID values corresponding to missing values in Y are the differences between the conditionally imputed values for Y and the fitted values. The SIGMA estimate is not the sample covariance matrix of the RESID matrix.
[b,SIGMA,RESID,COVB] = mvregress(...) also returns a matrix COVB for the estimated covariance the coefficients. By default, or if the 'varformat' parameter is 'beta' (see below), COVB is the estimated covariance matrix of b. If the 'varformat' parameter is 'full', COVB is the combined estimated covariance matrix for beta and SIGMA.
[b,SIGMA,RESID,objective] = mvregress(...) also returns the value of the objective function, or log likelihood, objective, after the last iteration.
[...] = mvregress(X,Y,param1,val1,param2,val2,...) specifies additional parameter name/value pairs chosen from the following:
'algorithm' — Either 'ecm' to compute the maximum likelihood estimates via the ECM algorithm, 'cwls' to perform least squares (optionally conditionally weighted by an input covariance matrix), or 'mvn' to omit observations with missing data and compute the ordinary multivariate normal estimates. The default is 'mvn' for complete data, 'ecm' for missing data when the sample size is sufficient to estimate all parameters, and 'cwls' otherwise.
'covar0' — A d-by-d matrix to be used as the initial estimate for SIGMA. The default is the identity matrix. For the 'cwls' algorithm, this matrix is usually a diagonal matrix used as a weighting at each iteration. The 'cwls' algorithm uses the initial value of SIGMA at each iteration, without changing it.
'covtype' — Either 'full', to allow a full covariance matrix, or 'diagonal', to restrict the covariance matrix to be diagonal. The default is 'full'.
'maxiter' — Maximum number of iterations. The default is 100.
'outputfcn' — An output function called with three arguments:
1. A vector of current parameter estimates.
2. A structure with fields 'Covar' for the current value of the covariance matrix, 'iteration' for the current iteration number, and 'fval' for the current value of the objective function.
3. A text string that is 'init' when called during initialization, 'iter' when called after an iteration, and 'done' when called after completion.
The function should return logical true if the iterations should stop, or logical false if they should continue.
'param0' — A vector of p elements to be used as the initial estimate for b. Default is a zero vector. Not used for the 'mvn' algorithm.
'tolbeta' — Convergence tolerance for b. The default is sqrt(eps). Iterations continue until the tolbeta and tolobj conditions are met. The test for convergence at iteration k is
norm(b(k)-b(k-1)) < sqrt(p)*tolbeta*(1+norm(b(k)))
where p = length(b).
'tolobj' — Convergence tolerance for changes in the objective function. The default is eps^(3/4). The test is
abs(obj(k)-obj(k-1)) < tolobj*(1+abs(obj(k)))
where obj is the objective function. If both tolobj and tolbeta are 0, the function performs maxiter iterations with no convergence test.
'varformat' — Either 'beta' to compute COVB for b only (default), or 'full' to compute COVB for both b and SIGMA.
'vartype' — Either 'hessian' to compute COVB using the Hessian or observed information (default), or 'fisher' to compute COVB using the complete-data Fisher or expected information. The 'hessian' method takes into account the increased uncertainties due to missing data, while the 'fisher' method does not.
[1] Little, Roderick J. A., and Donald B. Rubin. Statistical Analysis with Missing Data. 2nd ed., Hoboken, NJ: John Wiley & Sons, Inc., 2002.
[2] Meng, Xiao-Li, and Donald B. Rubin. "Maximum Likelihood Estimation via the ECM Algorithm." Biometrika. Vol. 80, No. 2, 1993, pp. 267–278.
[3] Sexton, Joe, and A. R. Swensen. "ECM Algorithms that Converge at the Rate of EM." Biometrika. Vol. 87, No. 3, 2000, pp. 651–662.
[4] Dempster, A. P., N. M. Laird, and D. B. Rubin. "Maximum Likelihood from Incomplete Data via the EM Algorithm." Journal of the Royal Statistical Society. Series B, Vol. 39, No. 1, 1977, pp. 1–37.
![]() | mvnpdf | mvregresslike | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |