TheEconomist/us-potus-model

How to run this?

Opened this issue · 2 comments

I'm trying to run the scripts/model/poll_model_2020.stan. After compiling it with cmdstan, I keep getting the error:

$ ./poll_model_2020  method=sample  num_samples=1000 num_warmup=1000
method = sample (Default)
  sample
    num_samples = 1000 (Default)
    num_warmup = 1000 (Default)
    save_warmup = 0 (Default)
    thin = 1 (Default)
    adapt
      engaged = 1 (Default)
      gamma = 0.050000000000000003 (Default)
      delta = 0.80000000000000004 (Default)
      kappa = 0.75 (Default)
      t0 = 10 (Default)
      init_buffer = 75 (Default)
      term_buffer = 50 (Default)
      window = 25 (Default)
    algorithm = hmc (Default)
      hmc
        engine = nuts (Default)
          nuts
            max_depth = 10 (Default)
        metric = diag_e (Default)
        metric_file =  (Default)
        stepsize = 1 (Default)
        stepsize_jitter = 0 (Default)
    num_chains = 1 (Default)
id = 1 (Default)
data
  file =  (Default)
init = 2 (Default)
random
  seed = 4125478090 (Default)
output
  file = output.csv (Default)
  diagnostic_file =  (Default)
  refresh = 100 (Default)
  sig_figs = -1 (Default)
  profile_file = profile.csv (Default)
num_threads = 1 (Default)

Exception: variable does not exist; processing stage=data initialization; variable name=N_national_polls; base type=int (in '../us-potus-model/scripts/model/poll_model_2020.stan', line 2, column 2 to column 23)

My sense is that there is probably some data file that I'd have to feed into this, but, being a complete novice with stan, I'm not sure where to find it. If I use

$ ./poll_model_2020  method=sample  num_samples=1000 num_warmup=1000 data file=../../data/all_polls.csv

I still get the same error.

Any thoughts? Coming from https://statmodeling.stat.columbia.edu/2023/06/14/the-economist-is-hiring-a-political-data-scientist-to-do-election-modeling/, where Andrew mentioned that getting this model to run would be "trivial".

Oh, sad to see. Is there any chance that now, a few years after the election, you could make that part of the code publicly reproducible? I understand if this is too much trouble, though, or if you want to hide some stuff to keep some "modelling lead" in advance of the 2024 election.