Learn R Programming

RecordTest (version 2.2.0)

p.record: Probabilities of Record

Description

S.record and p.record return the sample number of records and mean number of records at each time \(t\) in a set of \(M\) vectors (columns of X), respectively. In particular, p.record is the estimated record probability at each time \(t\).

(For the introduccion to records see Details in I.record.)

Usage

p.record(X, record = c("upper", "lower"), weak = FALSE)

S.record(X, record = c("upper", "lower"), weak = FALSE)

Value

A vector with the number (or proportion in the case of

p.record) of records at each time \(t\) (row).

Arguments

X

A numeric vector, matrix (or data frame).

record

A character string indicating the type of record to be calculated, "upper" or "lower".

weak

Logical. If TRUE, weak records are also counted. Default to FALSE.

Author

Jorge Castillo-Mateo

Details

Given a matrix formed by \(M\) vectors (columns), measured at \(T\) times (rows), M.record calculates the number of records in the \(M\) vectors at each observed time \(t\), \(S_t\).

The function p.record is equivalent, but calculates the proportion of records at each time \(t\), that is the ratio: $$\hat p_t = \frac{S_t}{M} = \frac{I_{t,1} + \ldots + I_{t,M}}{M},$$ this proportion is an estimation of the probability of record at that time.

Following the notation in I.record, in summary: $$\code{X} = \left( \begin{array}{cccc} X_{1,1} & X_{1,2} & \cdots & X_{1,M} \\ X_{2,1} & X_{2,2} & \cdots & X_{2,M} \\ \vdots & \vdots & & \vdots \\ X_{T,1} & X_{T,2} & \cdots & X_{T,M} \\ \end{array} \right) \begin{array}{lc} \stackrel{\code{S.record}}{\longrightarrow} & \Big( S_1, S_2, \cdots, S_T \Big) \\ \\ \stackrel{\code{p.record}}{\longrightarrow} & \Big( \hat p_1, \hat p_2, \cdots, \hat p_T \Big) \\ \end{array}$$

Summaries for both upper and lower records can be calculated.

References

Cebrián AC, Castillo-Mateo J, Asín J (2022). “Record Tests to Detect Non Stationarity in the Tails with an Application to Climate Change.” Stochastic Environmental Research and Risk Assessment, 36(2), 313-330. tools:::Rd_expr_doi("10.1007/s00477-021-02122-w").

See Also

I.record, L.record, N.record, Nmean.record, R.record, records

Examples

Run this code
Y1 <- c( 1,  5,  3,  6,  6,  9,  2)
Y2 <- c(10,  5,  3,  6,  6,  9,  2)
Y3 <- c( 5,  7,  3,  6, 19,  2, 20)
Y  <- cbind(Y1, Y2, Y3)

S.record(Y)
p.record(Y)

S.record(ZaragozaSeries)
p.record(ZaragozaSeries, record = "l")

Run the code above in your browser using DataLab