Previous: Nonlinear Programming, Up: Optimization

— Function File: [`beta`, `v`, `r`] = **gls** (`y, x, o`)

Generalized least squares estimation for the multivariate model y = x b + e with mean (e) = 0 and cov (vec (e)) = (s^2) o, where y is a t by p matrix, x is a t by k matrix, b is a k by p matrix, e is a t by p matrix, and o is a t p by t p matrix.

Each row of

yandxis an observation and each column a variable. The return valuesbeta,v, andrare defined as follows.

beta- The GLS estimator for b.
v- The GLS estimator for s^2.
r- The matrix of GLS residuals, r = y - x beta.

— Function File: [`beta`, `sigma`, `r`] = **ols** (`y, x`)

Ordinary least squares estimation for the multivariate model y = x b + e with mean (e) = 0 and cov (vec (e)) = kron (s, I). where y is a t by p matrix, x is a t by k matrix, b is a k by p matrix, and e is a t by p matrix.

Each row of

yandxis an observation and each column a variable.The return values

beta,sigma, andrare defined as follows.

beta- The OLS estimator for
b,beta`= pinv (`

x`) *`

y, where`pinv (`

x`)`

denotes the pseudoinverse ofx.sigma- The OLS estimator for the matrix
s,sigma= (y-x*beta)' * (y-x*beta) / (t-rank(x))r- The matrix of OLS residuals,
r`=`

y`-`

x`*`

beta.