Nothing
#' Calculation of lagged covariates
#'
#' @param x The matrix of covariates.
#' @praam n The sample size
#' @param lag The maximum lag.
#' @return y The first covariate of x without a lag, the dependent covariate.
#' @return xl The lagged covariates with lags of order 1:lag starting with the first covariate.
#' @examples
#' data(abcq)
#' abcql<-flag(abcq,240,1,16)
#' a<-f1st(abcql[[1]],abcql[[2]])
flag<-function(x,n,i,lag){
k<-length(x)/n
x<-matrix(x,nrow=n,ncol=k)
tmp<-.Fortran(
"lagg",
as.double(x),
as.integer(n),
as.integer(k),
as.integer(lag),
double((n-lag)*k*lag),
double(n-lag),
as.integer(i)
)
y<-tmp[[6]]
xl<-tmp[[5]]
xl<-matrix(xl,nrow=n-lag,ncol=k*lag)
list(y,xl)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.