SimpleForecast: SimpleForecast

Description Fields Methods See Also Examples

Description

A basic concrete SimulatedForecast class.

Fields

data

The data used to create the forecast.

forecastMadeTime

When the forecast was created.

forecastTimes

The times the forecast is about.

model

The model used to create the forecast.

Methods

binDist(cutoffs)

This throws an error. This method is not meaningful for this data.

Arguments
cutoffs - A numeric vector with elements to use as the dividing values for the bins.

debug(string)

A function for debugging the methods of this class. It calls the browser command. In order for methods to opt into to debugging, they need to implement the following code at the beginning: if(<method_name> %in% private$.debug){browser()}. This method exists, because the debugger is not always intuitive when it comes to debugging R6 methods.

Arguments
string - The name(s) of methods to debug as a character vector

initialize(data,forecastTimes)

Create a new SimpleForecast.

Arguments
data - The data to initialize with
forecastTimes - Boolean representing which times are forecasted, and which times are not.

mean()

This method returns the data. It is included for compliance.

Arguments
Value

a MatrixData.

median()

This method returns the data. It is included for compliance.

Arguments
Value

a MatrixData.

quantile(alphas,na.rm=FALSE)

This throws an error. This method is not meaningful for this data.

Arguments
alphas - A numeric vector with elements between 0 and 1 of percentiles to find cutoffs for.
na.rm - A boolean regarding whether to remove NA values before computing the quantiles.
Value

an ArrayData.

undebug(string)

A function for ceasing to debug methods. Normally a method will call the browser command every time it is run. This command will stop it from doing so.

Arguments
string - The name(s) of the methods to stop debugging.

See Also

Inherits from : Forecast

Examples

1
2
3
4
5
6
7
8
9
data = IncidenceMatrix$new(matrix(1:9,3,3))
forecast = SimpleForecast$new(data,forecastTimes=c(FALSE,FALSE,TRUE))
forecast
forecast$forecastTimes
forecast$forecastMadeTime
forecast$data$mat
forecast$nsim
forecast$mean()$mat
forecast$median()$mat

ForecastFramework documentation built on April 14, 2020, 7:39 p.m.