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

Sync with the development branch of Stan #1091

Merged
merged 72 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
3895df4
Remove Eigen 3.4 requirement
andrjohns Mar 30, 2023
097ba93
Update `stanc3` JS `v2.32.0-rc1` (10 April 2023)
hsbadr Apr 16, 2023
d57c9a5
Bump version `2.32.0`
hsbadr Apr 16, 2023
ed57dc8
`rstan`: Update `NEWS`
hsbadr Apr 16, 2023
794d177
Update stan submodule
hsbadr Apr 22, 2023
2997a1e
Update `stanc3` JS `v2.32.0` (20 April 2023)
hsbadr Apr 22, 2023
efe122d
Update stan submodule
hsbadr Apr 29, 2023
068b09b
Update stan submodule
hsbadr Apr 30, 2023
455f2ed
Update stan submodule
hsbadr May 2, 2023
a47de40
Update `stanc3` JS `v2.32.1` (2 May 2023)
hsbadr May 2, 2023
2dcbc3d
`rstan`: Update `NEWS`
hsbadr May 2, 2023
9e4df25
Bump version `2.32.1`
hsbadr May 2, 2023
04d0687
Update stan submodule
hsbadr May 3, 2023
4049ef9
Update stan submodule
hsbadr May 5, 2023
f7c7323
Update stan submodule
hsbadr May 6, 2023
56b3852
Update stan submodule
hsbadr May 9, 2023
71dd3e0
Update stan submodule
hsbadr May 11, 2023
211d3d5
Update stan submodule
hsbadr May 12, 2023
0c7838a
Update stan submodule
hsbadr May 13, 2023
b54d65a
Update stan submodule
hsbadr May 17, 2023
20840c7
Update `stanc3` JS `v2.32.2` (15 May 2023)
hsbadr May 17, 2023
43b0850
`rstan`: Update `NEWS`
hsbadr May 17, 2023
b2dbe2b
Bump version `2.32.2`
hsbadr May 17, 2023
ed3e912
Update stan submodule
hsbadr May 18, 2023
63cc5b4
Update stan submodule
hsbadr May 19, 2023
3ee9ea9
Update stan submodule
hsbadr May 22, 2023
ce330f6
Update stan submodule
hsbadr May 23, 2023
d410ec7
Update stan submodule
hsbadr May 24, 2023
0f925d7
Update stan submodule
hsbadr May 26, 2023
6c419c0
Update stan submodule
hsbadr May 27, 2023
2efabf8
Update stan submodule
May 30, 2023
76d0426
Update stan submodule
Jun 6, 2023
3f19d7b
Update stan submodule
Jun 11, 2023
e51d172
Update stan submodule
hsbadr Jun 25, 2023
8b79322
Update stan submodule
hsbadr Jun 30, 2023
3ff6ebb
Update stan submodule
hsbadr Jul 8, 2023
5a7eba4
Update stan submodule
hsbadr Jul 12, 2023
e4d0daf
Update stan submodule
hsbadr Jul 17, 2023
473f7e1
Replace `boost::lexical_cast` with `std::stoull`
hsbadr Jul 17, 2023
963a71f
`rstan`: Remove extraneous file
hsbadr Jul 17, 2023
82d47de
Update stan submodule
hsbadr Jul 20, 2023
45cac65
Update stan submodule
hsbadr Jul 24, 2023
8a5d14b
Update stan submodule
hsbadr Jul 28, 2023
0f8713f
Update stan submodule
hsbadr Aug 1, 2023
a404277
Update stan submodule
hsbadr Aug 5, 2023
ebb00ff
Update stan submodule
hsbadr Aug 16, 2023
96f28ac
Update stan submodule
hsbadr Aug 21, 2023
1fab585
Update `stanc3` JS `v2.33.0-rc1` (22 Aug 2023)
hsbadr Aug 29, 2023
e1c0671
Bump version `2.33.0`
hsbadr Aug 29, 2023
210d52c
Revert "Update `stanc3` JS `v2.33.0-rc1` (22 Aug 2023)"
hsbadr Aug 30, 2023
9e68b58
Update stan submodule
hsbadr Aug 30, 2023
1e59fff
Merge pull request #1058 from stan-dev/experimental-quickjs
bgoodri Sep 6, 2023
a09ed66
Update stan submodule
hsbadr Sep 6, 2023
77483c5
Update stan submodule
hsbadr Sep 6, 2023
c110297
Merge pull request #1054 from stan-dev/eigen339-dep
bgoodri Sep 7, 2023
08bd5e0
Update stan submodule
hsbadr Sep 8, 2023
f82ba00
authors: @hsbadr: `ctb` to `aut`
hsbadr Sep 8, 2023
4edebe3
Merge `develop` branch
hsbadr Sep 8, 2023
782bac4
`StanHeaders`: Update `libsundials` link
hsbadr Sep 8, 2023
2749a63
`rstan`: Remove `rstanarm` from `Suggests`
hsbadr Sep 8, 2023
8b945d8
Update `stanc3` JS `v2.33.0` (5 September 2023)
hsbadr Sep 9, 2023
bf1daf2
`rstan`: Update `NEWS`
hsbadr Sep 9, 2023
8417f36
`rstan`: Fix the deprecated array syntax
hsbadr Sep 10, 2023
951683d
`rstan`: Update `NEWS`
hsbadr Sep 10, 2023
be4a2c2
`StanHeaders`: Use `develop` branch of Stan
hsbadr Sep 10, 2023
fc84603
Merge `develop` branch
hsbadr Sep 10, 2023
60286f9
Update stan submodule
hsbadr Sep 15, 2023
91875a8
Update `stanc3` JS `v2.33.1` (12 September 2023)
hsbadr Sep 15, 2023
8e3e3f9
`rstan`: Update `NEWS`
hsbadr Sep 15, 2023
b504918
Bump version `2.33.1`
hsbadr Sep 15, 2023
e244b95
Update stan submodule
hsbadr Sep 19, 2023
c7c5a46
Update stan submodule
hsbadr Sep 21, 2023
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
path = StanHeaders/inst/include/upstream
url = https://github.com/stan-dev/stan.git
ignore = dirty
branch = StanHeaders_2.26
branch = develop
6 changes: 3 additions & 3 deletions StanHeaders/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: StanHeaders
Title: C++ Header Files for Stan
Version: 2.26.23
Version: 2.33.1.9000
Authors@R: c(person("Ben",family="Goodrich", email="[email protected]", role=c('cre','aut')),
person("Joshua", "Pritikin", role = "ctb"),
person("Andrew", "Gelman", role = "aut"),
Expand All @@ -24,7 +24,7 @@ Authors@R: c(person("Ben",family="Goodrich", email="[email protected]
person("Dustin", "Tran", role = "aut"),
person("Michael", "Malecki", role = "aut"),
person("Yuanjun", "Gao", role = "aut"),
person("Hamada S.", "Badr", role = c("ctb"),
person("Hamada S.", "Badr", role = c("aut"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-9808-2344")),
person("Trustees of", "Columbia University", role = "cph"),
Expand All @@ -35,7 +35,7 @@ URL: https://mc-stan.org/
Description: The C++ header files of the Stan project are provided by this package, but it contains little R code or documentation. The main reference is the vignette. There is a shared object containing part of the 'CVODES' library, but its functionality is not accessible from R. 'StanHeaders' is primarily useful for developers who want to utilize the 'LinkingTo' directive of their package's DESCRIPTION file to build on the Stan library without incurring unnecessary dependencies. The Stan project develops a probabilistic programming language that implements full or approximate Bayesian statistical inference via Markov Chain Monte Carlo or 'variational' methods and implements (optionally penalized) maximum likelihood estimation via optimization. The Stan library includes an advanced automatic differentiation scheme, 'templated' statistical and linear algebra functions that can handle the automatically 'differentiable' scalar types (and doubles, 'ints', etc.), and a parser for the Stan language. The 'rstan' package provides user-facing R functions to parse, compile, test, estimate, and analyze Stan models.
Imports: RcppParallel (>= 5.1.4)
Suggests: Rcpp, BH (>= 1.75.0-0), knitr (>= 1.36), rmarkdown, Matrix, methods, rstan, withr
LinkingTo: RcppEigen, RcppParallel (>= 5.1.4)
LinkingTo: RcppEigen (>= 0.3.3.9.3), RcppParallel (>= 5.1.4)
VignetteBuilder: knitr
SystemRequirements: GNU make, pandoc
Depends: R (>= 3.4.0)
Expand Down
2 changes: 1 addition & 1 deletion StanHeaders/inst/include/libsundials
2 changes: 1 addition & 1 deletion StanHeaders/inst/include/upstream
Submodule upstream updated 2262 files
49,516 changes: 25,124 additions & 24,392 deletions StanHeaders/inst/stanc.js

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions rstan/rstan/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Package: rstan
Type: Package
Title: R Interface to Stan
Version: 2.26.24
Version: 2.33.1.9000
Authors@R: c(person("Jiqiang", "Guo", email = "[email protected]", role = "aut"),
person("Jonah", "Gabry", email = "[email protected]", role = "aut"),
person("Ben", "Goodrich", email = "[email protected]", role = c("cre", "aut")),
person("Andrew", "Johnson", email = "[email protected]", role = "aut"),
person("Sebastian", "Weber", email = "[email protected]", role = "aut"),
person("Hamada S.", "Badr", role = c("aut"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-9808-2344")),
person("Daniel", "Lee", role = "ctb"),
person("Krzysztof", "Sakrejda", role = "ctb"),
person("Modrak", "Martin", role = "ctb"),
person("Hamada S.", "Badr", role = c("ctb"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-9808-2344")),
person("Trustees of", "Columbia University", role = "cph"),
person("Oleg", "Sklyar", role = "cph", comment = "R/cxxfunplus.R"),
person("The R", "Core Team", role = "cph", comment = "R/pairs.R, R/dynGet.R"),
Expand Down Expand Up @@ -46,12 +46,12 @@ Imports:
ggplot2 (>= 3.3.5)
Depends:
R (>= 3.4.0),
StanHeaders (>= 2.26.22)
StanHeaders (>= 2.33.1)
LinkingTo:
Rcpp (>= 1.0.7),
RcppEigen (>= 0.3.3.9.1),
RcppEigen (>= 0.3.3.9.3),
BH (>= 1.75.0-0),
StanHeaders (>= 2.26.22),
StanHeaders (>= 2.33.1),
RcppParallel (>= 5.1.4)
Suggests:
testthat (>= 3.0.4),
Expand All @@ -64,7 +64,6 @@ Suggests:
rstudioapi,
Matrix,
knitr,
rstanarm,
coda,
V8
URL: https://mc-stan.org/rstan/, https://discourse.mc-stan.org
Expand Down
2 changes: 1 addition & 1 deletion rstan/rstan/R/misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ remove_empty_pars <- function(pars, model_dims) {
# following stan model code:
#
# transformed data { int n; n <- 0; }
# parameters { real y[n]; }
# parameters { array[n] real y; }
#
# Args:
# pars: a character vector of parameters names
Expand Down
49,516 changes: 25,124 additions & 24,392 deletions rstan/rstan/exec/stanc.js

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions rstan/rstan/inst/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
Sat Sep 15, 2023

1. Updated Stan to C++ compiler v2.33.1.

Sun Sep 10, 2023

1. Fixed the deprecated array syntax.

Sat Sep 9, 2023

1. Updated Stan to C++ compiler v2.33.0.

Wed May 17, 2023

1. Updated Stan to C++ compiler v2.32.2 (development).

Tue May 2, 2023

1. Updated Stan to C++ compiler v2.32.1 (development).

Sat April 22, 2023

1. Updated Stan to C++ compiler v2.32.0 (development).

Sun April 16, 2023

1. Updated Stan to C++ compiler v2.32.0-rc1 (development).

Thu March 16, 2023

1. Fixed `rstan::expose_stan_functions()` C++ compilation error (#1050).
Expand Down
3 changes: 1 addition & 2 deletions rstan/rstan/inst/include/rstan/stan_args.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <algorithm>
#include <rstan/io/r_ostream.hpp>
#include <stan/version.hpp>
#include <boost/lexical_cast.hpp>

namespace rstan {

Expand Down Expand Up @@ -46,7 +45,7 @@ namespace rstan {

inline unsigned int sexp2seed(SEXP seed) {
if (TYPEOF(seed) == STRSXP)
return boost::lexical_cast<unsigned int>(Rcpp::as<std::string>(seed));
return std::stoull(Rcpp::as<std::string>(seed));
return Rcpp::as<unsigned int>(seed);
}

Expand Down
Binary file removed rstan/rstan/inst/lib/libStanServices.a
Binary file not shown.
2 changes: 1 addition & 1 deletion rstan/rstan/man/rstan.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
stanmodelcode <- "
data {
int<lower=0> N;
real y[N];
array[N] real y;
}

parameters {
Expand Down
4 changes: 2 additions & 2 deletions rstan/rstan/man/sflist2stanfit.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ data {
int<lower=1> N;
}
parameters {
real y1[N];
real y2[N];
array[N] real y1;
array[N] real y2;
}
model {
y1 ~ normal(0, 1);
Expand Down
6 changes: 3 additions & 3 deletions rstan/rstan/man/stan.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ stan(file, model_name = "anon_model", model_code = "", fit = NA,
}

Stan treats a vector of length 1 in R as a scalar. So technically
if, for example, \code{"real y[1];"} is defined in the data block, an array
if, for example, \code{"array[1] real y;"} is defined in the data block, an array
such as \code{"y = array(1.0, dim = 1)"} in R should be used. This
is also the case for specifying initial values since the same
underlying approach for reading data from R in Stan is used, in which
Expand Down Expand Up @@ -425,7 +425,7 @@ stan(file, model_name = "anon_model", model_code = "", fit = NA,
library(rstan)
scode <- "
parameters {
real y[2];
array[2] real y;
}
model {
y[1] ~ normal(0, 1);
Expand All @@ -447,7 +447,7 @@ e2 <- extract(fit2, permuted = FALSE)

excode <- '
transformed data {
real y[20];
array[20] real y;
y[1] = 0.5796; y[2] = 0.2276; y[3] = -0.2959;
y[4] = -0.3742; y[5] = 0.3885; y[6] = -2.1585;
y[7] = 0.7111; y[8] = 1.4424; y[9] = 2.5430;
Expand Down
2 changes: 1 addition & 1 deletion rstan/rstan/man/stanc.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Translate Stan model specification to C++ code
stanmodelcode <- "
data {
int<lower=0> N;
real y[N];
array[N] real y;
}

parameters {
Expand Down
4 changes: 2 additions & 2 deletions rstan/rstan/man/stanfit-class.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ summarizing results and various access methods also allow the underlying data
showClass("stanfit")
ecode <- '
parameters {
real<lower=0> y[2];
array[2] real<lower=0> y;
}
model {
y ~ exponential(1);
Expand Down Expand Up @@ -241,7 +241,7 @@ print(y1star) # y1start should equal to y1
#
excode <- '
transformed data {
real y[20];
array[20] real y;
y[1] <- 0.5796; y[2] <- 0.2276; y[3] <- -0.2959;
y[4] <- -0.3742; y[5] <- 0.3885; y[6] <- -2.1585;
y[7] <- 0.7111; y[8] <- 1.4424; y[9] <- 2.5430;
Expand Down
6 changes: 3 additions & 3 deletions rstan/rstan/man/stanfit-method-extract.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
\examples{\dontrun{
ex_model_code <- '
parameters {
real alpha[2,3];
real beta[2];
array[2, 3] real alpha;
array[2] real beta;
}
model {
for (i in 1:2) for (j in 1:3)
Expand Down Expand Up @@ -110,7 +110,7 @@ dimnames(fit_ss2)
#
excode <- '
transformed data {
real y[20];
array[20] real y;
y[1] <- 0.5796; y[2] <- 0.2276; y[3] <- -0.2959;
y[4] <- -0.3742; y[5] <- 0.3885; y[6] <- -2.1585;
y[7] <- 0.7111; y[8] <- 1.4424; y[9] <- 2.5430;
Expand Down
2 changes: 1 addition & 1 deletion rstan/rstan/man/stanfit-method-summary.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ array of MCMC draws as its input rather than a \code{stanfit} object.
\examples{\dontrun{
ecode <- '
parameters {
real<lower=0> y[2];
array[2] real<lower=0> y;
}
model {
y ~ exponential(1);
Expand Down
2 changes: 1 addition & 1 deletion rstan/rstan/man/stanfit-method-traceplot.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#
excode <- '
transformed data {
real y[20];
array[20] real y;
y[1] <- 0.5796; y[2] <- 0.2276; y[3] <- -0.2959;
y[4] <- -0.3742; y[5] <- 0.3885; y[6] <- -2.1585;
y[7] <- 0.7111; y[8] <- 1.4424; y[9] <- 2.5430;
Expand Down
4 changes: 2 additions & 2 deletions rstan/rstan/man/stanfit2array-method.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
\examples{\dontrun{
ex_model_code <- '
parameters {
real alpha[2,3];
real beta[2];
array[2, 3] real alpha;
array[2] real beta;
}
model {
for (i in 1:2) for (j in 1:3)
Expand Down
3 changes: 1 addition & 2 deletions rstan/rstan/src/chains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/stats.hpp>
#include <boost/accumulators/statistics/mean.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/random/additive_combine.hpp> // L'Ecuyer RNG
#include <boost/random/uniform_int_distribution.hpp>
#include <fstream>
Expand Down Expand Up @@ -51,7 +50,7 @@ class perm_args {

inline unsigned int sexp2seed(SEXP seed) {
if (TYPEOF(seed) == STRSXP)
return boost::lexical_cast<unsigned int>(Rcpp::as<std::string>(seed));
return std::stoull(Rcpp::as<std::string>(seed));
return Rcpp::as<unsigned int>(seed);
}

Expand Down
2 changes: 1 addition & 1 deletion rstan/rstan/tests/testthat/test-partial_inits.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test_that("partial_inits works", {
stan_model_code <- "
data {
int<lower=0> N;
real y[N];
array[N] real y;
}

parameters {
Expand Down
6 changes: 3 additions & 3 deletions rstan/rstan/tests/testthat/test-stan_fun.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_that("Running stan() in parallel works", {
data {
int N;
} parameters {
real y[N];
array[N] real y;
} model {
y ~ normal(0, 1);
}
Expand Down Expand Up @@ -48,11 +48,11 @@ test_that("stan() arguments works", {
diag_fname2 <- "diag2.csv"
model_code <- "
parameters {
real y[2];
array[2] real y;
real alpha;
}
transformed parameters {
real y2[2, 2];
array[2, 2] real y2;
y2[1, 1] = y[1];
y2[1, 2] = -y[1];
y2[2, 1] = -y[2];
Expand Down
12 changes: 6 additions & 6 deletions rstan/rstan/tests/testthat/test-stanfit.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ test_that("outputing csv and extracting work", {
n = 0;
}
parameters {
real y[2];
real zeroleny[n];
array[2] real y;
array[n] real zeroleny;
}
transformed parameters {
real y2[2, 2];
array[2, 2] real y2;
y2[1, 1] = y[1];
y2[1, 2] = -y[1];
y2[2, 1] = -y[2];
Expand All @@ -22,7 +22,7 @@ test_that("outputing csv and extracting work", {
y ~ normal(0, 1);
}
generated quantities {
real y3[3, 2, 3];
array[3, 2, 3] real y3;
y3[1,1,1] = 1; y3[1,1,2] = 2; y3[1,1,3] = 3;
y3[1,2,1] = 4; y3[1,2,2] = 5; y3[1,2,3] = 6;
y3[2,1,1] = 7; y3[2,1,2] = 8; y3[2,1,3] = 9;
Expand Down Expand Up @@ -182,7 +182,7 @@ test_that("grad log is correct", {

code <- "
data {
real y[20];
array[20] real y;
}
parameters {
real mu;
Expand Down Expand Up @@ -241,7 +241,7 @@ test_that("Specifying arguments and data works", {
code <- "
data {
int N;
real y[N];
array[N] real y;
}
parameters {
real mu;
Expand Down
2 changes: 1 addition & 1 deletion sh_b.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
red='\033[0;31m'
NC='\033[0m' # no color

STAN_REPO_BRANCH=StanHeaders_2.26
STAN_REPO_BRANCH=develop
grepstanbranch=`git ls-remote --heads https://github.com/stan-dev/stan.git | grep "/${STAN_REPO_BRANCH}"`
if [ -z "$grepstanbranch" ]; then
echo -e "${red}ERROR:${NC} stan repo does not have {STAN_REPO_BRANCH}"
Expand Down
Loading