Open NatalyaDryomys opened 7 months ago
Same issue here. I tried a couple of simulation datasets and found out the SPEI only returns correct values when the number of years is >= 5. When I calculated for 1, 2, or 3 years, SPEI returned all NAs. When I calculated for 4 years, it seemed fine in general, but every year's January and February SPEI are NAs.
In my examples, frequency = 12, scale = 3.
Good day, I am trying to calculate the SPEI Index for my dataset (attached), but spei only returns NA's. What is wrong with my data?
season$PET<-hargreaves(Tmin=season$TMIN, Tmax=season$TMAX, lat = 54.929855) season$CWBAL<-season$PRCP-season$PET season.ts=ts(season, end=c(2023, 12), frequency = 12) spei.res=spei(season.ts[,'CWBAL'], 12) spei.res str(spei.res)
season.csv