N.record {RecordTest} | R Documentation |
Number of Records
Description
Returns the number of records up to time of the
values in a vector.
If the argument X
is a matrix, then each column is treated as a
different vector.
Usage
N.record(X, record = c("upper", "lower"), weak = FALSE)
Nmean.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 |
Details
The record counting process is defined by
the number of records up to time
, and can be expressed in terms of
the record indicator random variables
I.record
by
If X
is a matrix with columns, each column is treated
as a vector and
Nmean.record
calculates for each ,
In summary:
and
Number and mean number of records for both upper and lower records can be calculated.
Value
N.record
returns a numeric matrix with the number of records
up to each time (row) for a vector or each column in
X
.
Nmean.record
returns a numeric vector with the mean number of
records in series (columns) up to each time (row)
.
Note
If X
is a vector both functions return the same values,
N.record
as a matrix and Nmean.record
as a vector.
Author(s)
Jorge Castillo-Mateo
References
Arnold BC, Balakrishnan N, Nagaraja HN (1998). Records. Wiley Series in Probability and Statistics. Wiley, New York. doi:10.1002/9781118150412.
See Also
I.record
, L.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)
N.record(Y)
Nmean.record(Y)
N.record(ZaragozaSeries)
Nmean.record(ZaragozaSeries, record = 'l')