#' Function to find a time step on which the model simulation is to be initialised
#'
#' Returns the time indes to use for initialisation
#'
#' @param X and xts object with column names output
#' @param mdl data.frame describing the model, must contain the variable lag
#'
#' @keywords FloorForT
#' @export
#' @examples
#' # Not Run
#' # ModelBuild()
ftinit <- function(X,mdl){
tmp <- X[,'output']
tmp[1:(mdl[1,'lag']-1)] <- NA
t0 <- max( match(TRUE,is.finite(tmp)) ,mdl[1,'lag'] )
t0 <- index(X[t0,])
return(t0)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.