Calculates difference in log return probabilities for two sets of covariates given return value(s) of interest, using model fit from extRemes::fevd
. Standard error is obtained via the delta method. The return probability is the probability of exceeding the return value in a single block. Differences and standard errors are returned for as many contrasts between covariate sets as provided.
calc_logReturnProbDiff_fevd(
fit,
returnValue,
covariates1,
covariates2,
getSE = TRUE,
scaling = 1,
upper = FALSE
)
fitted object from extRemes fevd
value(s) for which the log return probability difference is desired
matrix of covariate values, each row a set of covariates for which the log return probability difference relative to the corresponding row of covariates2
is desired
matrix of covariate values, each row a set of covariates
logical indicating whether standard error is desired, in addition to the point estimate
if returnValue
is scaled for numerics, this allows names of output to be on original scale
logical value indicating whether upper tail or lower tail is being considered
Results are calculated (and returned) on log scale as delta-method based standard errors are more accurate for the log probability. Confidence intervals for the ratio of return probabilities should be calculated by calculating a confidence interval for the log probability difference and exponentiating the endpoints of the interval.
This is designed to calculate differences in log return probabilities and associated standard errors for different covariate values based on the same model fit. It is not designed for differences based on separate model fits, although it may be possible handle this case by fit two models in a single model specification using dummy variables.