| Type: | Package |
| Title: | Statistical Modeling of Compound Events |
| Version: | 1.0 |
| 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>. |
| Depends: | R (≥ 4.0.0) |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| Imports: | stats,pROC,mvtnorm |
| LazyData: | true |
| RoxygenNote: | 7.3.3 |
| Suggests: | testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2026-03-15 10:29:47 UTC; HAO |
| Author: | Zengchao Hao [aut, cre] |
| Maintainer: | Zengchao Hao <z.hao4univ@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-03-15 12:40:09 UTC |
Statistical Modeling of Compound Events
Description
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.
Details
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.
Author(s)
Zengchao Hao
References
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
Description
Obtain the accumulation of monthly hydro-climatic variables
Usage
ACCU(X, ts = 6)
Arguments
X |
The vector of monthly hydro-climatic variables of n years. ts is the accumulated time scale. |
ts |
The accumulated time scale |
Examples
X=runif(120, min = 0, max = 100) # 10-year monthly data
Y<-ACCU(X,ts=3) # Compute the 3 month accumulated series
Changes in compound dry-hot events
Description
Assess absolute/relative changes in compound dry-hot (DH) events at the monthly scale and event occurrences at the annual scale.
Usage
ChangeDH(pre,tem,threp,thret)
Arguments
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) |
Value
The absolute/relative change for each month and annual occurrence
References
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.
Examples
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$yrtotal
Changes in compound humid-hot events
Description
Assess changes in compound humid-hot (WH) occurrences at monthly and annual scales.
Usage
ChangeWH(pre,tem,threp,thret)
Arguments
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) |
Value
The absolute/relative change for each month and annual occurrence
References
Hao, Z., AghaKouchak, A., Phillips, T.J., 2013. Changes in concurrent monthly precipitation and temperature extremes. Environ. Res. Lett. 8(3), 034014.
Examples
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$yrtotal
Assess potential driving factors of compound dry-hot events.
Description
Use logistic regression model to establish relationship between climate indices (e.g., ENSO) and occurrences of compound dry-hot events.
Usage
DriverLogit(Y,X)
Arguments
Y |
Occurrence of compound dry-hot events (0-1 binary variable) |
X |
Climate index as the driving factor of compound events (e.g., ENSO) |
Value
slope parameter and associated p-value
References
Hao, Z. et al. (2019). A monitoring and prediction system for compound dry and hot events. Environ. Res. Lett., 14:114034.
Examples
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$pvalue
Univariate empirical probability
Description
Compute univariate empirical probability
Usage
Empdis1(mp)
Arguments
mp |
monthly precipitation of a month for several decades |
Value
The empirical probability
References
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.
Examples
mp=matrix(rnorm(120,0,1),ncol=1)
ep1<-Empdis1(mp)
Bivariate empirical probability
Description
Compute bivariate empirical probability
Usage
Empdis2(mp,mt)
Arguments
mp |
monthly precipitation of a month for several decades |
mt |
monthly temperature of a month for several decades |
Value
The bivariate empirical probability
References
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.
Examples
mp=matrix(rnorm(120,0,1),ncol=1)
mt=matrix(rnorm(120,0,1),ncol=1)
ep2<-Empdis2(mp,mt)
Occurrence of compound dry-hot events
Description
Get compound dry-hot (DH) events based on thresholds precipitation and temperature, resulting in a 0-1The binary variable
Usage
GetDH(mp,mt,threp,thret)
Arguments
mp |
Precipitation |
mt |
Temperature |
threp |
Threshold of precipitation (e.g., 20th percentile) |
thret |
Threshold of temperature (e.g., 80th percentile) |
Value
The occurrence of compound dry-hot events (0-1 binary variable)
References
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.
Examples
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 series
Occurrence of compound wet-hot events
Description
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.
Usage
GetWH(mp,mt,threp,thret)
Arguments
mp |
Precipitation |
mt |
Temperature |
threp |
Threshold of precipitation (e.g., 80th percentile) |
thret |
Threshold of temperature (e.g., 80th percentile) |
Value
The occurrence of compound wet-hot events (0-1 binary variable)
References
Hao, Z. et al (2013). Changes in concurrent monthly precipitation and temperature extremes. Environ. Res. Lett., 8(3): 034014.
Examples
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)
Impacts of concurrent droughts and hot extremes
Description
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
Usage
ImpactMGDH(mp,mt,mi,x0,y0,z0=NULL)
Arguments
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) |
Value
(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
References
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.
Examples
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$Condprob
Likelihood multiplication factor (LMF) or probability multiplication factor (PMF) of compound dry-hot events
Description
Compute joint probabilities of compound dry-hot events and the independent case.
Usage
LMFDH(mp,mt,threp,thret)
Arguments
mp |
Precipitation |
mt |
Temperature |
threp |
Threshold of precipitation (e.g., 50th percentile) |
thret |
Threshold of temperature |
Value
Joint probability of DH divided by that of independent case
References
Zscheischler, J. and S. I. Seneviratne (2017). Dependence of drivers affects risks associated with compound events. Science Advances, 3(6): e1700263.
Examples
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)
Prediction of compound event occurrences
Description
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
Usage
PredLogit(Y,X,type,x0=NULL)
Arguments
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 |
Value
(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
References
Hao, Z. et al. (2019). Statistical prediction of the severity of compound dry-hot events based on ENSO . J. Hydrol., 572: 243-250.
Examples
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$predictions
Standardized Compound Event Indicator (SCEI) for dry-hot events
Description
Compute SCEI based on monthly precipitation and temperature.
Usage
SCEIDH(pre,tem,ts)
Arguments
pre |
monthly precipitation of several decades |
tem |
monthly temperature of several decades |
ts |
time scale |
Value
The monthly SCEI series of several decades
References
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.
Examples
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 data
Monthly precipitation (pre), temperature (tem), Niño3.4 (nino) and GPP(gpp)
Description
A dataset of monthly precipitation, temperature, and Niño3.4 index for 1951-2016 and monthly GPP for 1981–2016 (1951-1980 are NAN).
Usage
data(dfptng)
Format
A data frame with 792 rows (12 months × 66 years) and 4 variables:
- pre
Monthly precipitation(unit:mm/month)
- tem
Monthly average temperature (unit: °C)
- nino
Monthly ENSO index (e.g., Nino3.4)
- gpp
GPP
Source
The data were obtained from ERA-5, NOAA, and FLUXCOM.