Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


SPOT (version 2.4.2)

plotPrediction: plotPrediction

Description

plot predictions countries/regions by index

Usage

plotPrediction(regionDf, countryIndex = 1, ylog = FALSE)

Arguments

regionDf

A list containing a representation of the data.

countryIndex

num Index

ylog

logical plot log y axis (log = y)

Value

A plot

Details

Data are taken from the regionTrain and regionPopulation data sets that were combined using the preprocessInputData function. regionTrain and regionPopulation are stored in the babsim.data package.

Examples

Run this code
# NOT RUN {
# require(SPOT)
# data <- preprocessInputData(regionTrain, regionPopulation)
# testData <- preprocessTestData(regionTest)
# # Select the first region:
# testData <- testData[testData$Region==levels(testData$Region)[1], ]
# testData$Region <- droplevels(testData$Region)
# # Very small number of function evaluations:
# n <- 6
# res <- lapply(data[1], tuneRegionModel, pops=NULL, 
#               control=list(funEvals=n, designControl=list(size=5), model = buildLM))
# parsedList <- parseTunedRegionModel(res)
# pred <- generateMCPrediction(testData = testData, models = parsedList$models, write = FALSE)
# quickPredict <- cbind(pred, testData$Date, testData$Region)
# names(quickPredict) <- c("ForecastID", "confirmed", "fatalities", "date", "region")
# p <- plotPrediction(quickPredict, 1)
# }

Run the code above in your browser using DataLab