Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculation of SPEI only returns NA values #76

Open
NatalyaDryomys opened this issue Apr 25, 2024 · 1 comment
Open

Calculation of SPEI only returns NA values #76

NatalyaDryomys opened this issue Apr 25, 2024 · 1 comment

Comments

@NatalyaDryomys
Copy link

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

@gingerlolipop
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants