Learn R Programming

RtsEva (version 1.1.0)

tsEvaComputeReturnPeriodsGPD: tsEvaComputeReturnPeriodsGPD

Description

tsEvaComputeReturnPeriodsGPDis a function that computes the return periods of a set of observations (peaks) for a Generalized Pareto Distribution (GPD), given the GPD parameters, threshold, peaks data, and sample time horizon.

Usage

tsEvaComputeReturnPeriodsGPD(
  epsilon,
  sigma,
  threshold,
  peaks,
  nPeaks,
  peaksID,
  sampleTimeHorizon
)

Value

A list containing the following components:

GpdPseudo

A matrix of pseudo observations obtained from the GPD for each peak value at every time step.

returnPeriods

A matrix of return periods corresponding to the pseudo observations.

PseudoObs

A data frame containing the pseudo observations and their corresponding identifiers.

Arguments

epsilon

The shape parameter of the GPD.

sigma

The scale parameter of the GPD.

threshold

The threshold value for the GPD.

peaks

A vector containing the peak values.

nPeaks

The number of peak values.

peaksID

An identifier for each peak value.

sampleTimeHorizon

The time horizon of the sample.

See Also

empdis

Examples

Run this code
# Example usage with some sample data
epsilon <- 0.1
sigma <- 2.2
threshold <- 1.3
peaks <- c(10, 20, 30, 40, 50)
nPeaks=5
peaksID=c(230,550,999,1540,3012)
SampleTimeHorizon = 70

results <- tsEvaComputeReturnPeriodsGPD(epsilon, sigma, threshold, peaks,
nPeaks, peaksID, SampleTimeHorizon)
head(results$GpdPseudo)
head(results$returnPeriods)
head(results$PseudoObs)

Run the code above in your browser using DataLab