bfast2 / bfast2/strucchangeRcpp
Error in my.RSS.table[as.character(i), 3:4] <- c(pot.index[opt], break.RSS[opt]) : replacement has length zero
- Lenguaje dominante
- R
- Estrellas
- 6
- Forks
- 5
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
This is a very odd edge case. With a specific `h` value and specifically when using both `trend` and `harmon` components of `bfastpp`, for specific data, I get the error:
```
Error in my.RSS.table[as.character(i), 3:4] <- c(pot.index[opt], break.RSS[opt]) :
replacement has length zero
```
Also a lot of warnings about `sqrt()` producing `NaN` values. Looks like that line fails because `opt` is an `integer(0)`, and that is because `break.RSS` is a single `NaN` (which probably comes from the `sqrt` problem, which in turn comes from `fr` in `recresid` being a negative value, which comes from `X1` having negative values, and I don't know what `X1` stands for).
To reproduce, see attached CSV, and then run the code:
```r
breakpoints(formula(response~trend+harmon), data=
bfastpp(bfastts(CSV$evi, CSV$time), "irregular"), order=3), h=46)
```
[bug.txt](https://github.com/appelmar/strucchange/files/2495275/bug.txt)
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Empieza reproduciendo la llamada reportada a breakpoints() con el CSV adjunto, usando bfastpp() y bfastts() tal como se muestra. Traza cómo recresid(), X1, break.RSS y opt producen NaN y la sustitución vacía; el trabajo está terminado cuando el ejemplo ya no falla con un error de longitud de sustitución y el comportamiento de este caso límite está cubierto por una prueba de regresión.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- r
- Área
- data
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100