Skip to content

Commit

Permalink
update old array syntax in some examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jgabry committed Sep 6, 2023
1 parent 5e2551c commit c5c68e7
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions R/fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ CmdStanFit$set("public", name = "return_codes", value = return_codes)
#' mcmc_program <- write_stan_file(
#' 'data {
#' int<lower=0> N;
#' int<lower=0,upper=1> y[N];
#' array[N] int<lower=0,upper=1> y;
#' }
#' parameters {
#' real<lower=0,upper=1> theta;
Expand All @@ -1169,7 +1169,7 @@ CmdStanFit$set("public", name = "return_codes", value = return_codes)
#' }
#' }
#' generated quantities {
#' int y_rep[N];
#' array[N] int y_rep;
#' profile("gq") {
#' y_rep = bernoulli_rng(rep_vector(theta, N));
#' }
Expand Down
8 changes: 4 additions & 4 deletions R/model.R
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ CmdStanModel$set("public", name = "variables", value = variables)
#' file <- write_stan_file("
#' data {
#' int N;
#' int y[N];
#' array[N] int y;
#' }
#' parameters {
#' // should have <lower=0> but omitting to demonstrate pedantic mode
Expand Down Expand Up @@ -1659,7 +1659,7 @@ CmdStanModel$set("public", name = "variational", value = variational)
#' mcmc_program <- write_stan_file(
#' "data {
#' int<lower=0> N;
#' int<lower=0,upper=1> y[N];
#' array[N] int<lower=0,upper=1> y;
#' }
#' parameters {
#' real<lower=0,upper=1> theta;
Expand All @@ -1678,13 +1678,13 @@ CmdStanModel$set("public", name = "variational", value = variational)
#' gq_program <- write_stan_file(
#' "data {
#' int<lower=0> N;
#' int<lower=0,upper=1> y[N];
#' array[N] int<lower=0,upper=1> y;
#' }
#' parameters {
#' real<lower=0,upper=1> theta;
#' }
#' generated quantities {
#' int y_rep[N] = bernoulli_rng(rep_vector(theta, N));
#' array[N] int y_rep = bernoulli_rng(rep_vector(theta, N));
#' }"
#' )
#'
Expand Down
6 changes: 3 additions & 3 deletions man/CmdStanGQ.Rd

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

4 changes: 2 additions & 2 deletions man/fit-method-profiles.Rd

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

2 changes: 1 addition & 1 deletion man/model-method-check_syntax.Rd

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

6 changes: 3 additions & 3 deletions man/model-method-generate-quantities.Rd

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

0 comments on commit c5c68e7

Please sign in to comment.