'reject' stan command conflicts with UCBadmit data

Aperta
#413 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
r
Ambito
data

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
R
Stelle
2.4k
Fork
632
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rmcelreath/rethinking

Tutte le issue di rmcelreath/rethinking

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.