Rstan expose_stan_functions and ODE stuff

Hi!

I just stumbled in the expose_stan_functions.R code over these lines:

  # special cases
  ODE_lines <- grep("integrate_ode(", lines, fixed = TRUE)
  ODE_statements <- grep("integrate_ode(", lines, fixed = TRUE, value = TRUE)

I don’t quite get what is being done with the ODE stuff there. However, I think the regex should be expanded or changed as we have more integrate_ode calls to cover:

  • integrate_ode
  • integrate_ode_rk45
  • integrate_ode_bdf

The last two exist in two flavors which are either in advanced or simple (advanced allows specification of tolerances); but I guess the flavors are irrelevant here. So I guess the right way to change the ODE handling code would be

  # special cases
  ODE_lines <- grep("integrate_ode", lines, fixed = TRUE)
  ODE_statements <- grep("integrate_ode", lines, fixed = TRUE, value = TRUE)

which would catch all cases.

Would be great if someone knowledgable (Ben?) could confirm this, then I am happy to file an issue and a fix for it.

Thanks!

Sebastian

Yeah

Ok. sounds easy… let me try a patch as outlined.

@Bob_Carpenter: Thanks much for creating the ticket in the stan repo to write a dedicated stan parser for generating the function definitions. I wish I could help with this, but I am not so sure as this parsing business is not quite where I am at home.

I did it already. Might not have pushed yet.

Great… no its not yet on github, but no hurry; next time I file the patch straight away I suppose.