constrained ordinary least squares
b2=-b3 and b2=-b4
* 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
* 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
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! | ![]() | ![]() |