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

How to run this? #28

Open
NunoSempere opened this issue Jun 24, 2023 · 2 comments
Open

How to run this? #28

NunoSempere opened this issue Jun 24, 2023 · 2 comments

Comments

@NunoSempere
Copy link

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".

@elliottmorris
Copy link
Contributor

elliottmorris commented Jun 24, 2023 via email

@NunoSempere
Copy link
Author

NunoSempere commented Jun 24, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants