'reject' stan command conflicts with UCBadmit data
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
Research direction
The failure comes from the reject column of the bundled UCBadmit dataset, which Stan treats as a reserved word when ulam generates the data block. Find where UCBadmit is defined in the package (its data file or data-raw script) and check whether the column is used elsewhere in the examples. Rename it, rebuild the dataset, then run the ulam example from the issue to confirm it compiles.
Written by the indexing model from the issue text.
Description
Was going thru the examples on the github page. Running this code:
data( UCBadmit )
UCBadmit$male <- as.integer(UCBadmit$applicant.gender=="male")
UCBadmit$dept <- rep( 1:6 , each=2 )
UCBadmit$applicant.gender <- NULL
m_glmm1 <- ulam(
alist(
admit ~ binomial(applications,p),
logit(p) <- a[dept] + b*male,
a[dept] ~ normal( abar , sigma ),
abar ~ normal( 0 , 4 ),
sigma ~ half_normal(0,1),
b ~ normal(0,1)
), data=UCBadmit )
I got this error:
Syntax error in '/var/folders/xy/d1z300jj79j9swfc9hkg6v1h0000gq/T/Rtmpip9UOG/model-180f658fd6385.stan', line 2, column 18 to column 24, parsing error:
-------------------------------------------------
1: data{
2: array[12] int reject;
^
3: array[12] int applications;
4: array[12] int admit;
-------------------------------------------------
Expected a new identifier but found reserved keyword 'reject'.
make: *** [/var/folders/xy/d1z300jj79j9swfc9hkg6v1h0000gq/T/Rtmpip9UOG/model-180f658fd6385.hpp] Error 1
Error: An error occured during compilation! See the message above for more information.
I think the reject column in the UCBadmit data should be remaned to avoid this.
- 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