Learn R Programming

ReturnCurves (version 1.0.1)

rc_gof: Goodness of fit of the Return Curve estimates

Description

Assessment of the goodness-of-fit of the return curve estimates following the approach of MurphyBarltropetal2023;textualReturnCurves.

Usage

rc_gof(retcurve, blocksize = 1, nboot = 250, nangles = 150, alpha = 0.05)

Value

An object of S4 class rc_gof.class. This object returns the arguments of the function and an extra slot gof which is a list containing:

median

A vector containing the median of the empirical probability of lying in a survival region.

lower

A vector containing the lower bound of the confidence interval.

upper

A vector containing the upper bound of the confidence interval.

Arguments

retcurve

An S4 object of class rc_est.class. See rc_est for more details.

blocksize

Size of the blocks for the block bootstrap procedure. If 1 (default), then a standard bootstrap approach is applied.

nboot

Number of bootstrap samples to be taken. Default is 250 samples.

nangles

Number of angles mm in the interval (0, /2) MurphyBarltropetal2023ReturnCurves. Default is 150 angles.

alpha

Significance level to compute the (1-)% confidence intervals. Default is 0.05.

Details

Given a return curve RC(pp), the probability of lying in a survival region is pp. Let := (m+1-j)2(m+1) 1 j m be a set of angles decreasing from near /2 to 00. For each angle _j , and corresponding point in the estimated return curve (x__j, y__j) , the empirical probability p_jp of lying in the survival region is given by the proportion of points in the region (x__j, ) (y__j, ).

Thus, for each angle _j , a (block) bootstrap procedure to the original data set is applied, and the empirical probabilities p_j estimated. Then, the median and (1-)% pointwise confidence intervals are obtained for each _j. Function plot shows the median of p_j, the confidence intervals and the true probability pp; ideally, this value should be contained in the confidence region.

We note that due to the use of empirical probabilities, the value of pp should be within the range of the data and not too extreme.

References

Examples

Run this code
library(ReturnCurves)

data(airdata)

n <- dim(airdata)[1]

prob <- 10/n

margdata <- margtransf(airdata)

rc_orig <- rc_est(margdata = margdata, p = prob, method = "hill")

# blocksize to account for temporal dependence
gof <- rc_gof(retcurve = rc_orig, blocksize = 10)

plot(gof)

# To see the the S4 object's slots
str(gof)

# To access the list of vectors
gof@gof

Run the code above in your browser using DataLab