Skip to content

Cmdstanr option #537

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

Merged
merged 31 commits into from
Feb 14, 2024
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5d708bd
add cmdstan backend
sbfnk Jan 30, 2024
76c267e
add cmdstanr model
sbfnk Jan 30, 2024
277921c
generalise extract functions
sbfnk Jan 31, 2024
f6eda7a
create general fit_model function
sbfnk Jan 31, 2024
547ea8a
initial values for cmdstanr
sbfnk Jan 31, 2024
4d5f088
move stan model creation to create func
sbfnk Jan 31, 2024
db81caf
make dist_fit cmdstanr ready
sbfnk Jan 31, 2024
32e2cc8
make estimate_infections cmdstanr ready
sbfnk Jan 31, 2024
19fadcc
make estimate_secondary cmdstanr ready
sbfnk Jan 31, 2024
4eb4726
make estimate_truncation cmdstanr ready
sbfnk Jan 31, 2024
311d433
make simulate_infections cmdstanr ready
sbfnk Jan 31, 2024
6569e68
gitignore for binaries
sbfnk Jan 31, 2024
4ae5948
add cmdstanr as suggest
sbfnk Jan 31, 2024
028b499
make forecast_secondary cmdstanr ready
sbfnk Feb 1, 2024
f5b03bd
update stanargs test
sbfnk Feb 1, 2024
1cca4ca
make simulations work with updated options
sbfnk Feb 1, 2024
c8b5e09
add globals
sbfnk Feb 1, 2024
d7064ab
tests for cmdstanr backend
sbfnk Feb 1, 2024
ccb004f
update actions
sbfnk Feb 2, 2024
a808431
updates in response to lintr
sbfnk Feb 2, 2024
02dc4bf
don't use future_lapply for cmdstanr
sbfnk Feb 4, 2024
7c7112b
backend-specific success criteria
sbfnk Feb 5, 2024
df76685
use epinowcast action for installing cmdstan
sbfnk Feb 6, 2024
0032367
improve .gitignore for compiled stan files
sbfnk Feb 6, 2024
91a6b8e
deactivate testing on windows for now
sbfnk Feb 12, 2024
cac3811
Revert "use epinowcast action for installing cmdstan"
sbfnk Feb 13, 2024
6593f5a
Apply suggestions from code review
sbfnk Feb 14, 2024
6b60299
match arguments in `stan_model`
sbfnk Feb 14, 2024
efba507
don't match args$method but explictly stop instead
sbfnk Feb 14, 2024
b594c3c
put choices in argument
sbfnk Feb 14, 2024
b1c54a4
render documentation for stan_model
sbfnk Feb 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
don't match args$method but explictly stop instead
  • Loading branch information
sbfnk committed Feb 14, 2024
commit efba507f17fef00435a52b03cd1f867fb4af8751
3 changes: 2 additions & 1 deletion R/stan.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ stan_model <- function(backend = "rstan", model = "estimate_infections") {
#' @inheritParams fit_model_with_nuts
#' @keywords internal
fit_model <- function(args, id = "stan") {
args$method <- arg_match(args$method, values = c("sampling", "vb"))
if (args$method == "sampling") {
fit <- fit_model_with_nuts(
args,
Expand All @@ -93,6 +92,8 @@ fit_model <- function(args, id = "stan") {
)
} else if (args$method == "vb") {
fit <- fit_model_with_vb(args, id = id)
} else {
stop("args$method must be one of 'sampling' or 'vb'")
}
return(fit)
}