BrunaLab / bdffpRain

R package for rain gauge data from the Biological Dynamics of Forest Fragments Project.
MIT License
0 stars 0 forks source link

How to aggregate monthly precip with accumulated values #13

Closed Aariq closed 4 years ago

Aariq commented 4 years ago

If a 5 day accumulation falls on the 3rd of the month, then some of that precip belongs in the previous month. With longer accumulations, it is less clear how to spread out the precipitation across month borders. See if there are standards for how to deal with this.

Aariq commented 4 years ago

To calculate monthly totals, NOAA only uses months without multi-day accumulations that cross month borders and only considers 2 and 3-day accumulations (a 1 or 2 day gap). https://doi.org/10.1175/JAMC-D-13-051.1

By following the method in WMO (1989), a total was calculated for every month that was complete when daily values, 2-day accumulations, and 3-day accumulations were considered. Multiday accumulations that extended from the end of one month to the beginning of another were excluded.

If data for a month didn't meet these criteria, this produced anNA which was later interpolated when calculating average monthly totals. They provide detailed methods in Appendix B.

Aariq commented 4 years ago

A good stackexchange thread with resources for imputation of multivariate time series: https://stats.stackexchange.com/questions/103968/imputing-missing-observation-in-multivariate-time-series

This package, in particular, seems useful: https://cran.r-project.org/web/packages/mtsdi/index.html

Aariq commented 4 years ago

https://stats.stackexchange.com/questions/261271/imputation-methods-for-time-series-data/290563

Aariq commented 4 years ago

I've decided to remove accumulations > 20mm (arbitrary, but supported by literature), aggregate sites into clusters, and use Amelia to impute NAs.