Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand support for odin's functions #3

Open
2 of 6 tasks
richfitz opened this issue Jun 24, 2020 · 3 comments
Open
2 of 6 tasks

Expand support for odin's functions #3

richfitz opened this issue Jun 24, 2020 · 3 comments

Comments

@richfitz
Copy link
Member

richfitz commented Jun 24, 2020

Break into smaller PRs as required

  • %% (see Basic modulo #53)
  • %/%
  • R-style round/even behaviour
  • 2-arg round
  • more distributions (as implemented in dust)
  • odin_sum* need prototypes working with const double * as well as std::vector<double>&
@xtimbeau
Copy link

would be nice to have output as well. Combine with dust set_index() method, that could help when dealing with large models.

@richfitz
Copy link
Member Author

We have no plans to include output as it has odd behaviour with stepping of discrete time models. To match the ode behaviour that means that the model had to take an extra "fake" step in order to get output computed correctly.

However, there's no real need for it with discrete time models either as one can just use update at will (unlike an ode model where the only things that have a derivative wrt time are present in the main variables, and one must use output to store other quantities).

set_index will help a lot with performance with large models, yes. We often return ~100 variables from models with ~5000 compartments.

@xtimbeau
Copy link

Thanks for you answer. So if I understand well (and I think I got the logic of the fake extra step) what you propose is that I write:

odin_dust({
  update(x_1) <-  i_y
  i_y <- x + 1
  update(y) <- i_y
  initial(x_1) <- 1
  initial(y) <- 1+1
  })

instead of

odin_dust({
  update(x_1) <-  y
  y <- x + 1
  ouptut(y) <- TRUE
  initial(x_1) <- 1
  })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants