Learn R Programming

climextRemes (version 0.3.1)

calc_logReturnProbDiff_fevd: Calculates log return probability difference for two sets of covariates and standard error of difference given return value(s) of interest

Description

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.

Usage

calc_logReturnProbDiff_fevd(
  fit,
  returnValue,
  covariates1,
  covariates2,
  getSE = TRUE,
  scaling = 1,
  upper = FALSE
)

Arguments

fit

fitted object from extRemes fevd

returnValue

value(s) for which the log return probability difference is desired

covariates1

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

covariates2

matrix of covariate values, each row a set of covariates

getSE

logical indicating whether standard error is desired, in addition to the point estimate

scaling

if returnValue is scaled for numerics, this allows names of output to be on original scale

upper

logical value indicating whether upper tail or lower tail is being considered

Details

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.