The function `blag()`

creates a basis for lag values of x, (a matrix of lag values of x).
The function `llag()`

creates a list with two components i) a basis matrix and ii) weights to be used as prior weights in any regression analysis. The function `wlag()`

can take a "mlags" object (created by `blag()`

) or a vector and returns a vector with ones and zeros. This can be used as prior weights in any analysis which uses `blag()`

.

1 2 3 4 |

`x` |
For |

`lags` |
how many lags are required |

`from.lag` |
where the lags are starting from. The default values is zero which indicates that the |

`omit.na` |
if true the first "lag" rows of the resulting matrix are omitted |

`value` |
value : what values should be set in the beginning of the lags columns, by default is set to NA |

`...` |
additional arguments |

Those three functions are design for helping a user to fit regression model using lags by generating the appropriate structures.
The function `blag()`

creates a basis for lag values of x. It assumed that time runs from the oldest to the newest observations. That is, the latest observations are the most recent ones. The function `wlag()`

take a basis matrix of lags and creates a vector of weights which can be used as a prior weights for any regression type analysis which has the matrix as explanatory variable. The function `llag()`

creates a list with the matrix base for lags and the appropriate weights.

The function `blag()`

returns a "mlags" object (matrix of lag values).
The function `llag()`

returns a list with components:

`matrix` |
The basis of the lag matrix |

`weights` |
The weights vector |

The function `wlag()`

returns a vector of prior weights having, The vector starts with zeros (as many as the number of lags) and continues with ones.

Mikis Stasinopoulos <mikis.stasinopoulos@gamlss.org>, Bob Rigby <r.rigby@londonmet.ac.uk> Vlasios Voudouris <v.voudouris@londonmet.ac.uk>, Majid Djennad, Paul Eilers.

Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion),
*Appl. Statist.*, **54**, part 3, pp 507-554.

Stasinopoulos D. M., Rigby R.A. and Akantziliotou C. (2006) Instructions on how to use the GAMLSS package in R. Accompanying documentation in the current GAMLSS help files, (see also http://www.gamlss.org/).

Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R.
*Journal of Statistical Software*, Vol. **23**, Issue 7, Dec 2007, http://www.jstatsoft.org/v23/i07.

`penLags`

1 2 3 4 5 6 7 8 9 10 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.