Learn R Programming

SPOT (version 2.1.10)

funMarkovChain: funMarkovChain

Description

Wrapper function for evalMarkovChain used by spot.

Usage

funMarkovChain(x, conf)

Arguments

x

vector of parameter values, i.e., parameters of the MarkovChain model to evaluate with the function.

p

num [0;1] proportion of confirmed cases

beta

num Transmission rate from susceptible to infected. See SIR.

gamma

num Recovery rate from infected to recovered. See SIR.

CFR

num Case Fatalities Rate

conf

a list with entries

regionData

A data frame with observations of 3 variables:

date

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 ...

N

N population size

Value

1-column matrix with resulting function values (RMSE)

Details

Optimization of Continuous Time Markov Chains (MarkovChain) models.

Examples

Run this code
# NOT RUN {
data <- preprocessInputData(regionTrain, regionPopulation)
set.seed(123)
data <- data[[1]]
N <- attr(data, "regionPopulation")
## x = (p, beta, gamma, CFR)
x <- matrix(c(0.01, 0.1, 0.01, 0.1),1,4)
conf <- list(regionData = data, N = N)
funMarkovChain(x, conf)
# }

Run the code above in your browser using DataLab