jackVar {boodd} | R Documentation |
Jackknife Variance Estimator
Description
Estimates the variance of a statistic using the jackknife-variance procedure in the i.i.d case.
Usage
jackVar(x, func, ...)
Arguments
x |
A vector or a matrix representing the data. |
func |
The function used to compute the statistic on each sample. |
... |
Optional additional arguments for the |
Details
When x
is a vector of length n or a matrix with n rows,
the function func
, having output size equal to p, is applied to x
with
each i-th row removed,
resulting in
T_{n-1}^{i} = func(x[-i]).
The jackknife variance is computed based on these recalculated statistics and the original statistic
T_n = func(x).
The covariance matrix is calculated according to the jackknife formula.
This method is used to estimate the variance of a statistic that is potentially biased due to the finite sample size.
Value
Returns a scalar or a covariance matrix, depending on whether the function func
is univariate or multivariate. For a function returning a vector of length
p, the output will be a covariance matrix of size p x p.
References
Bertail, P. and Dudek, A. (2025). Bootstrap for Dependent Data, with an R package (by Bernard Desgraupes and Karolina Marek) - submitted.
Efron, B. (1979). Bootstrap methods: another look at the jackknife. Ann. Statist., 7, 1-26.
Gray, H., Schucany, W. and Watkins, T. (1972). The Generalized Jackknife Statistics. Marcel Dekker, New York.
Quenouille, M.H. (1949). Approximate tests of correlation in time-series. J. Roy. Statist. Soc., Ser. B, 11, 68-84.
See Also
jackFunc
,
boots
,
jackVarBlock
,
jackFuncBlock
,
jackFuncRegen
.
Examples
set.seed(1)
x <- rnorm(101)
func <- function(x) { mean(x^2) }
jackVar(x, func)
# Function returning a vector with the mean and standard deviation of x
mfunc <- function(x) { c(mean(x), sd(x)) }
jackVar(x, mfunc)
# Function to compute the moment of order p with p as additional argument
funca <- function(x, p) { mean((x-mean(x))^p)}
jackVar(x, funca, 3)