yotkadata / meteo_hist

A web app to create interactive temperature and precipitation graphs for places around the world
https://yotka.org/meteo-hist/
Other
42 stars 3 forks source link

Where do the confidence interval values come from? #3

Closed JoBerkner closed 1 year ago

JoBerkner commented 1 year ago

I just found out about your app and really like it. Just one thing I couldn't figure out is how you get the 5% and 95% confidence interval. In the meteo app I couldn't find. Do you calculate them on the fly from historic values from each station for each 30 year avarage period?

yotkadata commented 1 year ago

Hi @JoBerkner, the 5th/95th percentiles (not confidence intervals) are calculated from the data in the given reference period. You can find the code here:

https://github.com/yotkadata/meteo_hist/blob/ce3ee9a1e25edfbfc3bf8734e7d423f8cfa5ff80/utils.py#L393

Basically, the raw data (temperature by day) is grouped and aggregated by day of year. That gives us (for every day of the year) the minimum, 5th percentile, mean, 95th percentile, and maximum value in the reference period. min and max are currently not shown in the graph.