stan-dev / example-models

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

Example script `fit_nyc_bym2.R` to use model `bym2_offset_only.stan` doesn't work #181

Open ghost opened 4 years ago

ghost commented 4 years ago

When I run the fit_nyc_bym2.R script, it first fails because the variable clipped_nyc_subset_shp (in line 15) is not defined. After commenting that out, the call to sampling (in line 31) fails with:

Error in new_CppObject_xp(fields$.module, fields$.pointer, ...) :
  Exception: variable does not exist; processing stage=data initialization; variable name=N; base type=int  (in 'model15d849c4f0f_bym2_offset_only' at line 3)

The variable N exists and is of type int, which is, IIUC, what the bym2_offset_only.stan model expects.

ghost commented 4 years ago

@mitzimorris, I see that you created this script, do you maybe have an idea why it doesn't work / what I could do to fix it?