optim.tuning: Selecting the optimal robustification parameter tau for the...

View source: R/mean.R

optim.tuningR Documentation

Selecting the optimal robustification parameter tau for the element-wise truncated or adaptive Huber estimators

Description

As the title

Usage

optim.tuning(
  X,
  S,
  h = 1,
  length_tau = 5,
  M_est = FALSE,
  start.prob = 0.95,
  ...
)

Arguments

X

A numeric pxn matrix containing n observations of a p-dimensional time series.

S

A strictly positive integer corresponding to the chosen number of non-overlapping blocks.

h

A strictly positive integer corresponding to how many neighboring blocks will be removed.

length_tau

A strictly positive integer corresponding to the length of the vector of candidate robustification parameters.

M_est

A logical scalar indicating which truncated estimator will be used (F: truncated mean estimator; T: adaptive Huber M-estimator).

start.prob

A numeric scalar in (0,1) such that the minimum value of the candidate robustification parameters is the empirical "start.prob" quantile of the corresponding coordiante of X.

...

Additional arguments.

max.tau

A positive numeric scalar corresponding to the maximum value of the candidate robustification parameters.

Value

A numeric vector with each entry corresponds the selected robustification parameter for for each coordinate.

Author(s)

Haotian Xu and Stephane Guerrier

Examples

n = 100
p = 50
Sigma = diag(1, p)
set.seed(12345)
X = VAR1_simu(n = n, mu = rep(-5, p), skip = 300, Sigma.mat = Sigma, rho = 0.7, err.dist = "pareto")
cv_result = optim.tuning(X, S = 10, h = 1, length_tau = 10, M_est = FALSE)
tau_cv = median(cv_result)
max(abs(apply(X, 1, FUN = function(x){trunc_mean(x, tau_cv)}) - rep(-5,50)))
max(abs(apply(cbind(cv_result, X), 1, FUN = function(x){trunc_mean(x[-1], x[1])}) - rep(-5,50)))
max(abs(apply(X, 1, FUN = function(x){mean(x)}) - rep(-5,50)))

HaotianXu/rcov documentation built on May 14, 2023, 5:04 a.m.