stan_ode_function {readsdr}R Documentation

Create Stan ODE function

Description

Create Stan ODE function

Usage

stan_ode_function(
  filepath,
  func_name,
  pars = NULL,
  const_list = NULL,
  extra_funs = NULL,
  XMILE_structure
)

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.

XMILE_structure

A list.

Value

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

Examples

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

[Package readsdr version 0.3.0 Index]