#' #do_something_with_pred
#' }}
#' @export
-getForecast = function(data, indices, forecaster, pjump,
+getForecast = function(data, indices, forecaster, pjump=NULL,
memory=Inf, horizon=data$getStdHorizon(), ...)
{
# (basic) Arguments sanity checks
if (any(indices<=0 | indices>data$getSize()))
stop("Indices out of range")
indices = sapply(indices, dateIndexToInteger, data)
- if (!is.character(forecaster) || !is.character(pjump))
- stop("forecaster and pjump should be of class character")
+ if (!is.character(forecaster))
+ stop("forecaster (name) should be of class character") #pjump could be NULL
pred = list()
forecaster = new(paste(forecaster,"Forecaster",sep=""), data=data,
- pjump = getFromNamespace(paste("get",pjump,"JumpPredict",sep=""), "talweg"))
+ pjump =
+ if (is.null(pjump))
+ function() {}
+ else
+ getFromNamespace(paste("get",pjump,"JumpPredict",sep=""), "talweg"))
for (today in indices)
{
pred[[length(pred)+1]] = list(