<< ols2_cons Single equation regressions olsar1 >>

Grocer >> Single equation regressions > ols_cons

ols_cons

constrained ordinary least squares

CALLING SEQUENCE

b2=-b3 and b2=-b4

PARAMETERS

Input

* y = a time series, a real (nx1) vector or a string equal to the name of a time series or a (nx1) real vector between quotes

* arg1,..., argn = an argument which can be:

  - a time series

  - a real (nxp) vector

  - a string equal to the name of a time series or a (nxp) real vector between quotes

  - the string 'noprint' if the user doesn't want to print the results of the regression

  - the string 'R=m' where m is the R matrix in Rb = r

  - the string 'r=m' where m is the r matrix in Rb = r

 

Output

* rols = a results tlist with

  - rols('meth') = 'constrained ols'

  - rols('y') = y data vector

  - rols('x') = x data matrix

  - rols('nobs') = # observations

  - rols('nvar') = # variables

  - rols('beta') = bhat

  - rols('yhat') = yhat

  - rols('resid') = residuals

  - rols('vcovar') = estimated variance-covariance matrix of beta

  - rols('sige') = estimated variance of the residuals

  - rols('sigu') = sum of squared residuals

  - rols('ser') = standard error of the regression

  - rols('tstat') = t-stats

  - rols('pvalue') = pvalue of the betas

  - rols('dw') = Durbin-Watson Statistic

  - rols('condindex') = multicolinearity cond index

  - rols('prescte') = boolean indicating the presence or absence of a constant in the regression

  - rols('llike') = the log-likelihood

  - rols('R') = the R matrix in Rb=r

  - rols('r') = the r matrix in Rb=r

  - rols('rsqr') = rsquared

  - rols('rbar') = rbar-squared

  - rols('f') = F-stat for the nullity of coefficients other than the constant

  - rols('pvaluef') = its significance level

  - rols('prests') = boolean indicating the presence or absence of a time series in the regression

  - rols('namey') = name of the y variable

  - rols('namex') = name of the x variables

  - rols('bounds') = if there is a timeseries in the regression, the bounds of the regression

DESCRIPTION

The high-level function that provides the constrained ordinary least squares, when the constraint takes the form Rb=r. Endogenous variable must be given first, as a vector, a ts, between quotes (if the user wants to keep the name of the variable in the tlist result and for the printings) or not. Exogenous variables are given after, in one of the formats authorized for the endogenous one, or in matrix format. The matrices R and r must be entered under the form 'R=m1' and 'r=m2' where m1 and m2 are their respective values. The program displays on screen various results (coefficients, tstat, R-squared, Durbin and Watson,...) except if the user has entered the argument 'noprint' anywhere after the first argument.

EXAMPLE

load(GROCERDIR+'/macros/grocer/db/bdhenderic.dat') ; bounds('1964q3','1989q2') ;rols=ols_cons('delts(lm1-lp)','delts(lp)','delts(lagts(1,lm1))',
'delts(lagts(1,lp))','delts(lagts(1,ly))','rnet','lagts(1,lm1-lp-ly)','cte','R=[0 1 1 0 0 0 0 ; 0 1 0 1 0 0 0]','r=[0;0]')
//The example shows the estimation of Hendry and Ericsson (1991) model by imposing the constraints on delts(lagts(1,lm1)), 'delts(lagts(1,lp))' and 'delts(lagts(1,ly))' in order to obtain delts(lagts(1,lm1-ly-lp)). Calling b the vector of coefficents, the constraints are:
// b2=-b3 and b2=-b4
// hence:
// R= [0 1 1 0 0 0 0 ]
//          [ 0 1 0 1 0 0 0]
// and:
// r = [0]
//            [0]
// As expected, results are the same as those provided by function hendryericsson!

AUTHOR

Eric Dubois 2006

Report an issue
<< ols2_cons Single equation regressions olsar1 >>