Poisson response imputation compilation error
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
Research direction
The failure comes from the ulam model-list syntax, where a constrained vector declaration like vector<lower=0>[3147] lands inside the Stan model block and Stan rejects it. Start by reproducing the error with a minimal ulam model that declares a constrained vector of fixed length, then read how the package translates declarations into Stan code. Done means either the model compiles from the declared form or the docs and error message show the correct way to declare a bounded latent vector. No comments or pull request exist, so confirm the maintainer's expected syntax before changing anything.
Written by the indexing model from the issue text.
Description
Hi everyone,
I am trying to impute a response variable that ~Poisson or ~Gamma-Poisson but I get this compilation error probably because Stan doesn't like constraints in the model compartment.
25: model{
26: vector[3147] R_merge;
27: vector<lower=0>[3147] lambda;
^
28: phi ~ exponential( 1 );
29: D ~ normal( 0 , 3 );
Expected "[" expression "]" for vector size.
Is there any way to deal with this within the Ulam environment without having to hardcode everything into Stan? You cannot get the stancode() before the it compiles I believe, so ones has to write everything from scratch.
Thank you!
- Dominant language
- R
- Stars
- 2.4k
- Forks
- 632
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rmcelreath/rethinking
-
Typo: p.381Open
Difficulty 1/5 Under an hour Newbie friendliness 95/100
rmcelreath/rethinking#482 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
rmcelreath/rethinking#476 ·
-
Typo: p.302Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
rmcelreath/rethinking#475 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
rmcelreath/rethinking#474 ·
-
Comma splice: p.557Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
rmcelreath/rethinking#471 ·
All issues in rmcelreath/rethinking
Similar issues
-
1.7
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pharmaverse/admiral#3235 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
SticsRPacks/CroPlotR#185 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day