gbradburd/conStruct

Error: Incorrect number of subscripts

Closed this issue · 8 comments

Hi Gideon,

I seem to be running into a problem running spatial analyses, with both my dataset and also the example dataset provided in the vignette.

The output is:
SAMPLING FOR MODEL 'space_multiK' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 0.000278 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 2.78 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
[1] "Error in sampler$call_sampler(args_list[[i]]) : " " c++ exception (unknown reason)"
error occurred during calling the sampler; sampling not done
Stan model 'space_multiK' does not contain samples.
Stan model 'space_multiK' does not contain samples.
Stan model 'space_multiK' does not contain samples.
Error in par.cov[, i, j] <- rstan::extract(model.fit, pars = my.par, inc_warmup = TRUE, :
incorrect number of subscripts

Cheers,
James

Hm, I see. Thanks for the report. The error is actually " c++ exception (unknown reason)" (it's first, so it caused the other ones). The first thing to suspect is your rstan installation. Can you run other models in rstan, e.g., from their documentation?

Hi James,

This is a shot in the dark, but are you a Mac user who's recently updated to OS Catalina? If so, that's been creating trouble for lots of rstan users. The long thread here contains some suggestions and more information if that's the issue.

If that's not what's happening, then yes following Peter's advice I'd be curious if you can run any of the models from rstan's documentation.

Hi Gideon,

That was an accurate shot in the dark! Thanks for the link, I’ll check it out and work through the suggestions.

Best,
James

Hi James - is this issue still unresolved for you? If not, I'll go ahead and close it out.

Hi Gideon,

Yep, all good to close the thread. Thanks for checking in

Cheers,
James

I am having this exact same issue, but I am on my windows computer. Here is the following error:

Error : Exception: variable does not exist; processing stage=data initialization; variable name=obsCov; base type=double (in 'string', line 35, column 1 to column 20)
failed to create the sampler; sampling not done
Stan model 'space_multiK' does not contain samples.
Stan model 'space_multiK' does not contain samples.
Stan model 'space_multiK' does not contain samples.
Error in par.cov[, i, j] <- rstan::extract(model.fit, pars = my.par, inc_warmup = TRUE, :
incorrect number of subscripts

It was working fine before! Is there perhaps an r version issue here?

You said it was working before - have you updated any software between when it was working and when it broke?

I think I solved the issue! My Rstudio was loading the wrong R version