stan_ode_function: Create Stan ODE function

Description Usage Arguments Value Examples

View source: R/stan_ode_function.R

Description

Create Stan ODE function

Usage

1
2
3
4
5
6
7
stan_ode_function(
  filepath,
  func_name,
  pars = NULL,
  const_list = NULL,
  extra_funs = NULL
)

Arguments

filepath

A string that indicates a path to a file with extension .stmx or .xmile. Vensim files (.mdl) are not xmile files. They must be exported from Vensim with extension .xmile

func_name

A string for naming the ODE function

pars

A character vector that indicates which constants will be considered as parameters in the ODE function

const_list

A list in which each element's name is the name of the constant to override and the element's value correspond to the new value.

extra_funs

A vector of strings. Each string corresponds to a user-defined function.

Value

A string with the code containing a function with the model's equations in the format required by cmdstan 2.24+.

Examples

1
2
path <- system.file("models", "SIR.stmx", package = "readsdr")
stan_ode_function(path, "my_model")

readsdr documentation built on Jan. 13, 2021, 11:08 a.m.