stan-dev / example-models

Example models for Stan
http://mc-stan.org/
772 stars 479 forks source link

Some of these models don't compile with Stan 2.17.1+ #127

Closed seantalts closed 3 years ago

seantalts commented 6 years ago

ARM/Ch.21/finite_populations.stan ARM/Ch.21/multiple_comparison.stan ARM/Ch.21/r_sqr.stan ARM/Ch.23/electric_1a.stan ARM/Ch.23/educational_subsidy.stan bugs_examples/vol2/pines/pines-3.stan bugs_examples/vol3/fire/fire.stan

error messages:

SYNTAX ERROR, MESSAGE(S) FROM PARSER:

variable "a_0" does not exist.
  error in 'examples/example-models/ARM/Ch.21/finite_populations.stan' at line 15, column 14
  -------------------------------------------------
    13: 
    14:   //finite population sd for when group level predictors are present
    15:   g_hat = a_0 + a_1 * u_1 + a_2 * u;
                     ^
    16: } 
  -------------------------------------------------

SYNTAX ERROR, MESSAGE(S) FROM PARSER:

variable "j" does not exist.
  error in 'examples/example-models/ARM/Ch.21/r_sqr.stan' at line 11, column 11
  -------------------------------------------------
     9:   vector[n_county] a;
    10:   vector[n_county] b;
    11:   matrix[j,2] B;
                  ^
    12:   matrix[j,2] B_hat;
  -------------------------------------------------

make: *** [examples/example-models/ARM/Ch.21/r_sqr.hpp] Error 253
make: *** Waiting for unfinished jobs....
make: *** [examples/example-models/ARM/Ch.21/finite_populations.hpp] Error 253

SYNTAX ERROR, MESSAGE(S) FROM PARSER:

variable "theta" does not exist.
  error in 'examples/example-models/ARM/Ch.21/multiple_comparison.stan' at line 12, column 8
  -------------------------------------------------
    10: model {
    11:   mu_theta ~ normal(0, 1);
    12:   theta ~ normal(100 * mu_theta, sigma_theta);
               ^
    13:   y ~ normal(theta, sigma_y);
  -------------------------------------------------

make: *** [examples/example-models/ARM/Ch.21/multiple_comparison.hpp] Error 253

SYNTAX ERROR, MESSAGE(S) FROM PARSER:

Warning (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
Warning (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
Warning (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
Warning (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
Warning (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
Warning (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
  error in 'examples/example-models/bugs_examples/vol3/fire/fire.stan' at line 49, column 26
  -------------------------------------------------
    47:   for (i in 1:N) {  
    48:     if (theta > x[i]) 
    49:       lpa[i] <- ( log_tmp,
                                 ^
    50:                   + neg_log1p_temp
  -------------------------------------------------

PARSER EXPECTED: ")"

SYNTAX ERROR, MESSAGE(S) FROM PARSER:

variable "g_0" does not exist.
  error in 'examples/example-models/ARM/Ch.23/educational_subsidy.stan' at line 26, column 19
  -------------------------------------------------
    24:                   + beta[3] * poor[i] + beta[4] * male[i] + beta[5] * age97[i];
    25:   for (j in 1:J)
    26:     a_hat[j] = g_0 + g_1 * program[j];
                          ^
    27: }
  -------------------------------------------------

make: *** [examples/example-models/bugs_examples/vol3/fire/fire.hpp] Error 253
make: *** [examples/example-models/ARM/Ch.23/educational_subsidy.hpp] Error 253

SYNTAX ERROR, MESSAGE(S) FROM PARSER:

Warning (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
Warning (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
Warning (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
Warning (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
Warning (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
Warning: Deprecated function 'normal_log'; please replace suffix '_log' with '_lpdf' for density functions or '_lpmf' for mass functions
Warning: Deprecated function 'normal_log'; please replace suffix '_log' with '_lpdf' for density functions or '_lpmf' for mass functions
Warning: Deprecated function 'normal_log'; please replace suffix '_log' with '_lpdf' for density functions or '_lpmf' for mass functions
Warning: Deprecated function 'gamma_log'; please replace suffix '_log' with '_lpdf' for density functions or '_lpmf' for mass functions
Warning: Deprecated function 'normal_log'; please replace suffix '_log' with '_lpdf' for density functions or '_lpmf' for mass functions
Warning: Deprecated function 'normal_log'; please replace suffix '_log' with '_lpdf' for density functions or '_lpmf' for mass functions
Warning: Deprecated function 'normal_log'; please replace suffix '_log' with '_lpdf' for density functions or '_lpmf' for mass functions
Warning: Deprecated function 'gamma_log'; please replace suffix '_log' with '_lpdf' for density functions or '_lpmf' for mass functions
  error in 'examples/example-models/bugs_examples/vol2/pines/pines-3.stan' at line 49, column 17
  -------------------------------------------------
    47:     + normal_log(beta, 0, sqrt(1e4))
    48:     + gamma_log(tau[1], 0.0001, 0.0001)
    49:     + normal_log(gamma, 
                        ^
    50: 
  -------------------------------------------------

PARSER EXPECTED: "("

make: *** [examples/example-models/bugs_examples/vol2/pines/pines-3.hpp] Error 253
bob-carpenter commented 6 years ago

Those don't look like they'd ever have parsed.

What should we do with all these old ARM models? The new ARM is on its way, but that doesn't solve the immediate problem.

danluu commented 6 years ago

Linking this to #23 via github's magic autolinking since they look closely related.

mitzimorris commented 6 years ago

I used cmdstan to make all the ARM models, and the following failed to compile:

ARM/Ch.21/r_sqr.hpp
ARM/Ch.21/finite_populations.hpp
ARM/Ch.21/multiple_comparison.hpp
ARM/Ch.17/17.6_multilevel_ordered_categorical.hpp
ARM/Ch.17/17.2_radon_correlation.hpp
ARM/Ch.17/17.1_radon_correlation.hpp
ARM/Ch.17/17.2_radon_vary_inter_slope.hpp
ARM/Ch.17/17.2_radon_multi_varying_coef.hpp
ARM/Ch.17/17.7_robit.hpp
ARM/Ch.17/17.5_multilevel_poisson.hpp
ARM/Ch.17/17.1_radon_multi_varying_coef.hpp
ARM/Ch.17/17.7_latent_glm.hpp
ARM/Ch.17/17.2_radon_wishart.hpp
ARM/Ch.17/17.3_flight_simulator.hpp
ARM/Ch.17/17.4_multilevel_logistic.hpp
ARM/Ch.17/17.1_radon_vary_inter_slope.hpp
ARM/Ch.17/17.1_radon_wishart2.hpp
ARM/Ch.17/17.1_radon_wishart.hpp
ARM/Ch.23/educational_subsidy.hpp

working from develop on both cmdstan, stan: cmdstan: v2.17.1-59-g395efdd stan: v2.17.1-147-g30b902a0d

mitzimorris commented 6 years ago

checked compilation of BUGS models - 2 don't compile:

bugs_examples/vol3/fire/fire.hpp
bugs_examples/vol2/pines/pines-3.hpp
mitzimorris commented 6 years ago

these 3 ARM models don't compile; can't figure out what to do by looking at BUGS code in ARM Ch. 21:

example-models/ARM/Ch.21/finite_populations.stan
example-models/ARM/Ch.21/multiple_comparison.stan
example-models/ARM/Ch.21/r_sqr.stan