Grocer Function
NAME
lad - least absolute deviations regression
CALLING SEQUENCE
[rlad]=lad(grocer_namey,arg1,...,argn)
PARAMETERS
Input
-
grocer_namey = 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
-
argi = an argument that can be:
- a time series
- a real (nx1) vector
- a real (nxk) matrix
- a string equal to the name of a time series or a (nxk) real vector or matrix between quotes
- a list of such elements
- the string 'noprint' if the user doesn't want to display the results of the regression
- the string 'itmax=n' where n is the maximum # of iterations (for example 'itmax=10'; default=500)
- the string 'crit=n' where n is the convergence criterion (for example 'crit=1e-5'; default = 1e-15)
Output
-
rlad = a tlist with
- rlad('meth') = 'lad'
- rlad('y') = y data vector
- rlad('x') = x data matrix
- rlad('nobs') = nobs
- rlad('nvar') = nvars
- rlad('b_new') = bhat
- rlad('yhat') = yhat
- rlad('resid') = residuals
- rlad('vcovar') = estimated variance-covariance matrix of b_new
- rlad('sige') = estimated variance of the residuals
- rlad('sige') = estimated variance of the residuals
- rlad('ser') = standard error of the regression
- rlad('tstat') = t-stats
- rlad('pvalue') = pvalue of the b_news
- rlad('dw') = Durbin-Watson Statistic
- rlad('prescte') = boolean indicating the presence or absence of a constant in the regression
- rlad('namey') = name of the y variable
- rlad('namex') = name of the x variables
- rlad('bounds') = if there is a timeseries in the regression, the bounds of the regression
- rlad('iter') = # of iterations
- rlad('conv') = convergence max(abs(bnew-bold))
- rlad('weight') = weight used to do the last ols regression
DESCRIPTION
Least absolute deviations regression. Minimizes sum(abs(y - x*b)) using re-iterated weighted least-squares where the weights are the inverse of the absolute values of the residuals. If the user has not given the argument 'noprint', the results of the regression and various diagnostics are displayed on the working space.
EXAMPLES
1) lad(y,x)
2) lad('y','x1','x2','cte','maxit=200','noprint')
Example 1, taken from lad_d, provides the least absolute deviation regression of vector y on matrix x.
Example 2 provides the least absolute deviation regression of y (which can be a ts or a vector) on x1, x2, which can be ts, vectors or matrices and on a constant; the maximum number of iteration is set to 200 and the results are not displayed.
AUTHOR
Eric Dubois 2002