dDtrend {skedastic}R Documentation

Probability mass function of nonparametric trend statistic DD

Description

This function computes Pr(D=k)\Pr(D = k), i.e. the probability mass function for D=i=1n(Rii)2D=\sum_{i=1}^{n} (R_i - i)^2, the nonparametric trend statistic proposed by Lehmann (1975), under the assumption that the ranks RiR_i are computed on a series of nn independent and identically distributed random variables with no ties.

Usage

dDtrend(k = "all", n, override = FALSE)

Arguments

k

An integer of length 1\ge 1 or a character "all" (the default) indicating that the probability mass function should be applied to the entire support of DD.

n

A positive integer representing the number of observations in the series. Note that computation time increases rapidly with nn and is infeasible for n>11n>11.

override

A logical. By default, the function aborts if n>11n > 11 due to the prohibitively slow computation (which may cause some systems to crash). Setting this argument to TRUE overrides the abort.

Details

The function is used within horn in computing pp-values for Horn's nonparametric test for heteroskedasticity in a linear regression model (Horn 1981). The support of DD consists of consecutive even numbers from 0 to n(n1)(n+1)3\frac{n(n-1)(n+1)}{3}, with the exception of the case n=3n=3, when the value 4 is excluded from the support. Note that computation speed for k = "all" is about the same as when k is set to an individual integer value, because the entire distribution is still computed in the latter case.

Value

A double vector containing the probabilities corresponding to the integers in its names attribute.

References

Horn P (1981). “Heteroscedasticity of Residuals: A Non-Parametric Alternative to the Goldfeld-Quandt Peak Test.” Communications in Statistics - Theory and Methods, 10(8), 795–808.

Lehmann EL (1975). Nonparametrics: Statistical Methods Based on Ranks. Holden-Day, San Francisco.

See Also

horn

Examples

prob <- dDtrend(k = "all", n = 6)
values <- as.integer(names(prob))
plot(c(values[1], values[1]), c(0, prob[1]), type = "l",
  axes = FALSE, xlab = expression(k), ylab = expression(Pr(D == k)),
  xlim = c(0, 70), yaxs = "i", ylim = c(0, 1.05 * max(prob)))
  axis(side = 1, at = seq(0, 70, 10), las = 2)
for (i in seq_along(values)) {
 lines(c(values[i], values[i]), c(0, prob[i]))
}


[Package skedastic version 2.0.2 Index]