Estimate by Cochrane-Orcutt ols Regression for AR1 errors equations of a model
[model2,olsc1,...,olscn]=olscmod(model,tsmat,indeq,arg1,...,argn)
* model = a model tlist
* tsmat = a tsmat containing all data needed for estimating the equation (should be the tsmat associated to the model, created by function create_dbmod)
* indeq =
- a string, the name of the equation to estimate or the keyword 'all' (to estimate all equations)
- or an integer, the # of the equation in the model
* arg1,...,argn = optional arguments which can be:
- the string 'noprint' if the user doesn't want the to print the results of the regression
- the string 'maxit=n' where n is the maximum number of iterations that can be performed (default = 100)
- the string 'crit=n' where crit is the convergence criterion, used to assess if the difference between successive values of the autocorrelation coefficient is significant (default=sqrt(%eps))
- the string 'dropna' if the user wants to use in the regression all dates with no NA value in any variable (the main use of this option should be when dealing with daily ts)
- the string 'save=%t' if the user wants to save the estimated coefficients in the model tlist
* model2 = the model tlist, with the estimated coefficients if the option save has been swtiched to %t
* olsc1,...,olscn = a variable number of olsc results tlists, each one corresponding to the results of the corresponding estimated equation
global GROCERDIR // load the model small: load(GROCERDIR+'data\small.dat') // load the database small_db: load(GROCERDIR+'data\small_db.dat') // set the bounds: bounds('1980q1','2005q4'); // In the small model, estimate by ols the equation td_p3m_d1, with T-statistics corrected for heteroskedasticity by White's method. // Estimated coefficients are stored in the small model tlist: [small,rp3m_d1]=olscmod(small,small_db,'td_p3m_d1','save=%t'); | ![]() | ![]() |