| Title: | Statistical Modeling of Compound Events |
|---|---|
| Description: | Tools for extracting occurrences, assessing potential driving factors, predicting occurrences, and quantifying impacts of compound events in hydrology and climatology. Please see Hao Zengchao et al. (2022) <doi:10.1016/j.earscirev.2022.104241>. |
| Authors: | Zengchao Hao [aut, cre] |
| Maintainer: | Zengchao Hao <[email protected]> |
| License: | GPL-3 |
| Version: | 1.0 |
| Built: | 2026-06-04 09:37:20 UTC |
| Source: | https://github.com/drought/compoundevents |
Tools for extracting occurrences, assessing potential driving factors, predicting occurrences, and quantifying impacts of compound events (with focus on dry-hot events) in hydrology and climatology.
Examples of compound events in hydroclimatology with focus on compound dry-hot events.
The function GetDH is used for extracting occurrences based on thresholds of dry and hot indicators.
The function ChangeDH is used for changes in compound dry and hot events.
The function DriverLogit is used for assessing potential driving factors of compound events based on logistic regression model.
The function PredLogit is used for predicting occurrences of compound events.
The function ImpactMGDH is used for quantifying impacts of compound dry and hot events on a sector (e.g., crop yield, GPP,NDVI) based on meta-Gaussian model.
The function SCEIDH is used for computing the standardized compound event index of compound dry-hot events.
Zengchao Hao
Hao, Z., et al.(2013). Changes in concurrent monthly precipitation and temperature extremes. Environ. Res. Lett. 8: 034014.
Hao, Z. et al. (2019). A monitoring and prediction system for compound dry and hot events. Environ. Res. Lett., 14:114034.
Hao, Z. et al. (2019). Statistical prediction of the severity of compound dry-hot events based on ENSO . J. Hydrol., 572: 243-250.
Feng, S. et al. (2019). Probabilistic evaluation of the impact of compound dry-hot events on global maize yields. Sci. Total. Environ., 689: 1228-1234.
Hao, Z et al. (2022). Compound droughts and hot extremes: Characteristics, drivers, changes, and impacts. Earth Sci. Rev., 235, 104241.
Obtain the accumulation of monthly hydro-climatic variables
ACCU(X, ts = 6)ACCU(X, ts = 6)
X |
The vector of monthly hydro-climatic variables of n years. ts is the accumulated time scale. |
ts |
The accumulated time scale |
X=runif(120, min = 0, max = 100) # 10-year monthly data Y<-ACCU(X,ts=3) # Compute the 3 month accumulated seriesX=runif(120, min = 0, max = 100) # 10-year monthly data Y<-ACCU(X,ts=3) # Compute the 3 month accumulated series
Assess absolute/relative changes in compound dry-hot (DH) events at the monthly scale and event occurrences at the annual scale.
ChangeDH(pre,tem,threp,thret)ChangeDH(pre,tem,threp,thret)
pre |
monthly precipitation of several decades |
tem |
monthly temperature of several decades |
threp |
Threshold of precipitation (e.g., 20th percentile) |
thret |
Threshold of temperature (e.g., 80th percentile) |
The absolute/relative change for each month and annual occurrence
Hao, Z. et al. (2018). A multivariate approach for statistical assessments of compound extremes. J. Hydrol., 565: 87-94.
Hao, Z. et al. (2019). A monitoring and prediction system for compound dry and hot events. Environ. Res. Lett., 14:114034.
pre=runif(1200, min = 0, max = 100) # 100-year monthly precipitation tem=runif(1200, min = 0, max = 100) # 100-year monthly temperature threp=20 #Specify the percentile-based threshold thret=80 # Specify the percentile-based threshold chg<-ChangeDH(pre,tem,threp,thret) # chg$abschg,chg$relchg, chg$yrtotalpre=runif(1200, min = 0, max = 100) # 100-year monthly precipitation tem=runif(1200, min = 0, max = 100) # 100-year monthly temperature threp=20 #Specify the percentile-based threshold thret=80 # Specify the percentile-based threshold chg<-ChangeDH(pre,tem,threp,thret) # chg$abschg,chg$relchg, chg$yrtotal
Assess changes in compound humid-hot (WH) occurrences at monthly and annual scales.
ChangeWH(pre,tem,threp,thret)ChangeWH(pre,tem,threp,thret)
pre |
monthly precipitation of several decades |
tem |
monthly temperature of several decades |
threp |
Threshold of precipitation (e.g., 80th percentile) |
thret |
Threshold of temperature (e.g., 80th percentile) |
The absolute/relative change for each month and annual occurrence
Hao, Z., AghaKouchak, A., Phillips, T.J., 2013. Changes in concurrent monthly precipitation and temperature extremes. Environ. Res. Lett. 8(3), 034014.
pre=runif(1200, min = 0, max = 100) # 100-year monthly precipitation tem=runif(1200, min = 0, max = 100) # 100-year monthly temperature threp=80 #Specify the percentile-based threshold thret=80 # Specify the percentile-based threshold chg<-ChangeWH(pre,tem,threp,thret) # chg$abschg,chg$relchg, chg$yrtotalpre=runif(1200, min = 0, max = 100) # 100-year monthly precipitation tem=runif(1200, min = 0, max = 100) # 100-year monthly temperature threp=80 #Specify the percentile-based threshold thret=80 # Specify the percentile-based threshold chg<-ChangeWH(pre,tem,threp,thret) # chg$abschg,chg$relchg, chg$yrtotal
A dataset of monthly precipitation, temperature, and Niño3.4 index for 1951-2016 and monthly GPP for 1981–2016 (1951-1980 are NAN).
data(dfptng)data(dfptng)
A data frame with 792 rows (12 months × 66 years) and 4 variables:
Monthly precipitation(unit:mm/month)
Monthly average temperature (unit: °C)
Monthly ENSO index (e.g., Nino3.4)
GPP
The data were obtained from ERA-5, NOAA, and FLUXCOM.
Use logistic regression model to establish relationship between climate indices (e.g., ENSO) and occurrences of compound dry-hot events.
DriverLogit(Y,X)DriverLogit(Y,X)
Y |
Occurrence of compound dry-hot events (0-1 binary variable) |
X |
Climate index as the driving factor of compound events (e.g., ENSO) |
slope parameter and associated p-value
Hao, Z. et al. (2019). A monitoring and prediction system for compound dry and hot events. Environ. Res. Lett., 14:114034.
X=c(-0.7,-1.2,1.3,0.7,-0.6,1.1,-0.5,0.8,0.5, -0.5,1.6,-1.8,-0.5,-1.4,-0.1,2.2,-0.7,-1.1, 0.6, -1.7) # climate indices Y=c(0,0,1,1,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0 ) # dry-hot occurrences div<-DriverLogit(Y,X) # div$slope and div$pvalueX=c(-0.7,-1.2,1.3,0.7,-0.6,1.1,-0.5,0.8,0.5, -0.5,1.6,-1.8,-0.5,-1.4,-0.1,2.2,-0.7,-1.1, 0.6, -1.7) # climate indices Y=c(0,0,1,1,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0 ) # dry-hot occurrences div<-DriverLogit(Y,X) # div$slope and div$pvalue
Compute univariate empirical probability
Empdis1(mp)Empdis1(mp)
mp |
monthly precipitation of a month for several decades |
The empirical probability
Hao, Z. et al., 2019a. Statistical prediction of the severity of compound dry-hot events based on El Ni??o-Southern Oscillation. J. Hydrol., 572, 243-250.
mp=matrix(rnorm(120,0,1),ncol=1) ep1<-Empdis1(mp)mp=matrix(rnorm(120,0,1),ncol=1) ep1<-Empdis1(mp)
Compute bivariate empirical probability
Empdis2(mp,mt)Empdis2(mp,mt)
mp |
monthly precipitation of a month for several decades |
mt |
monthly temperature of a month for several decades |
The bivariate empirical probability
Hao, Z. et al., 2019a. Statistical prediction of the severity of compound dry-hot events based on El Ni??o-Southern Oscillation. J. Hydrol., 572, 243-250.
mp=matrix(rnorm(120,0,1),ncol=1) mt=matrix(rnorm(120,0,1),ncol=1) ep2<-Empdis2(mp,mt)mp=matrix(rnorm(120,0,1),ncol=1) mt=matrix(rnorm(120,0,1),ncol=1) ep2<-Empdis2(mp,mt)
Get compound dry-hot (DH) events based on thresholds precipitation and temperature, resulting in a 0-1The binary variable
GetDH(mp,mt,threp,thret)GetDH(mp,mt,threp,thret)
mp |
Precipitation |
mt |
Temperature |
threp |
Threshold of precipitation (e.g., 20th percentile) |
thret |
Threshold of temperature (e.g., 80th percentile) |
The occurrence of compound dry-hot events (0-1 binary variable)
Hao, Z. et al. (2018). A multivariate approach for statistical assessments of compound extremes. J. Hydrol., 565: 87-94.
Hao, Z. et al. (2019). A monitoring and prediction system for compound dry and hot events. Environ. Res. Lett., 14:114034.
mp=matrix(rnorm(60,0,1),ncol=1) # prec. of a month (e.g., August,60 years) mt=matrix(rnorm(60,0,1),ncol=1) # temp. of a month (e.g., August,60 years) threp=20 #Specify the percentile-based threshold thret=80 #Specify the percentile-based threshold DH<-GetDH(mp,mt,threp,thret) # 0-1 seriesmp=matrix(rnorm(60,0,1),ncol=1) # prec. of a month (e.g., August,60 years) mt=matrix(rnorm(60,0,1),ncol=1) # temp. of a month (e.g., August,60 years) threp=20 #Specify the percentile-based threshold thret=80 #Specify the percentile-based threshold DH<-GetDH(mp,mt,threp,thret) # 0-1 series
Extract compound wet-hot (WH) occurrences based on thresholds of precipitation and temperature.The binary variable of the WH (or wet-warm,WW) event can be obtained.
GetWH(mp,mt,threp,thret)GetWH(mp,mt,threp,thret)
mp |
Precipitation |
mt |
Temperature |
threp |
Threshold of precipitation (e.g., 80th percentile) |
thret |
Threshold of temperature (e.g., 80th percentile) |
The occurrence of compound wet-hot events (0-1 binary variable)
Hao, Z. et al (2013). Changes in concurrent monthly precipitation and temperature extremes. Environ. Res. Lett., 8(3): 034014.
mp=matrix(rnorm(120,0,1),ncol=1) mt=matrix(rnorm(120,0,1),ncol=1) threp=80 thret=80 WH<-GetWH(mp,mt,threp,thret)mp=matrix(rnorm(120,0,1),ncol=1) mt=matrix(rnorm(120,0,1),ncol=1) threp=80 thret=80 WH<-GetWH(mp,mt,threp,thret)
Use meta-Gaussian model to construct conditional distributions of the standardized impact variable (SII) given SPI and STI (represented by random variables of Z, X, and Y). The output include (1) the conditional mean and variance of STI given SPI and STI (e.g., X0=-1.2 and y0=1.2) (2)The conditional probability of P(SII<=z0|SPI<=x0, STI>y0), or lower GPP given dry-hot conditions
ImpactMGDH(mp,mt,mi,x0,y0,z0=NULL)ImpactMGDH(mp,mt,mi,x0,y0,z0=NULL)
mp |
monthly precipitation of a month (e.g., August) |
mt |
monthly temperature of a month (e.g., August) |
mi |
Impact variable of a month (e.g., GPP, Crop yield) |
x0 |
Initial condition of SPI (e.g., -1.2, dry conditions) |
y0 |
Initial condition of STI (e.g., 1.2, hot conditions) |
z0 |
Initial condition of standardized impact indicator(e.g.,0, low GPP) |
(1) Conditional mean/variance at SPI=x0, STI=y0, here z0=NULL (2)conditional probability of lower SII given lower SPI and higher STI or P(SZI<=z0|SPI<=x0, STI>y0), here z0 should be specified
Feng S.,Hao Z., et al. (2019). Probabilistic evaluation of the impact of compound dry-hot events on global maize yields. Sci. Total. Environ., 689: 1228-1234.
Hao Z., et al. (2018). A multivariate approach for statistical assessments of compound extremes. J. Hydrol., 565: 87-94.
mp=matrix(rnorm(60,0,1),ncol=1) # precipitation of a month (60 years) mt=matrix(rnorm(60,0,1),ncol=1) # temperature of a month (60 years) mi=matrix(rnorm(60,0,1),ncol=1) # impact of a month (60 years) imp1<-ImpactMGDH(mp,mt,mi,-1.2,1.2,NULL) # imp1$mu, imp1$sig imp2<-ImpactMGDH(mp,mt,mi,-1.2,1.2,0)# imp2$Condprobmp=matrix(rnorm(60,0,1),ncol=1) # precipitation of a month (60 years) mt=matrix(rnorm(60,0,1),ncol=1) # temperature of a month (60 years) mi=matrix(rnorm(60,0,1),ncol=1) # impact of a month (60 years) imp1<-ImpactMGDH(mp,mt,mi,-1.2,1.2,NULL) # imp1$mu, imp1$sig imp2<-ImpactMGDH(mp,mt,mi,-1.2,1.2,0)# imp2$Condprob
Compute joint probabilities of compound dry-hot events and the independent case.
LMFDH(mp,mt,threp,thret)LMFDH(mp,mt,threp,thret)
mp |
Precipitation |
mt |
Temperature |
threp |
Threshold of precipitation (e.g., 50th percentile) |
thret |
Threshold of temperature |
Joint probability of DH divided by that of independent case
Zscheischler, J. and S. I. Seneviratne (2017). Dependence of drivers affects risks associated with compound events. Science Advances, 3(6): e1700263.
mp=matrix(rnorm(120,0,1),ncol=1) mt=matrix(rnorm(120,0,1),ncol=1) threp=20 thret=80 res<-LMFDH(mp,mt,threp,thret)mp=matrix(rnorm(120,0,1),ncol=1) mt=matrix(rnorm(120,0,1),ncol=1) threp=20 thret=80 res<-LMFDH(mp,mt,threp,thret)
Fit the logistic regression model (LGR) based on occurrences of compound events (Y) and climate index (CI).The output is predicted probability of compound event occurrence for the given climate index value CI0 or the prediction performance (using AUC) and predicted values based on LOOCV
PredLogit(Y,X,type,x0=NULL)PredLogit(Y,X,type,x0=NULL)
Y |
Occurrences of compound events (0-1 binary variable) (L lead time) |
X |
Climate index (CI) as the driving factor (e.g., ENSO) with some lags |
type |
type is the "performance" or "prediction" |
x0 |
Specified CI value based on which the prediction is issued |
(1) Probability of occurrences estimated at x0 if type="prediction", shouLd input x0 (2) AUC values and predictions LOOCV if type="performance", x0 is not needed
Hao, Z. et al. (2019). Statistical prediction of the severity of compound dry-hot events based on ENSO . J. Hydrol., 572: 243-250.
Y=as.matrix(c(0,0,1,1,0,0,0,0,0,0,1,0,1,0,0,1,0)) X=c(-0.7,-1.2,1.3,0.7,-0.6,1.1,-0.5,0.8,0.5,-0.5, 1.6,-1.8,-0.5,-1.4,-0.1,2.2,-0.7) # dry-hot (or other) 0-1 events pred1<-PredLogit(Y,X,type="prediction",2) #pred1$predx0 pred2<-PredLogit(Y,X,type="performance") #pred2$aucvalue,pred2$predictionsY=as.matrix(c(0,0,1,1,0,0,0,0,0,0,1,0,1,0,0,1,0)) X=c(-0.7,-1.2,1.3,0.7,-0.6,1.1,-0.5,0.8,0.5,-0.5, 1.6,-1.8,-0.5,-1.4,-0.1,2.2,-0.7) # dry-hot (or other) 0-1 events pred1<-PredLogit(Y,X,type="prediction",2) #pred1$predx0 pred2<-PredLogit(Y,X,type="performance") #pred2$aucvalue,pred2$predictions
Compute SCEI based on monthly precipitation and temperature.
SCEIDH(pre,tem,ts)SCEIDH(pre,tem,ts)
pre |
monthly precipitation of several decades |
tem |
monthly temperature of several decades |
ts |
time scale |
The monthly SCEI series of several decades
Hao, Z. et al., 2019. Statistical prediction of the severity of compound dry-hot events based on El Ni??o-Southern Oscillation. J. Hydrol., 572, 243-250.
pre=matrix(rnorm(120,0,1),ncol=1) # 10-year monthly precipitation tem=matrix(rnorm(120,0,1),ncol=1) # 10-year monthly temperature ts=1; # ts<=12 otherwise you should revise the function SCEIDH(pre,tem,ts) #Generate monthly datapre=matrix(rnorm(120,0,1),ncol=1) # 10-year monthly precipitation tem=matrix(rnorm(120,0,1),ncol=1) # 10-year monthly temperature ts=1; # ts<=12 otherwise you should revise the function SCEIDH(pre,tem,ts) #Generate monthly data