L.record: Record Times

View source: R/L.record.R

L.recordR Documentation

Record Times

Description

Returns the record times of the values in a vector. The record times are the positions in a vector where a record occurs.

If the argument X is a matrix, then each column is treated as a different vector.

Usage

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

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.

Details

The sequence of record times \{L_1,\ldots,L_I\} can be expressed in terms of the record indicator random variables I.record by

L_i = \min\{ t \mid I_1 + I_2 + \ldots + I_t = i \}.

Record times can be calculated for both upper and lower records.

Value

If X is a vector, the function returns a list containing the vector of record times. If X is a matrix, the function returns a list where each element is a vector indicating the record times of the corresponding X column.

Author(s)

Jorge Castillo-Mateo

References

Arnold BC, Balakrishnan N, Nagaraja HN (1998). Records. Wiley Series in Probability and Statistics. Wiley, New York. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/9781118150412")}.

See Also

I.record, N.record, Nmean.record, p.record, R.record, records, S.record

Examples

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)

L.record(Y1)
L.record(Y)


RecordTest documentation built on Aug. 8, 2023, 1:09 a.m.