problems using loo in clogit models
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Comienza reproduciendo el comportamiento constante de Pareto-k de la tercera columna con loo::loo.matrix usando el ejemplo stan_clogit y los datos infert descritos en el issue. Revisa cómo loo::loo, loo::loo.matrix y loo.stanreg dividen las responsabilidades; después determina qué comportamiento se pretende y define cobertura de regresión para el tratamiento acordado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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 ?
- Lenguaje dominante
- R
- Estrellas
- 157
- Forks
- 38
- Merge medio
- 4 d 16 h
- PR fusionados (30 d)
- 2
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de stan-dev/loo
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Extend loo_plot_difference Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
-
Clean up issues Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Todos los issues de stan-dev/loo
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
robjhyndman/forecast#1220 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
JamesHWade/deputy#192 ·
-
bug triage_needed
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
pharmaverse/rtables#1123 · 1 comentario · 1 reacción ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100