Usage: |
{B,u,s,g} = varunls(y,p,trend)
|
Input: |
| y | (K x p+T) matrix of p presample, and T sample observations
|
| p | (1 x 1) integer, VAR-process order, number of lags in the model, p=1,2,3,...
|
| trend | (1 x 1) integer, indicator whether intercept is estimated or not, if trend=1 intercept is estimated, if trend=0 no intercept is estimated
|
Output: |
| B | (K x trend+K*p) matrix, model parameters (nu~)A_1~A_2~...~A_p |
| u | (K x T) matrix, least squares estimates of residuals |
| s | (K x K) matrix, least squares estimate of residual variance-covariance matrix |
| g | (K*p+trend x K*p+trend) matrix, autocovariance matrix of time series |