create_stan_function | R Documentation |
create_stan_function
returns a string with the code for a Stan's ODE function
create_stan_function(
filepath,
func_name,
pars = NULL,
override.consts = NULL,
additional_funs = NULL
)
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 |
override.consts |
A list in which each element is a name-value pair that replaces values of constants. |
additional_funs |
A vector of strings. Each string corresponds to a user-defined function. |
This function extracts the xml from the file specified via filepath
to
generate the code for an equivalent model in Stan.
A string with the code containing the model's equations in the format required by Stan.
path <- system.file("models", "SIR.stmx", package = "readsdr")
create_stan_function(path, "my_model")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.