problems using loo in clogit models
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia riproducendo il comportamento costante di Pareto-k della terza colonna con loo::loo.matrix usando l’esempio stan_clogit e i dati infert descritti nell’issue. Esamina come loo::loo, loo::loo.matrix e loo.stanreg suddividono le responsabilità, quindi stabilisci quale comportamento è previsto e definisci la copertura di regressione per la gestione concordata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
In a rstanarm branch, I introduced a stan_clogit function which is similar to the clogit function in the survival package but is actually described in more detail by Stata ( http://www.stata.com/manuals13/rclogit.pdf ). So, you will be able to do
post <- stan_clogit(case ~ spontaneous + induced, strata = stratum,
data = infert[order(infert$stratum, !infert$case),], QR = TRUE)
The problem is that some groups have the same values on the dummy variables spontaneous and induced, such as
> infert[infert$stratum == 3,]
education age parity induced case spontaneous stratum pooled.stratum
3 0-5yrs 39 6 2 1 0 3 4
86 0-5yrs 39 6 2 0 0 3 4
168 0-5yrs 39 6 2 0 0 3 4
Thus, no matter what are the posterior realizations of the coefficients on spontaneous and induced, the likelihood for group 3 is the same.
I am pretty sure the correct concept for a clogit model is to imagine leaving out one group rather than one observation, but when I call loo::loo.matrix, the third column of the input is a constant, which causes the Pareto k estimate to be infinite. Since the third group could be omitted and only change the log-likelihood by a constant, this seems to be unreasonable.
The question becomes, what function should be catching this? We could have stan_clogit drop groups that have only one unique row in the design matri{x,ces}. We could have loo.stanreg omit such groups. Or loo::loo could check which Pareto k estimates are infinite and change them to some number when the log likelihoods are finite but constant. Thoughts @avehtari ?
- Lingua principale
- R
- Stelle
- 157
- Fork
- 38
- Merge medio
- 4g 16h
- PR unite (30g)
- 2
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di stan-dev/loo
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Extend loo_plot_difference Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
Clean up issues Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
Tutte le issue di stan-dev/loo
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
robjhyndman/forecast#1220 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
JamesHWade/deputy#192 ·
-
bug triage_needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pharmaverse/rtables#1123 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100