Optimization
************

Quadratic Programming
=====================

Nonlinear Programming
=====================

Linear Least Squares
====================

 -- 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 TP by TP 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 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 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, where pinv (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.