Learn R Programming

SPOT (version 2.4.2)

tuneRegionModel: tuneRegionModel

Description

Perform a spot run on funMarkovChain with region data. Results can be postprocessed with the function parseTunedRegionModel to extract model and parameter information.

Usage

tuneRegionModel(
  regionData,
  pops = NULL,
  lower = NULL,
  upper = NULL,
  control = list()
)

Arguments

regionData

is a data.frame with observations of 3 variables:

data

Date, format: "2020-01-22" "2020-01-23" "2020-01-24" "2020-01-25" ...

confirmed

num 0 0 0 0 0 0 0 0 0 0 ..

fatalities

fatalities: num 0 0 0 0 0 0 0 0 0 0 ...

and attributes - attr(*, "regionName")= chr "Afghanistan/" - attr(*, "regionPopulation")= int 38041754

pops

evaluated populations

lower

lower bounds for spot optimization, @seealso Link{spot}

upper

upper bounds for spot optimization, @seealso Link{spot}

control

spot control list, see controlSpot

Value

This function returns a list with:

regionName

e.g., "Afghanistan/": List of 7

xbest
Parameters of the best found solution (matrix).
ybest
Objective function value of the best found solution (matrix).
x
Archive of all evaluation parameters (matrix).
y
Archive of the respective objective function values (matrix).
count
Number of performed objective function evaluations.
msg
Message specifying the reason of termination.
modelFit
The fit of the last build model, i.e., an object returned by the last call to the function specified by control$model.

Details

Note: the default number of function evaluations is very low.

Examples

Run this code
# NOT RUN {
 
# require(SimInf)
# data <- preprocessInputData(regionTrain, regionPopulation)
# a <- c(0.01,  0.001, 0.001,   0.001)
# b <- c(0.1,  0.01, 0.01,   0.01)
# lapply(data[1], tuneRegionModel, pops=NULL, lower = a, upper = b,
# control=list(funEvals=6, 
# designControl=list(size=5), model = buildLM))

# }

Run the code above in your browser using DataLab