Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewGhazi committed Jul 1, 2024
1 parent 0dd2d21 commit 1231665
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 53 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Maintainer: The package maintainer <[email protected]>
Description: Demonstrate how to create an R package with pre-compiled Stan
models.
Depends:
R (>= 4.0.0)
R (>= 4.2.1)
Imports:
cli,
collapse,
Expand All @@ -21,3 +21,5 @@ Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
License: GPL (>= 3)
Suggests:
ggplot2
3 changes: 2 additions & 1 deletion R/model.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ run_gp_model = function(X, y, X_pred, ..., verbose) {
fit = model$sample(data = data_list,
...)

fit$draws(format = "data.frame")
fit$draws(format = "data.frame",
variables = c("alpha", "rho", "sigma", "f_star"))
}
11 changes: 7 additions & 4 deletions R/run.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ get_x_grid = function(max_grid_size,
#' Create a range data frame
#' @description This function creates an example data frame of mins and maxs for brew
#' parameter settings. That is, the range of grinder settings I want to search is from 4
#' to 14, temperatures from 170 to 210F, and bloom times from 0 to 60s.
#' to 14, temperatures from 170 to 210F, and bloom times from 0 to 60s. This sets the
#' range of the grid of the brew parameter space that is evaluated.
#'
#' Brew parameters named `grinder_setting`, `temp`, and `bloom_time` get special
#' treatment when the grid is created. They specifically get designated step sizes of
#' 0.5, 5, and 10 respectively.
#'
#' @export
create_ranges = function() {
Expand Down Expand Up @@ -120,8 +125,7 @@ run_gp = function(dat, ..., max_grid_size = 2000,
X = centered_dat |> get_vars("_cent", regex=TRUE) |> qM()

list(run_gp_model(X = X, y = dat$rating, X_pred = x_grid_cent, ...),
x_grid,
x_grid_cent)
x_grid)
}

#' Suggest the next point to try
Expand All @@ -138,7 +142,6 @@ suggest_next = function(dat, ..., max_grid_size = 2000,

gp_res = run_res[[1]]
x_grid = run_res[[2]]
x_grid_cent = run_res[[3]]

obs_max = max(dat$rating)

Expand Down
7 changes: 6 additions & 1 deletion man/create_ranges.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 0 additions & 46 deletions src/stan/bernoulli.stan

This file was deleted.

0 comments on commit 1231665

Please sign in to comment.