Go to the first, previous, next, last section, table of contents.
@anchor{doc-gls}
- Function File: [beta, v, r] = gls (y, x, o)
- 
Generalized least squares estimation for the multivariate model
@math{y = x b + e} with @math{mean (e) = 0} and
@math{cov (vec (e)) = (s^2) o},
 where
@math{y} is a @math{t} by @math{p} matrix, @math{x} is a @math{t} by
@math{k} matrix, @math{b} is a @math{k} by @math{p} matrix, @math{e}
is a @math{t} by @math{p} matrix, and @math{o} is a @math{t p} by
@math{t p} matrix.
Each row of y and x is an observation and each column a
variable.  The return values beta, v, and r are
defined as follows.
 
- beta
- 
The GLS estimator for @math{b}.
- v
- 
The GLS estimator for @math{s^2}.
- r
- 
The matrix of GLS residuals, @math{r = y - x beta}.
 
@anchor{doc-ols}
- Function File: [beta, sigma, r] = ols (y, x)
- 
Ordinary least squares estimation for the multivariate model
@math{y = x b + e} with
@math{mean (e) = 0} and @math{cov (vec (e)) = kron (s, I)}.
 where
@math{y} is a @math{t} by @math{p} matrix, @math{x} is a @math{t} by
@math{k} matrix, @math{b} is a @math{k} by @math{p} matrix, and
@math{e} is a @math{t} by @math{p} matrix.
Each row of y and x is an observation and each column a
variable.
 
The return values beta, sigma, and r are defined as
follows.
 
- beta
- 
The OLS estimator for b, beta = pinv (x) *
y, wherepinv (x)denotes the pseudoinverse of
x.
- 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.
 
Go to the first, previous, next, last section, table of contents.