Learn R Programming

fitode (version 0.1.1)

initialize,odemodel-method: Constructor method of "odemodel" class

Description

Constructor method of "odemodel" class

Usage

# S4 method for odemodel
initialize(
  .Object,
  name,
  model,
  observation,
  initial,
  par,
  link,
  diffnames,
  keep_sensitivity = TRUE,
  call
)

Value

An object of class ``odemodel'' as described in odemodel-class.

Arguments

.Object

object

name

name of the model

model

ode model

observation

observation model

initial

initial values

par

model parameters

link

link functions for parameters (log links are used as default)

diffnames

optional character vector specifying the names of a variable for which the consecutive difference needs to be calculated

keep_sensitivity

(logical) maintain the Jacobian as a part of the model object?

call

original function call

Examples

Run this code
SI_model <- odemodel(
    name = "SI",
    model = list(
        S ~ - beta*S*I/N,
        I ~ beta*S*I/N - gamma*I
    ),
    observation = list(
        susceptible ~ dnorm(mean=S, sd=sigma1),
        infected ~ dnorm(mean=I, sd=sigma2)
    ),
    initial = list(
        S ~ N * (1 - i0),
        I ~ N * i0
    ),
    par = c("beta", "gamma", "N", "i0", "sigma1", "sigma2"),
    link = c(i0="logit")
)

Run the code above in your browser using DataLab