<< Multivariate regressions Multivariate regressions eqlist >>

Grocer >> Multivariate regressions > eq2xcol

eq2xcol

Transformation of a system of equations into a matrix vector

CALLING SEQUENCE

[x,boundsvarb,prests]=eq2xcol(grocer_a,listeq,uneven,dropna)

PARAMETERS

Input

* grocer_a = the vector of coefficients where the equations must be evaluated

* listeq = the list of equations in string form

* uneven = a boolean indicating whether the equations should keep their time bounds or must have common bounds

* dropna = a boolean indicating whether the program should keep only lines of matrices y and x with non NA values

 

Output

* x = the X matrix in the regression represented by the system of equations embedded in listeq

* boundsvarb = the bounds of the regressions (if any)

* prests = a boolean indicating whether there is a ts in the equations

DESCRIPTION

Transforms a list of strings into the column vector equal to the evaluation of the list of equations contained in grocer_listeq at point grocer_a. The coefficients must be named grocer_a(i) in the equations. Used in function explosys.

EXAMPLE

load(GROCERDIR+'/data/bdhenderic.dat');
rols=ols('lm1','ly','lp','rnet','const')
[grocer_x,grocer_boundsvarb,grocer_prests]=eq2xcol(-rols('beta'),'lm1-grocer_a(1)*ly-grocer_a(2)*lp-grocer_a(3)*rnet-grocer_a(4)',%f,%f)
 
// this example stores in a vector the residuals of the first stage cointegration relationship between lm1, ly, lp and rnet,
// as well as the corresponding time bounds and the presence of a ts
 
x=-numz0(eq2xcol,ones(grocer_ncoef,1),grocer_ncoef,...
ones(grocer_ncoef,grocer_totalnobs),1,grocer_listeq,grocer_unequal,grocer_dropna)'
 
// This last example is taken from explosys and cannot be run alone, but shows a useful application. Eq2xcol is
// given as an entry in function numz0 in order to calculate the x matrix as the first derivative
// of the vector of equations with respect to the coefficients: it is evaluated at vector ones(grocer_ncoef,1).

AUTHOR

Eric Dubois 2002

Report an issue
<< Multivariate regressions Multivariate regressions eqlist >>