Learn R Programming

RecordTest (version 2.0.0)

brown.method: Brown's Method on the Number of Records

Description

Performs Brown's method on the p-values of N.test as proposed by Cebri<U+00E1>n, Castillo-Mateo and As<U+00ED>n (2021). The null hypothesis of the classical record model (i.e., of randomness) is tested against the alternative hypothesis.

Usage

brown.method(
  X,
  weights = function(t) 1,
  record = c(FU = 1, FL = 1, BU = 1, BL = 1),
  alternative = c(FU = "greater", FL = "less", BU = "less", BL = "greater"),
  correct = TRUE
)

Arguments

X

A numeric vector, matrix (or data frame).

weights

A function indicating the weight given to the different records according to their position in the series, e.g., if function(t) t-1 then \(\omega_t = t-1\).

record

Logical vector. Vector with four elements indicating if the p-value of the test for forward upper, forward lower, backward upper and backward lower are going to be used, respectively. Logical values or 0,1 values are accepted.

alternative

Vector with four character string taking values "greater" or "less" indicating the alternative hypothesis in every test (for forward upper, forward lower, backward upper and backward lower records , respectively). Under the alternative hypothesis of linear trend the FU and BL records will be greater and the FL and BU records will be less than under the null, but other combinations (e.g., for trend in variability) could be considered.

correct

Logical. Indicates, whether a continuity correction should be applied in N.test; defaults to TRUE.

Value

A "htest" object with elements:

statistic

Value of the chi-square statistic (not scaled).

parameter

Degrees of freedom \(df\) and scale parameter \(c\).

p.value

P-value.

method

A character string indicating the type of test performed.

data.name

A character string giving the name of the data.

Details

In this function, the test is implemented as given by Cebri<U+00E1>n, Castillo-Mateo and As<U+00ED>n (2021), where the p-values \(p^{(FU)}\), \(p^{(FL)}\), \(p^{(BU)}\) and \(p^{(BL)}\) of the test N.test for the four types of record are used for the statistic: $$-2 \left(\log(p^{(FU)}) + \log(p^{(FL)}) + \log(p^{(BU)}) + \log(p^{(BL)})\right).$$ (Any other combination of p-values for the test is also allowed.)

According to Brown's method (Brown, 1975) for the union of dependent p-values, the statistic follows a \(c \chi^2_{df}\) distribution, with a scale parameter \(c\) and \(df\) degrees of freedom that depend on the covariance of the p-values. This covariances are approximated according to Kost and McDermott (2002): $$\textrm{COV}\left(-2 \log(p^{(i)}), -2 \log(p^{(j)})\right) \approx 3.263 \rho_{ij} + 0.710 \rho_{ij}^2 + 0.027 \rho_{ij}^3,$$ where \(\rho_{ij}\) is the correlation between their respective statistics.

Power studies indicate that this and foster.test using all four types of records and linear weights are the two most powerful records tests against a linear drift model. In particular, this is more powerful than Mann-Kendall test against alternatives with linear drift in series of generalized Pareto variables and some cases of the generalized extreme value variables. See Cebri<U+00E1>n, Castillo-Mateo and As<U+00ED>n (2021) for more details.

References

Brown M (1975). <U+201C>A Method for Combining Non-Independent, One-Sided Tests of Significance.<U+201D> Biometrics. 31(4), 987<U+2013>992.

Cebri<U+00E1>n A, Castillo-Mateo J, As<U+00ED>n J (2021). <U+201C>Record Tests to detect non stationarity in the tails with an application to climate change.<U+201D> Unpublished manuscript.

Kost JT, McDermott MP (2002). <U+201C>Combining Dependent P-Values.<U+201D> Statistics & Probability Letters, 60(2), 183-190.

See Also

fisher.method, foster.test, N.test

Examples

Run this code
# NOT RUN {
brown.method(ZaragozaSeries)
brown.method(ZaragozaSeries, weights = function(t) t-1)
brown.method(ZaragozaSeries, weights = function(t) t-1, correct = FALSE)

# Join p-values of upper records
brown.method(ZaragozaSeries, weights = function(t) t-1, record = c(1,0,1,0))
# Join p-values of lower records
brown.method(ZaragozaSeries, weights = function(t) t-1, record = c(0,1,0,1))

# }

Run the code above in your browser using DataLab