idealstan
idealstan copied to clipboard
Outdated Syntax Error
Hello,
I get an error after running the following code:
# Specify `idealstan` model with random-walk prior:
idealstan_output2 <- id_estimate(
idealdata = idealstan_object,
vary_ideal_pts = "random_walk",
fixtype = "prefix",
use_vb = F,
const_type = "items",
restrict_ind_high = "Alt2022_Q3",
restrict_ind_low = "Alt2019_Q26",
ncores = 8,
grainsize = 1,
nchains = 3,
niters = 5000,
id_refresh = 5000,
warmup = 5000,
time_fix_sd = 0.1
)
This is the error text:
[1] "Compiling model. Will take some time as this is the first time package is used."
[1] "Have you thought about donating to relief for victims for Yemen's famine?"
[1] "Check out https://www.unicef.org/emergencies/yemen-crisis for more info."
Compiling Stan program...
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 625, column 4: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 624, column 4: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 568, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 559, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 558, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 557, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/
Rtmp4myCHc/model-32b0700b5bf4.stan', line 556, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 555, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 554, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 553, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 552, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 535, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 43
7, column 1: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 420, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 413, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 411, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyw
ord before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 390, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 389, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 388, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 387, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 380, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 379, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
change
d automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 378, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 377, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 363, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 362, column 2: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 293, column 10: Declaration
of arrays by placing brackets after a variable name was removed in Stan
2.33.0. Instead use the array keyword before the type. This can be
changed automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 109, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 106, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 101, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 98, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 97, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 96, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 95, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 94, column 8: D
eclaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 93, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 92, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 91, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 75, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 46, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 45, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use
the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 44, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 41, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 40, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 39, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 38, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 37, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to
stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 36, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 29, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 28, column 8: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 22, column 17: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 10, column 17: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/R/win-library/4.3/idealstan/stan_files//chunks/calc_rlnorm_gp.stan', line 6, column 23, included from
'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 7, column 0: Declaration
of arrays by placing brackets after a type was removed in Stan 2.33.0.
Instead use the array keyword before the type. This can be changed
automatically
using the auto-format flag to stanc
Error in 'C:/Users/edwar/AppData/Local/R/win-library/4.3/idealstan/stan_files//chunks/calc_rlnorm_gp.stan', line 13, column 25, included from
'C:/Users/edwar/AppData/Local/Temp/Rtmp4myCHc/model-32b0700b5bf4.stan', line 7, column 0: fabs
was removed in Stan 2.33. Use abs instead. This can be automatically
changed using the canonicalize flag for stanc
mingw32-make: *** [make/program:50: C:\Users\edwar\AppData\Local\Temp\Rtmp4myCHc\model-32b0700b5bf4.hpp] Error 65
Error: An error occured during compilation! See the message above for more information.
To fix deprecated or removed syntax please see ?cmdstanr::format for an example.
I'm using the master branch version of idealstan
. I'm also using the most up-to-date packages:
- cmdstanr, version 0.6.1.9000.
- idealstan, version 0.99.
- StanHeaders, version 2.32.2.
- rstan, version 2.32.3.
Any idea what's going on?
hi @PatrickJEdwards - yes you are using the latest version of Stan, which made a syntax change an error (specifically how arrays are defined).
I have fixed this in the develop branch, if you want to pull that. It is unstable though so not all features might work. Otherwise you can downgrade Stan, which is pretty easy (just use the install_cmdstan function in cmdstanr and specify a version number say 6 months old). Note that idealstan does not use rstan or Stanheaders, so those are irrelevant.
I will leave the issue open until I next merge to master, which should be before too long for anyone who reads this.