bfast2 / bfast2/strucchangeRcpp
Error in my.RSS.table[as.character(i), 3:4] <- c(pot.index[opt], break.RSS[opt]) : replacement has length zero
- Langage dominant
- R
- Étoiles
- 6
- Forks
- 5
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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)
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par reproduire l'appel signalé à breakpoints() avec le CSV joint, en utilisant bfastpp() et bfastts() comme indiqué. Suivez la manière dont recresid(), X1, break.RSS et opt produisent NaN et le remplacement vide ; le travail est terminé lorsque l'exemple n'échoue plus avec une erreur de longueur de remplacement et que le comportement pour ce cas limite est couvert par un test de régression.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- r
- Domaine
- data
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100